Re: [hatari-devel] Re: Hatari debugging help with WinUAE CPU core

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Le 23/01/2014 23:16, Eero Tamminen a écrit :
Hi,

Attached patch implements that and adds several new exception points
for old UAE CPU core.  It's help looks following:
-------------------------------------------
$ src/hatari --exceptions help

Hello,

regarding "--exceptions" I think it has a too broad meaning, maybe you could use "--exception_debug" instead ?

Also, regarding the change in uae-cpu/newcpu.c, I think it adds too much debug code and can hide the real work in the exception emulation, making the code less clear.

I think you should leave unchanged :

-      case 2: M68000_AddCycles(50); break;	/* Bus error */
-      case 3: M68000_AddCycles(50); break;	/* Address error */
-      case 4: M68000_AddCycles(34); break;	/* Illegal instruction */
-      case 5: M68000_AddCycles(38); break;	/* Div by zero */
-      case 6: M68000_AddCycles(40); break;	/* CHK */
-      case 7: M68000_AddCycles(34); break;	/* TRAPV */
-      case 8: M68000_AddCycles(34); break;	/* Privilege violation */
-      case 9: M68000_AddCycles(34); break;	/* Trace */
-      case 10: M68000_AddCycles(34); break;	/* Line-A - probably wrong */
-      case 11: M68000_AddCycles(34); break;	/* Line-F - probably wrong */


And add just after a call like :

if ( ( nr>=2 ) && ( nr<=11) && ( ExceptionDebugMask ) )
	DebugUI_Check_Interrupt_Mask ( nr );

This will call DebugUI_Check_Interrupt_Mask each time when 2<=nr<=11 and defer the bitmask test in the function, but it will make less modifications to the cpu code (it is slightly less efficient, but those exceptions happen rarely so it will have no performance impact)


Also, maybe make those modifications to cpu/newcpuc too ? It will be easier to merge both cpu later if they are as close as possible.

Nicolas





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/