[hatari-devel] Debugger improvements

Eero Tamminen eerot at users.berlios.de
Sun Feb 7 21:31:11 CET 2010


Hi,

On Saturday 06 February 2010, Laurent Sallafranque wrote:
> I'll test all of this next week, I won't be here today and tomorrow.
>
> Would it be possible to have this kind of command :
>
> d pc
> dd pc
>
> This is easier to write than d $e1563 for example ;)
> (I'm sometimes lazy)

I gave this some thought and concluded that to do this properly, I would:

* Use expression evaluation instead of checking just single symbol + number
   on:
  - address breakpoints
  - memdump
  - disasm
  The expression would be evaluated immediately

* Expression evaluation should support register, symbol & variable names.

Then you could do also things like "d a0+HBL" or "dd pc-8", not just "d pc".


Note that parenthesis are used for precedence with the evaluated
expressions, they cannot be used for indirection.  Parenthesis behaving
differently on expressions and conditional breakpoints could be a source
of confusion, but I don't see anything that could be done for that.


Some other things I thought I could add/change:

* Evaluating expressions also for conditional breakpoints.  The expressions
  (register values etc) would be evaluated when the breakpoint is added
  (the result would be shown in breakpoint addition message).  I was
  thinking of using quotes ('"') for indicating which part of the
  conditional breakpoint should be evaluated immediately when
  the breakpoint is added.

  For example to break when value in adress pointed by A0 matches the value
  currently in D0, one would use:
	(a0) = "d0"

* Removing the current address breakpoint implementation and implementing
  them as shortcuts for conditional breakpoints.  With symbol etc support
  it's getting too awkward to support two separate breakpoint
  implementations (of which the address one needs more support for
  having it both for CPU and DSP).

* Above change requires making the options in a way that makes then easier
  to locate from a command. I thought to use ":" for this.   Then the
  breakpoints would look like this:
	a $1234 : 4		# break on every fourth hit
	b $ffaa ! $ffaa : trace	# trace changes to value in $ffaa
	b pc > pc : once	# break after e.g. loop exits

* Adding "lock" option to the info command.  This option would make debugger
  to show the given info subcommand result whenever the debugger is invoked.
  To make this more useful, I would add "registers", "disasm" and "memdump"
  subcommands to "info" command.  Then to see a certain memory address
  whenever entering debugger (a breakpoint is hit etc), one would use:
	info memdump $1234 : lock

  And to switch back to currently shown stuff (CPU PC, VBL etc):
	info default : lock

* "until (u)" command to run until a certain condition happens:
	u pc > pc
  This would be just a shortcut for:
	b pc > pc :once
	cont


	- Eero



More information about the hatari-devel mailing list