--- hatari/src/debug/debugdsp.c 2019/04/09 08:56:49 1.1.1.8 +++ hatari/src/debug/debugdsp.c 2019/04/09 08:59:20 1.1.1.10 @@ -11,6 +11,7 @@ const char DebugDsp_fileid[] = "Hatari d #include #include +#include #include "config.h" @@ -103,12 +104,18 @@ error_msg: /** * Check whether given address matches any DSP symbol and whether * there's profiling information available for it. If yes, show it. + * + * @return true if symbol was shown, false otherwise */ -static void DebugDsp_ShowAddressInfo(Uint16 addr, FILE *fp) +static bool DebugDsp_ShowAddressInfo(Uint16 addr, FILE *fp) { - const char *symbol = Symbols_GetByDspAddress(addr); + const char *symbol = Symbols_GetByDspAddress(addr, SYMTYPE_ALL); if (symbol) + { fprintf(fp, "%s:\n", symbol); + return true; + } + return false; } @@ -119,6 +126,7 @@ int DebugDsp_DisAsm(int nArgc, char *psA { Uint32 lower, upper; Uint16 dsp_disasm_upper = 0; + int shown, lines = INT_MAX; if (!bDspEnabled) { @@ -164,15 +172,13 @@ int DebugDsp_DisAsm(int nArgc, char *psA } if (!dsp_disasm_upper) { - int lines = ConfigureParams.Debugger.nDisasmLines; - if ( dsp_disasm_addr < (0xFFFF - lines)) - dsp_disasm_upper = dsp_disasm_addr + lines; - else - dsp_disasm_upper = 0xFFFF; + lines = DebugUI_GetPageLines(ConfigureParams.Debugger.nDisasmLines, 8); + dsp_disasm_upper = 0xFFFF; } fprintf(debugOutput, "DSP disasm 0x%hx-0x%hx:\n", dsp_disasm_addr, dsp_disasm_upper); - while (dsp_disasm_addr < dsp_disasm_upper) { - DebugDsp_ShowAddressInfo(dsp_disasm_addr, debugOutput); + for (shown = 1; shown < lines && dsp_disasm_addr < dsp_disasm_upper; shown++) { + if (DebugDsp_ShowAddressInfo(dsp_disasm_addr, debugOutput)) + shown++; dsp_disasm_addr = DSP_DisasmAddress(debugOutput, dsp_disasm_addr, dsp_disasm_addr); } fflush(debugOutput); @@ -213,7 +219,7 @@ int DebugDsp_MemDump(int nArgc, char *ps range = psArgs[1] + 2; break; } - /* pass-through */ + /* fall through */ default: return DebugUI_PrintCmdHelp(psArgs[0]); } @@ -260,7 +266,7 @@ int DebugDsp_MemDump(int nArgc, char *ps if (!dsp_memdump_upper) { - int lines = ConfigureParams.Debugger.nMemdumpLines; + int lines = DebugUI_GetPageLines(ConfigureParams.Debugger.nMemdumpLines, 8); if ( dsp_memdump_addr < (0xFFFF - lines)) dsp_memdump_upper = dsp_memdump_addr + lines; else