]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Debugger updates
authorToni Wilen <twilen@winuae.net>
Thu, 30 Apr 2026 14:59:49 +0000 (17:59 +0300)
committerToni Wilen <twilen@winuae.net>
Thu, 30 Apr 2026 14:59:49 +0000 (17:59 +0300)
debug.cpp

index 3d21cc1c8130ac4726a29f765895a1be524e06e2..b51fbf38c922c809cf033b375a37c32f4119948a 100644 (file)
--- a/debug.cpp
+++ b/debug.cpp
@@ -213,7 +213,7 @@ static const TCHAR help[] = {
        _T("  od                    Enable/disable Copper vpos/hpos tracing.\n")
        _T("  ot                    Copper single step trace.\n")
        _T("  ob <addr>             Copper breakpoint.\n")
-       _T("  H[H][s] <cnt>         Show PC history (HH=full CPU info, s=disable DMA info) <cnt> instructions.\n")
+       _T("  H[H][D] <cnt>         Show PC history (HH=full CPU info, D=disable DMA info) <cnt> instructions.\n")
        _T("  C <value>             Search for values like energy or lifes in games.\n")
        _T("  mmu <fc>              Set current MMU translation function code for all debugging instructions.\n")
        _T("  mmud                  Dump MMU tables.\n")
@@ -6079,9 +6079,8 @@ static void show_exec_lists (TCHAR *t)
 static int debug_vpos = -1;
 static int debug_hpos = -1;
 
-static void breakfunc(uae_u32 v)
+static void internal_debug(void)
 {
-       write_log(_T("Cycle breakpoint hit\n"));
        debugging = 1;
        debug_vpos = -1;
        debug_hpos = -1;
@@ -6090,6 +6089,12 @@ static void breakfunc(uae_u32 v)
        trace_mode = TRACE_IMMEDIATE;
 }
 
+static void breakfunc(uae_u32 v)
+{
+       write_log(_T("Cycle breakpoint hit\n"));
+       internal_debug();
+}
+
 void debug_hsync(void)
 {
        if (debug_vpos < 0) {
@@ -7246,9 +7251,10 @@ static bool debug_line (TCHAR *input)
                        if (*inptr == 'l') {
                                next_char (&inptr);
                                if (more_params (&inptr)) {
-                                       debug_illegal_mask = readhex(&inptr, NULL);
-                                       if (more_params(&inptr))
-                                               debug_illegal_mask |= ((uae_u64)readhex(&inptr, NULL)) << 32;
+                                       debug_illegal_mask = ((uae_u64)readhex(&inptr, NULL)) << 32;
+                                       if (more_params(&inptr)) {
+                                               debug_illegal_mask |= readhex(&inptr, NULL);
+                                       }
                                } else {
                                        debug_illegal_mask = debug_illegal ? 0 : -1;
                                        debug_illegal_mask &= ~((uae_u64)255 << 24); // mask interrupts
@@ -7524,7 +7530,6 @@ static bool debug_line (TCHAR *input)
                                uae_u32 oldpc = m68k_getpc ();
                                int lastframes, lastvpos, lasthpos;
                                struct regstruct save_regs = regs;
-                               bool dmadata = true;
 
                                badly = 0;
                                if (inptr[0] == 'H') {
@@ -7536,10 +7541,6 @@ static bool debug_line (TCHAR *input)
                                        dmadbg = 1;
                                        inptr++;
                                }
-                               if (inptr[0] == 's') {
-                                       dmadata = false;
-                                       inptr++;
-                               }
                                if (more_params(&inptr))
                                        count = readint(&inptr, NULL);
                                else
@@ -7569,7 +7570,7 @@ static bool debug_line (TCHAR *input)
                                                if (badly) {
                                                        m68k_dumpstate(NULL, 0xffffffff);
                                                } else {
-                                                       if (dmadbg && lastvpos >= 0 && dmadata) {
+                                                       if (dmadbg && lastvpos >= 0) {
                                                                dma_disasm(lastframes, lastvpos, lasthpos, history[temp].fp, history[temp].vpos, history[temp].hpos);
                                                        }
                                                        lastframes = history[temp].fp;
@@ -7913,12 +7914,18 @@ void debug_exception(int nr)
 {
        if (debug_illegal) {
                if (nr <= 63 && (debug_illegal_mask & ((uae_u64)1 << nr))) {
-                       write_log(_T("Exception %d breakpoint\n"), nr);
-                       activate_debugger();
+                       console_out_f(_T("Exception %d breakpoint\n"), nr);
+                       debug_vpos = -1;
+                       debug_hpos = -1;
+                       debug_cycles(2);
+                       internal_debug();
                }
        }
        if (trace_param[0] == 0xffffffff && trace_mode == TRACE_SKIP_INS) {
-               activate_debugger();
+               debug_vpos = -1;
+               debug_hpos = -1;
+               debug_cycles(2);
+               internal_debug();
        }
 }