X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=blobdiff_plain;f=debug.c;h=cb12e3da0f1c4b19af72b4f0d45c10ab09fa0add;hp=6ce006501c94f294512ce5d375ca59ce20401a07;hb=75969398d9b8a9f82ea76fc4e4cbfb97b11160a4;hpb=d16b8ea0ee65b2ad901ca6b0624c07e6e4930cc4 diff --git a/debug.c b/debug.c index 6ce0065..cb12e3d 100644 --- a/debug.c +++ b/debug.c @@ -48,10 +48,10 @@ TOKEN * printexpr(TOKEN * tp) tp++; break; case CONST: - printf("$%ux ", *tp++); + printf("$%X ", *tp++); break; case ACONST: - printf("ACONST=($%ux,$%ux) ", *tp, tp[1]); + printf("ACONST=($%X,$%X) ", *tp, tp[1]); tp += 2; break; default: @@ -61,7 +61,7 @@ TOKEN * printexpr(TOKEN * tp) } } - printf(";\n"); +// printf(";\n"); return tp + 1; } @@ -73,7 +73,7 @@ int chdump(CHUNK * ch, int format) { while (ch != NULL) { - printf("chloc=$%08ux, chsize=$%ux\n", ch->chloc, ch->ch_size); + printf("chloc=$%08X, chsize=$%X\n", ch->chloc, ch->ch_size); mdump(ch->chptr, ch->ch_size, format, ch->chloc); ch = ch->chnext; } @@ -105,7 +105,7 @@ int fudump(CHUNK * ch) file = *p.wp++; line = *p.wp++; - printf("$%04x $%08ux %d.%d: ", (int)attr, loc, (int)file, (int)line); + printf("$%04X $%08X %d.%d: ", (int)attr, loc, (int)file, (int)line); if (attr & FU_EXPR) { @@ -115,9 +115,18 @@ int fudump(CHUNK * ch) } else { - printf("`%s' ;\n", (*p.sy)->sname); +// printf("`%s' ;\n", (*p.sy)->sname); + printf("`%s' ;", (*p.sy)->sname); p.sy++; } + + if ((attr & 0x0F00) == FU_JR) + { + printf(" *=$%X", *p.lp); + p.lp++; + } + + printf("\n"); } ch = ch->chnext; @@ -143,11 +152,8 @@ int mudump(void) for(mch=firstmch; mch!=NULL; mch=mch->mcnext) { - printf("mch=$%08ux mcptr=$%08ux mcalloc=$%ux mcused=$%x\n", - (uint32_t)mch, - (mch->mcptr.lw), - mch->mcalloc, - (mch->mcused)); + printf("mch=$%p mcptr=$%08X mcalloc=$%X mcused=$%X\n", + mch, (mch->mcptr.lw), mch->mcalloc, (mch->mcused)); p = mch->mcptr; @@ -167,8 +173,8 @@ int mudump(void) if (w & MSYMBOL) symbol = *p.sy++; - printf("m=$%04x to=%d loc=$%ux from=%d siz=%s", - w, w & 0x00ff, loc, from, (w & MLONG) ? "long" : "word"); + printf("m=$%04X to=%d loc=$%X from=%d siz=%s", + w, w & 0x00FF, loc, from, (w & MLONG) ? "long" : "word"); if (symbol != NULL) printf(" sym=`%s'", symbol->sname); @@ -211,21 +217,21 @@ int mdump(char * start, LONG count, int flg, LONG base) j = i; if (base != -1) - printf("%08ux ", base); + printf("%08X ", base); } switch (flg & 3) { case 0: - printf("%02x ", start[i] & 0xff); + printf("%02X ", start[i] & 0xff); ++i; break; case 1: - printf("%02x%02x ", start[i] & 0xff, start[i+1] & 0xff); + printf("%02X%02X ", start[i] & 0xff, start[i+1] & 0xff); i += 2; break; case 2: - printf("%02x%02x%02x%02x ", start[i] & 0xff, start[i+1] & 0xff, + printf("%02X%02X%02X%02X ", start[i] & 0xff, start[i+1] & 0xff, start[i+2] & 0xff, start[i+3] & 0xff); i += 4; break; @@ -272,21 +278,19 @@ int dumptok(TOKEN * tk) if (*tk >= 128) { - printf("REG=%ud", *tk++ - 128); + printf("REG=%u", *tk++ - 128); continue; } switch ((int)*tk++) { case CONST: // CONST - printf("CONST=%ud", *tk++); + printf("CONST=%u", *tk++); break; case STRING: // STRING
-// printf("STRING='%s'", (char *)*tk++); printf("STRING='%s'", string[*tk++]); break; case SYMBOL: // SYMBOL
-// printf("SYMBOL='%s'", (char *)*tk++); printf("SYMBOL='%s'", string[*tk++]); break; case EOL: // End of line @@ -339,7 +343,7 @@ int dump_everything(void) { if (sect[i].scattr & SUSED) { - printf("Section %d sloc=$%ux\n", i, sect[i].sloc); + printf("Section %d sloc=$%X\n", i, sect[i].sloc); printf("Code:\n"); chdump(sect[i].sfcode, 1); @@ -351,8 +355,8 @@ int dump_everything(void) } printf("\nMarks:\n"); - mudump(); // Dump marks - printf("Total memory allocated=$%ux\n", amemtot); + mudump(); // Dump marks +// printf("Total memory allocated=$%X\n", amemtot); return 0; }