[hatari-devel] Execution history debugger command

Nicolas Pomarède npomarede at corp.free.fr
Wed Jun 1 00:03:33 CEST 2011


Le 31/05/2011 19:56, Eero Tamminen a écrit :

>> There, you have the registers and a history of what value were in PC,
>> but I'm not sure it's enough to do something that really add extra
>> values. Breakpoints are much more useful, and in the current state we
>> have some rather good syntax to handle them.
>
> Would it be more useful to have the history saved on breakpoints instead
> of what I proposed?
>
> To get information on branches with those, I would need a new kind of
> breakpoint that is triggered only on branches which offset is larger than
> <limit>.  Would that kind of breakpoint facility be useful for you too?
>
> I guess best way to do that would be to have an internal debugger variable
> which value = abs(previous_pc - current_pc).  Any suggestions for its name?
> :-)

Honestly, I never felt the need for some kind of "branch breakpoint", a 
problem is rarely related to branches only, you need the context of all 
instructions before and after the branch, which in fact means you need 
all instructions.

Most of the time, when I want to debug complex problems, this can't be 
limited to tracking a limited history. At one point, I need to go back 
many VBLs in time, which means an history of 100000s instructions !

So, my solution is to run "hatari --trace cpu_all", which basically 
gives you an history of all the instructions ; then I add breakpoints to 
the places that make sense to me and this allows me to narrow the field 
to the source of the problem by doing successive runs of Hatari.

With a rather long practice of asm, I think it's more efficient to get a 
full trace up to the point of the crash, do a first analysis of the log 
file, then add some breakpoints here and there and iterate.


Nicolas





More information about the hatari-devel mailing list