[hatari-devel] Debugger breakpoints for Hatari variables too?
npomarede at corp.free.fr
npomarede at corp.free.fr
Tue Aug 4 15:13:55 CEST 2009
On Tue, 4 Aug 2009, Kåre Andersen wrote:
> On Sun, Aug 2, 2009 at 9:18 PM, Eero Tamminen<eerot at users.berlios.de> wrote:
>> Hi,
>>
>> On Friday 31 July 2009, npomarede at corp.free.fr wrote:
>>> By the way, there's a possibility that I think would be quite useful : to
>>> be able to use Hatari's variable as breakpoint condition.
>>>
>>> The 2 variables I'm thinking about for now are nVBLs and nHBL, as
>>> sometimes you know a problem will happen after a certain time, or only at
>>> a certain line, so doing something like :
>>>
>>> VBL=30 && HBL=263 && ( $ff820a ) = 0
>>>
>>> would be really cool.
>>>
>>> Certainly some other variables could be exported this way, with a simple
>>> table to associate a string to a pointer to that variable (we could
>>> assume it's always 'int' size).
>
> What would be utterly perfect (and is already available in STEem debug
> build) would be the ability to stop at a specific cycle within a
> frame(that is, PC relative to the current VBL/HBL in cycles), and to
> be able to set new breakpoints relative to the current one - in bytes
> from PC _or_ in cycles/NOPs from PC....
>
> This would make debugging synclock code a dream...
>
> Oh, and about 32/64bit ints - why not just use SDLs builtin Uint32/Sint32 types?
>
> /Kåre
Yes,
in a previous mail eero talked about having some accessor functions ; one
possible other variable could be LineCycle, and you would get it by
calling Video_GetPosition(int *pFrameCycles , int *pHBL , int *pLineCycles)
This way, we would have HBL and LineCycle variables in the debugger and
it would be possible to do such breakpoints at a specific line position.
As for setting relative breakpoints in cycles that would mean to be able
to have a variable for FrameCycles (as returned by Video_GetPosition) and
then you could do the math youself to add the desired cycles to this value
and set a breakpoint where FrameCycles=your_value.
I think that when we enter debug mode on a breakpoint (or maybe also when
pressing pause), it could be useful to display nVBLs, *pFrameCycles, *pHbl
and *pLineCycle by calling Video_GetPosition. This way, you know at what
screen position your breakpoint triggered, which is very useful when you
want to debug overscan or other video-sync related code.
Other variables that could be used for breakpoints : track/sector nbr as
used in fdc.c Could be useful to debug some disk related issue, but unless
someone really say he require them now, I'm not sure it's urgent to do
(most remaining fdc problems are related to commands timing, so unless
pasti is ported to hatari, brekpoints won't really help on these cases).
Nicolas
More information about the hatari-devel
mailing list