]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Debugger f <addr> <extra parameters> fixed.
authorToni Wilen <twilen@winuae.net>
Wed, 3 Apr 2024 16:02:32 +0000 (19:02 +0300)
committerToni Wilen <twilen@winuae.net>
Wed, 3 Apr 2024 16:02:32 +0000 (19:02 +0300)
debug.cpp

index 4a7e4e658d146a137e6ddf22a2bb5b546c7335df..9469e2211540557c1e04594471ae8071d26bdee8 100644 (file)
--- a/debug.cpp
+++ b/debug.cpp
@@ -5666,6 +5666,7 @@ int instruction_breakpoint(TCHAR **c)
        struct breakpoint_node *bpn;
        int i;
        TCHAR next = 0;
+       bool err;
 
        if (more_params (c)) {
                TCHAR nc = _totupper ((*c)[0]);
@@ -5769,35 +5770,40 @@ int instruction_breakpoint(TCHAR **c)
                        return 0;
                }
                trace_mode = TRACE_RANGE_PC;
-               trace_param[0] = readhex(c, NULL);
+               trace_param[0] = readhex(c, &err);
+               if (err) {
+                       trace_mode = 0;
+                       return 0;
+               }
                if (more_params (c)) {
-                       trace_param[1] = readhex(c, NULL);
-                       return 1;
-               } else {
-                       for (i = 0; i < BREAKPOINT_TOTAL; i++) {
-                               bpn = &bpnodes[i];
-                               if (bpn->enabled && bpn->value1 == trace_param[0]) {
-                                       bpn->enabled = 0;
-                                       console_out (_T("Breakpoint removed.\n"));
-                                       trace_mode = 0;
-                                       return 0;
-                               }
+                       trace_param[1] = readhex(c, &err);
+                       if (!err) {
+                               return 1;
                        }
-                       for (i = 0; i < BREAKPOINT_TOTAL; i++) {
-                               bpn = &bpnodes[i];
-                               if (bpn->enabled)
-                                       continue;
-                               bpn->value1 = trace_param[0];
-                               bpn->type = BREAKPOINT_REG_PC;
-                               bpn->oper = BREAKPOINT_CMP_EQUAL;
-                               bpn->enabled = 1;
-                               check_breakpoint_extra(c, bpn);
-                               console_out (_T("Breakpoint added.\n"));
+               }
+               for (i = 0; i < BREAKPOINT_TOTAL; i++) {
+                       bpn = &bpnodes[i];
+                       if (bpn->enabled && bpn->value1 == trace_param[0]) {
+                               bpn->enabled = 0;
+                               console_out (_T("Breakpoint removed.\n"));
                                trace_mode = 0;
-                               break;
+                               return 0;
                        }
-                       return 0;
                }
+               for (i = 0; i < BREAKPOINT_TOTAL; i++) {
+                       bpn = &bpnodes[i];
+                       if (bpn->enabled)
+                               continue;
+                       bpn->value1 = trace_param[0];
+                       bpn->type = BREAKPOINT_REG_PC;
+                       bpn->oper = BREAKPOINT_CMP_EQUAL;
+                       bpn->enabled = 1;
+                       check_breakpoint_extra(c, bpn);
+                       console_out (_T("Breakpoint added.\n"));
+                       trace_mode = 0;
+                       break;
+               }
+               return 0;
        }
        trace_mode = TRACE_RAM_PC;
        return 1;