From: | Stephen Illingworth |
Date: | 21 Aug 2001 at 13:24:56 |
Subject: | [amiga-c] Re: 680x0 Status Register |
Hello Duane
Good explanation. Cheers.
On 20-Aug-01, you wrote:
> --- In amiga-c@y..., Stephen Illingworth <stephen.t.illingworth@b...>
>> I was wondering how Debuggers work and thought it would be fun to
>> write one. I can see many programming problems but the
>> show-stopper is whether you can control the flow of the
>> executable being debugged. The obvious solution would be to
>> set the TRACE bit in the third party program.
>
> Yes, that's how it's done. The task will then run a trace
> exception handler after each instruction is executed.
8<--- snip ---
> Generally dubuggers will LoadSeg() the program themselves
> so that they can setup the task prior to calling the code
> entry point
I can see two methods here.
Use the CreateNewProcess() function and patch the AddTask()
function to fill in the tc_TrapCode field, or setup the task
structure manually and call AddTask() direct.
Which method is the more suitable would you say?
The second method seems superior to me, but it has the
disadvantage of not performing the magic of the CreateProcess()
function. What exactly happens inside that function? And in
particular, how does the initalPC argument of AddTask() relate to
the loadsegged exe?
8<--- snip ---
> If you need an example of getting a trace handler up and
> running I think I've got a minimal implementation somewhere.
It seems straight forward enough, and I have the example from the
Libraries RKM, but it wouldn't harm anyone if you sent it anyway.
Cheers :-)
Regards
Steve
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/