[hatari-devel] 68030 Debug mode and new CPU

Eero Tamminen oak at helsinkinet.fi
Tue Feb 15 20:10:52 CET 2011


Hi,

On maanantai 14 helmikuu 2011, Laurent Sallafranque wrote:
> Eero, wouldit be possible for you to add the debug functions to the new
> CPU ?
> I think there're not here anymore.

Which of the debug functions?

I took a quick look at the cpu/newcpu.c and the part that allows
breakpoints, disassembly tracing etc important stuff is there in
cpu/newcpu.c::do_specialties():
    if (regs.spcflags & SPCFLAG_DEBUGGER)
                DebugCpu_Check();

Doesn't that work?


Only thing that's actually missing is exception debugging i.e. the
(non-default) option for automatically invoking debugger on certain subset
of exceptions like address & bus errors (which I've never used).


To enable that, you could start by reverting commenting out of
"activate_debugger()" calls and add this e.g. to top of newcpu.c:
---
static INLINE activate_debugger(void)
{
	if (bExceptionDebugging)
		DebugUI();
}
---

Btw. Would it make sense to add call to that also before these:
        Reset_Cold();  /* there is nothing else we can do.. */
?


Then there's some code in cpu/newcpu.c & custom.c which are behind DEBUGGER
define that you could look into.  Would e.g. the dma timings debugging stuff
be useful?


Regarding the stuff in custom.c. the commented out sleep_millis() function
body can be just:
----
void sleep_millis (int ms)
{
	SDL_Delay(ms);
}
----

The read_processor_time_* functions you can remove from there and use 
Nicolas' new Clock_GetTicks() function in read_processor_time() after
exporting that from main.c.

However, I wonder whether this processor_time stuff is even necessary,
it seems to be used only for "events"(?) and vsyncmintime, which I would
guess maybe to correspond to Hatari internal interrupts or synching sound &
screen updates stuff Nicolas recently fixed....?


	- Eero



More information about the hatari-devel mailing list