[hatari-devel] Execution history debugger command

Eero Tamminen eerot at users.berlios.de
Tue May 31 19:56:51 CEST 2011


Hi,

On sunnuntai 29 toukokuu 2011, Nicolas Pomarède wrote:
> in my long experiment of asm coding, I must admit I rarely missed a
> history. The problem is that if you only store registers (pc, ...) you
> will have an incomplete view of what happened, because you won't know
> what values were in memory at the time it was accessed. And debugging
> code without having the associated ram values is more or less just like
> reading the source code without really executing it, which is something
> you can already do.

It's not that hard to add that.  Instead of saving a fixed set of history
data to in memory ring-buffer, history functionality could run a debugger
script given by the user and direct its output to a file.  A set of suitable
named set of files could then work as the history "ring-buffer".

This isn't something that I would do on every instruction, so then
the history should probably be changed to work more like Monst which
saves the state only on breakpoints and exceptions.


Only problem is that currently some of the debugger commands output is
hard coded to stderr instead of it using the debugger log file handle, but
that's also fixable.


> 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?
:-)

	- Eero



More information about the hatari-devel mailing list