the
This commit is contained in:
parent
83d2c4fa37
commit
d373d2f398
|
@ -57,6 +57,19 @@ mon_kerninfo(int argc, char **argv, struct Trapframe *tf)
|
|||
int
|
||||
mon_backtrace(int argc, char **argv, struct Trapframe *tf)
|
||||
{
|
||||
uint32_t *bp = (uint32_t *) read_ebp();
|
||||
uint32_t ip;
|
||||
|
||||
cprintf("Stack backtrace:\n");
|
||||
|
||||
do {
|
||||
ip = * (bp + 1);
|
||||
cprintf("ebp %08x eip %08x args", bp, ip);
|
||||
for (int i = 2; i < 7; i++)
|
||||
cprintf(" %08x", * (bp + i));
|
||||
cprintf("\n");
|
||||
} while ((bp = (uint32_t *) *bp));
|
||||
|
||||
// Your code here.
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -205,11 +205,9 @@ vprintfmt(void (*putch)(int, void*), void *putdat, const char *fmt, va_list ap)
|
|||
|
||||
// (unsigned) octal
|
||||
case 'o':
|
||||
// Replace this with your code.
|
||||
putch('X', putdat);
|
||||
putch('X', putdat);
|
||||
putch('X', putdat);
|
||||
break;
|
||||
num = getuint(&ap, lflag);
|
||||
base = 8;
|
||||
goto number;
|
||||
|
||||
// pointer
|
||||
case 'p':
|
||||
|
|
Loading…
Reference in a new issue