--- hatari/src/debug/debugdsp.c 2019/04/09 08:49:27 1.1.1.2 +++ hatari/src/debug/debugdsp.c 2019/04/09 08:52:00 1.1.1.4 @@ -21,6 +21,8 @@ const char DebugDsp_fileid[] = "Hatari d #include "debugdsp.h" #include "dsp.h" #include "evaluate.h" +#include "history.h" +#include "log.h" #include "memorySnapShot.h" #include "profile.h" #include "str.h" @@ -117,24 +119,9 @@ error_msg: */ static void DebugDsp_ShowAddressInfo(Uint16 addr) { - Uint32 count, cycles; - const char *symbol; - bool shown = false; - - symbol = Symbols_GetByDspAddress(addr); + const char *symbol = Symbols_GetByDspAddress(addr); if (symbol) - { - fprintf(debugOutput, "%s", symbol); - shown = true; - } - if (Profile_DspAddressData(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); } @@ -344,17 +331,24 @@ void DebugDsp_Check(void) { Profile_DspUpdate(); } - /* TODO: show symbols while disassembling DSP instructions */ + if (LOG_TRACE_LEVEL((TRACE_DSP_DISASM|TRACE_DSP_SYMBOLS))) + { + DebugDsp_ShowAddressInfo(DSP_GetPC()); + } if (nDspActiveCBs) { if (BreakCond_MatchDsp()) - DebugUI(); + DebugUI(REASON_DSP_BREAKPOINT); } if (nDspSteps) { nDspSteps -= 1; if (nDspSteps == 0) - DebugUI(); + DebugUI(REASON_DSP_STEPS); + } + if (bHistoryEnabled) + { + History_AddDsp(); } } @@ -369,7 +363,8 @@ void DebugDsp_SetDebugging(void) bDspProfiling = Profile_DspStart(); nDspActiveCBs = BreakCond_BreakPointCount(true); - if (nDspActiveCBs || nDspSteps || bDspProfiling) + if (nDspActiveCBs || nDspSteps || bDspProfiling || bHistoryEnabled + || LOG_TRACE_LEVEL((TRACE_DSP_DISASM|TRACE_DSP_SYMBOLS))) DSP_SetDebugging(true); else DSP_SetDebugging(false);