Skip to content

Commit

Permalink
Minor debugging improvements.
Browse files Browse the repository at this point in the history
Support '%p' format in bprintf.
Display pointer of register in debug output (useful for calculating
    start stack).
  • Loading branch information
KevinOConnor committed Mar 29, 2008
1 parent f888f8c commit f06f03a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/output.c
Expand Up @@ -147,6 +147,7 @@ bprintf(u16 action, const char *fmt, ...)
val = va_arg(args, s32);
putuint(action, val);
break;
case 'p':
case 'x':
val = va_arg(args, s32);
puthex(action, val);
Expand Down Expand Up @@ -178,9 +179,8 @@ dump_regs(const char *fname, const char *type, struct bregs *regs)
bprintf(0, "%s %s: a=%x b=%x c=%x d=%x si=%x di=%x\n"
, type, fname, regs->eax, regs->ebx, regs->ecx, regs->edx
, regs->esi, regs->edi);
bprintf(0, " ds=%x es=%x ip=%x cs=%x f=%x\n"
, regs->ds, regs->es
, regs->ip, regs->cs, regs->flags);
bprintf(0, " ds=%x es=%x ip=%x cs=%x f=%x r=%p\n"
, regs->ds, regs->es, regs->ip, regs->cs, regs->flags, regs);
}

void
Expand Down

0 comments on commit f06f03a

Please sign in to comment.