[hatari-devel] Debugger address base

npomarede at corp.free.fr npomarede at corp.free.fr
Sun Aug 9 15:18:08 CEST 2009


On Sun, 9 Aug 2009, Eero Tamminen wrote:

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

Well, from the cpu point of view signed number are in fact represented on 
32 bits anyway, it's just a matter of interpretation, so I think that one 
possible way to handle this is to write for example :

  (a0) = $fffffffe

which is equivalent to (a0)= -2

I'm really not sure negative number would have a real use for now, I would 
say to let it as it is, and see later if people request them

Nicolas



More information about the hatari-devel mailing list