--- hatari/src/debug/debugcpu.c 2019/04/09 08:49:25 1.1.1.2 +++ hatari/src/debug/debugcpu.c 2019/04/09 08:51:59 1.1.1.4 @@ -21,6 +21,7 @@ const char DebugCpu_fileid[] = "Hatari d #include "debugcpu.h" #include "evaluate.h" #include "hatari-glue.h" +#include "history.h" #include "log.h" #include "m68000.h" #include "memorySnapShot.h" @@ -138,24 +139,9 @@ static int DebugCpu_SaveBin(int nArgc, c */ static void DebugCpu_ShowAddressInfo(Uint32 addr) { - Uint32 count, cycles; - const char *symbol; - bool shown = false; - - symbol = Symbols_GetByCpuAddress(addr); + const char *symbol = Symbols_GetByCpuAddress(addr); if (symbol) - { - fprintf(debugOutput, "%s", symbol); - shown = true; - } - if (Profile_CpuAddressData(addr, &count, &cycles)) - { - fprintf(debugOutput, "%s%d/%d times/cycles", - (shown ? ", " : ""), count, cycles); - shown = true; - } - if (shown) - fprintf(debugOutput, ":\n"); + fprintf(debugOutput, "%s:\n", symbol); } /** @@ -516,20 +502,24 @@ void DebugCpu_Check(void) { Profile_CpuUpdate(); } - if (LOG_TRACE_LEVEL(TRACE_CPU_DISASM)) + if (LOG_TRACE_LEVEL((TRACE_CPU_DISASM|TRACE_CPU_SYMBOLS))) { DebugCpu_ShowAddressInfo(M68000_GetPC()); } if (nCpuActiveCBs) { if (BreakCond_MatchCpu()) - DebugUI(); + DebugUI(REASON_CPU_BREAKPOINT); } if (nCpuSteps) { nCpuSteps -= 1; if (nCpuSteps == 0) - DebugUI(); + DebugUI(REASON_CPU_STEPS); + } + if (bHistoryEnabled) + { + History_AddCpu(); } } @@ -543,7 +533,8 @@ void DebugCpu_SetDebugging(void) bCpuProfiling = Profile_CpuStart(); nCpuActiveCBs = BreakCond_BreakPointCount(false); - if (nCpuActiveCBs || nCpuSteps || bCpuProfiling) + if (nCpuActiveCBs || nCpuSteps || bCpuProfiling || bHistoryEnabled + || LOG_TRACE_LEVEL((TRACE_CPU_DISASM|TRACE_CPU_SYMBOLS))) M68000_SetSpecial(SPCFLAG_DEBUGGER); else M68000_UnsetSpecial(SPCFLAG_DEBUGGER);