Mercurial > hg > Members > kono > os9 > sbc09
changeset 28:d34482fd6945
fix ui
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 11 Jul 2018 09:03:54 +0900 |
parents | 2d6772a5c076 |
children | 3c14d647bb51 |
files | trace.c v09.c |
diffstat | 2 files changed, 29 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/trace.c Wed Jul 11 02:02:42 2018 +0900 +++ b/trace.c Wed Jul 11 09:03:54 2018 +0900 @@ -76,15 +76,15 @@ " s [count] one step trace\n" " n step over\n" " f finish this call (until stack pop)\n" - " b [adr] set break point\n" + " b [adr] set break point (on current physical addreaa)\n" " l break point list\n" " d [n] delte break point list\n" " c [count] continue;\n" - " x [adr] dump\n" + " x [adr] [count[ dump\n" #ifdef USE_MMU - " xp [adr] dump physical memory\n" + " xp page [adr] dump physical memory\n" #endif - " xi [adr] disassemble\n" + " xi [adr] [count[ disassemble\n" " 0 file disk drive 0 image\n" " 1 file disk drive 1 image\n" " L file start log to file\n" @@ -104,7 +104,7 @@ void do_escape(void) { char s[80]; - int adr,skip; + int adr,page; if (bpskip) { // skip unbreak instruction bpskip--; int ppc = paddr(pcreg,mmu); @@ -143,10 +143,10 @@ } restart: printf("v09>"); - fgets(s, 80, stdin); - if (s[0]) - s[strlen(s) - 1] = 0; + fgets(s, sizeof(s)-1, stdin); + s[strlen(s)-1] = 0; // chop switch (s[0]) { + default: case 'n': // step over if (nexti()) { bpskip = -1; @@ -178,7 +178,7 @@ } bpskip = -1; goto restart; - case 'l': // break point list + case 'B': // break point list for(BPTR bp = breakpoint; bp ; bp = bp->next) { #ifdef USE_MMU printf("%x %x %d\n", bp->laddr, bp->address, bp->count); @@ -209,18 +209,22 @@ bpskip = getarg(s+1,0); } break; - case 'x': // dump - skip = 1; - if (s[1]=='i') skip=2; - if (s[1]=='p') skip=2; - if (s[skip]) { - char *next; - int adr = getarg(s+skip,&next); + case 'x': // dump + { char *next = s+1; + if (s[1]=='i') next=s+2; + else if (s[1]=='p') { + next = s+2; + if (next[0]) { + page = getarg(next,&next); + } + } + if (next[0]) { + int adr = getarg(next,&next); int len = 32; if (next[0]) { len = getarg(next,&next); } - if (skip==2 && s[1]=='i') { + if (s[1]=='i') { Word end = adr + len; while(adr < end) { #ifdef USE_MMU @@ -234,12 +238,13 @@ } else { #ifdef USE_MMU for(int i=0; len > 0 ; i+=16, len-=16) { - if (skip==2 && s[1]=='p') { - if (adr+i > memsize) goto restart; - hexadump(phymem+adr+i,len>16?16:len,adr+i,16); + if (s[1]=='p') { + int phy = page * 0x2000 + adr + i; + if (phy > rommemsize) goto restart; + hexadump(phymem+phy,len>16?16:len,adr+i,16); } else { Byte *phyadr = mem0(phymem,adr+i,mmu); - if (phyadr > phymem+memsize) goto restart; + if (phyadr > phymem+rommemsize) goto restart; hexadump(phyadr,len>16?16:len,adr+i,16); } } @@ -252,6 +257,7 @@ } else disasm(pcreg,pcreg+32); goto restart; + } case 'L': if (logfile) fclose(logfile); @@ -337,6 +343,7 @@ bpskip = 0; #ifdef USE_MMU mmu = &mem[0xffa0]; + mem[0xffa7]=0x3f; #endif attention = escape = 1; break;