[hatari-devel] Debugger address base

Eero Tamminen eerot at users.berlios.de
Sun Aug 9 08:44:25 CEST 2009


Hi,

On Monday 03 August 2009, Thomas Huth wrote:
> Eero Tamminen <eerot at users.berlios.de> wrote:
> > > > > The debugger prompt could show this mode.
> > >
> > > I'd rather would just show the mode when one enters the "value"
> > > command without arguments. I think you don't change the base too
> > > often, so showing it at each prompt sounds a little bit too much.
> >
> > Why?  Currently prompt is just ">" and I'd rather have some
> > redundancy than debug something for a long time because I'd given
> > something in wrong base (e.g. because I forgot that I just switched
> > to other number base).
>
> Why? Just personal taste ;-) But showing it at the prompt is ok for me,
> too.

I'll show the selected number base only when Debugger is entered,
not on every prompt.


> > Maybe the prompt should have also the current address for disasm /
> > memdumping:
> > 	0x2000 [dec]>
> >
> > :-)
>
> Nice idea, but how do you then differentiate between memdump and disasm
> address? (I think there are two separate variables which are storing
> these addresses)

True.  Both for CPU and DSP.

Nicolas proposed that Debugger should show on entering information
about the video variables.  If that's done, it could show as well PC and
current addresses for dumping...

Any proposals on what this information should look like (i.e. layout for
it)?


> > > > > In the config file this option could be named e.g.
> > > > > NumberInputBase.  But what should be the prefix used for decimal
> > > > > numbers when non-the prefixed input is being interpreted as hex
> > > > > or binary?
> > > >
> > > > Yes, that's what I wondered too :) Maybe we could use '+' or '#' ?
> > >
> > > Sounds good, I'd prefer '+'

Conditional breakpoints and lots of other debugging code use Uint32 for
values, the "+" character got me started on thinking what should be done
with negative values.  Currently breakcond.c doesn't even accept them:
-------------
> v -2
Value '-2' is in the supported number bases:
- bin: %11111111111111111111111111111110
- dec: 4294967294
- hex: $fffffffe
> b $fffffffe = -2
ERROR in parsed string:
'$fffffffe = -2'
             ^-invalid character
-------------

And even if it would accept them, comparisons like "LineCycles < 0" don't
work as the variables code uses are unsigned.


Any suggestions on how that should be handled?

Maybe have "s" (signed) appended to the < or > comparison characters to
indicate that the comparison should be signed (both sides cast), like this:
	"LineCycles <s 0"   and  "0 >s LineCycles"
?
(And parser could warn if one does comparison against zero without this)


> > So debugger isn't going at some point going to have support for doing
> > also simple calcuations? :-)
>
> Ok, you're right. Let's better use '#' then.


	- Eero



More information about the hatari-devel mailing list