diff trace.c @ 52:51b437557f42

boot without disk image dir -e on other directory
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 22 Jul 2018 15:52:39 +0900
parents 52f7ad4c2ebb
children
line wrap: on
line diff
--- a/trace.c	Sun Jul 22 05:48:04 2018 +0900
+++ b/trace.c	Sun Jul 22 15:52:39 2018 +0900
@@ -182,7 +182,6 @@
                    bpskip = -1;
                    break;
                 } 
-        default:
         case 's':   // one step trace
                 trskip = 1;
                 if (s[1]) {
@@ -378,6 +377,10 @@
 #endif
                 attention = escape = 1;
                 break;
+        default:  // one step trace
+                trskip = 1;
+                bpskip = 0;
+                attention = escape = 1;
         }
         if (tracing||breakpoint||trskip||bpskip||stkskip) { attention = escape = 1; }
         else attention = 0;
@@ -386,16 +389,17 @@
 
 void setbreak(int adr, int count) {
   BPTR bp = calloc(1,sizeof(BP));
-  bp->next = breakpoint;
-  breakpoint = bp;
   bp->count = count;
   bp->laddr = adr;
   bp->address = paddr(adr,mmu);
 #ifdef USE_MMU
+  if (bp->address >= memsize) { free(bp); return; }
   bp->watch = *mem0(phymem,adr,mmu);
 #else
   bp->watch = mem[adr];
 #endif
+  bp->next = breakpoint;
+  breakpoint = bp;
 }
 
 int nexti(void) {