]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Added debugger reset commands.
authorToni Wilen <twilen@winuae.net>
Mon, 24 Jul 2023 09:50:54 +0000 (12:50 +0300)
committerToni Wilen <twilen@winuae.net>
Mon, 24 Jul 2023 09:50:54 +0000 (12:50 +0300)
debug.cpp

index 6ce2fe15cc142dada21e7e09665f65e8d0f861c0..ce5c3219ea7d338c2292fa39d8b3325b5a3d621e 100644 (file)
--- 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) {