[hatari-devel] Debugger breakpoints for Hatari variables too?

Eero Tamminen eerot at users.berlios.de
Tue Aug 4 20:30:46 CEST 2009


Hi,

On Tuesday 04 August 2009, npomarede at corp.free.fr wrote:
> > 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...
>
> 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.

Hm.  This shouldn't be too hard to add.  I need to:
* change "regsize" to "valuetype"
* define types for numbers, different registers & variables and functions
* add function pointer to value union
* in breakpoint checking check for function type (+call that function)
* have a helper for checking whether valuetype is register because that's
  currently done in some places in the parser
* add the accessor functions for things you mentioned
* parse the names for them & fill valuetype etc properly

I can do this at the end of the week along with the number base option
stuff.


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

Btw. I forgot to mention that now "b help" will both list the supported
Hatari variables and show their currently values:
--------------------
> b help
...
  Valid Hatari variable names (and their current values) are:
  - HBL (0)
  - VBL (67)
--------------------

You can use that after the breakpoint is hit.

It could list & show the accessor function variable values too.


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


	- Eero



More information about the hatari-devel mailing list