From: Toni Wilen Date: Mon, 24 Jul 2023 09:50:54 +0000 (+0300) Subject: Added debugger reset commands. X-Git-Tag: 5.1.0~145 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=fe19d4419326524429d36299a87b2ac869479f74;p=francis%2Fwinuae.git Added debugger reset commands. --- diff --git a/debug.cpp b/debug.cpp index 6ce2fe15..ce5c3219 100644 --- a/debug.cpp +++ b/debug.cpp @@ -150,6 +150,11 @@ void activate_debugger_new_pc(uaecptr pc, int len) trace_param[1] = pc + len; } +static void debug_continue(void) +{ + set_special(SPCFLAG_BRK); +} + bool debug_enforcer(void) { if (!break_if_enforcer) @@ -6454,6 +6459,29 @@ static void dma_disasm(int frames, int vp, int hp, int frames_end, int vp_end, i static uaecptr nxdis, nxmem, asmaddr; static bool ppcmode, asmmode; +static bool parsecmd(TCHAR *cmd, bool *out) +{ + if (!_tcsicmp(cmd, _T("reset"))) { + deactivate_debugger(); + debug_continue(); + uae_reset(0, 0); + return true; + } + if (!_tcsicmp(cmd, _T("reseth"))) { + deactivate_debugger(); + debug_continue(); + uae_reset(1, 0); + return true; + } + if (!_tcsicmp(cmd, _T("resetk"))) { + deactivate_debugger(); + debug_continue(); + uae_reset(0, 1); + return true; + } + return false; +} + static bool debug_line (TCHAR *input) { TCHAR cmd, *inptr; @@ -6485,6 +6513,10 @@ static bool debug_line (TCHAR *input) } } + ignore_ws(&inptr); + if (parsecmd(inptr, &err)) { + return err; + } cmd = next_char (&inptr); switch (cmd) @@ -7152,11 +7184,6 @@ static void addhistory(void) } } -static void debug_continue(void) -{ - set_special (SPCFLAG_BRK); -} - void debug_exception(int nr) { if (debug_illegal) {