[hatari-devel] Exception debugging & breakpoints

Eero Tamminen eerot at users.berlios.de
Fri Jun 10 21:34:21 CEST 2011


Hi,

On tiistai 07 kesäkuu 2011, Eero Tamminen wrote:
> > Each interrupt in calling Exception() in newcpu.c with and exception
> > number and and exception source (cpu, mfp). Adding a condition on the
> > expception number allows to catch any kind of interrrupt.
> 
> I guess it would need at least this in an appropriate place in
> newcpu.c::Exception():
> --------
>     if (regs.spcflags & SPCFLAG_DEBUGGER)
>         DebugCpu_Exception(nr, ExceptionSource);
> --------
> 
> But the question is where in Exception() this should be added so that
> PC, cycles etc are correct?

Hm.  Maybe best is to call debugger in Exception() just to pass
the above exception information to the debugger, but let the actual
debugger invokation happen at the normal place.

I guess the place where you added the LOG_TRACE(TRACE_CPU_EXCEPTION...)
is best for this.


> And should the DebugUI() calls elsewhere in that function be skipped
> if breakpoint was hit as it could be annoying to get first a breakpoint
> and then drop again to debugger on DebugUI() call?

This way double bus error etc DebugUI invocations happen normally and
any exception breakpoints get triggered after that only if user didn't
remove them...


	- Eero

PS. For the history feature and for later breakpoint support in remote UI,
I'm adding a parameter to DebugUI calls that tells why DebugUI was called.

A bit larger change preparing for remote API improvements later on will be
making all debugger command parsing functions to return an error code when
parsing fails.



More information about the hatari-devel mailing list