Re: [hatari-devel] debugger, exceptions

[ Thread Index | Date Index | More Archives ]


On maanantai 15 huhtikuu 2013, Nicolas Pomarède wrote:
> On 14/04/2013 22:56, Douglas Little wrote:
> > Hi, I have a question about the debugger. How can it be configured to
> > wake up when an exception occurs in the emulated program? e.g. a bus
> > error.
> I'm not sure the debugger can breakpoint on exception for now.

There's the exception debugging option "-D", but that catches only
few of the possible exceptions and isn't implemented for the WinUAE
CPU core, just for the old UAE one.

> But as any exception will fetch its vector from ram and jump to the
> corresponding handler, you can put a breakpoint at the start of this
> handler.
> For example, bus error address is at $8, and is 02fc0b0a  for tos 1.04.
> So "b pc=$fc0b0a" will break on a bus error.

Plain PC address breakpoints can be set just with:
	a $fc0b0a

If one wants to catch also exception vector changes, one could use:
	b pc=($8)

If one just wants to see what caused them, one could use:
	history on
	lock history
	b pc=($8) :trace

To see N instructions preceeding calling PC address given at $8.

	- Eero

Mail converted by MHonArc 2.6.19+