diff options
| author | Bruce Evans <bde@FreeBSD.org> | 1997-02-28 12:36:18 +0000 |
|---|---|---|
| committer | Bruce Evans <bde@FreeBSD.org> | 1997-02-28 12:36:18 +0000 |
| commit | 9bb932b6f2955c5d8fd23fc65acf668e9d7b01ac (patch) | |
| tree | de3d92584c10035dedf4268573fa06911f27c2ae | |
| parent | 93437134e2829441ec0917f553de4e9ba1702889 (diff) | |
Notes
| -rw-r--r-- | sys/amd64/amd64/db_trace.c | 21 | ||||
| -rw-r--r-- | sys/i386/i386/db_trace.c | 21 |
2 files changed, 26 insertions, 16 deletions
diff --git a/sys/amd64/amd64/db_trace.c b/sys/amd64/amd64/db_trace.c index 4e58144717f6..cf3d0d84a56c 100644 --- a/sys/amd64/amd64/db_trace.c +++ b/sys/amd64/amd64/db_trace.c @@ -23,7 +23,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id$ + * $Id: db_trace.c,v 1.18 1997/02/22 09:32:15 peter Exp $ */ #include <sys/param.h> @@ -127,7 +127,7 @@ db_print_stack_entry(name, narg, argnp, argp, callpc) while (narg) { if (argnp) db_printf("%s=", *argnp++); - db_printf("%x", db_get_value((int)argp, 4, FALSE)); + db_printf("%n", db_get_value((int)argp, 4, FALSE)); argp++; if (--narg != 0) db_printf(","); @@ -147,7 +147,7 @@ db_nextframe(fp, ip) { struct trapframe *tf; int frame_type; - int eip, ebp; + int eip, esp, ebp; db_expr_t offset; char *sym, *name; @@ -189,21 +189,24 @@ db_nextframe(fp, ip) */ tf = (struct trapframe *) ((int)*fp + 8); + esp = (ISPL(tf->tf_cs) == SEL_UPL) ? tf->tf_esp : (int)&tf->tf_esp; switch (frame_type) { case TRAP: if (INKERNEL((int) tf)) { eip = tf->tf_eip; ebp = tf->tf_ebp; - db_printf("--- trap %d, eip = 0x%x, ebp = 0x%x ---\n", - tf->tf_trapno, eip, ebp); + db_printf( + "--- trap %#n, eip = %#n, esp = %#n, ebp = %#n ---\n", + tf->tf_trapno, eip, esp, ebp); } break; case SYSCALL: if (INKERNEL((int) tf)) { eip = tf->tf_eip; ebp = tf->tf_ebp; - db_printf("--- syscall %d, eip = 0x%x, ebp = 0x%x ---\n", - tf->tf_eax, eip, ebp); + db_printf( + "--- syscall %#n, eip = %#n, esp = %#n, ebp = %#n ---\n", + tf->tf_eax, eip, esp, ebp); } break; case INTERRUPT: @@ -211,7 +214,9 @@ db_nextframe(fp, ip) if (INKERNEL((int) tf)) { eip = tf->tf_eip; ebp = tf->tf_ebp; - db_printf("--- interrupt, eip = 0x%x, ebp = 0x%x ---\n", eip, ebp); + db_printf( + "--- interrupt, eip = %#n, esp = %#n, ebp = %#n ---\n", + eip, esp, ebp); } break; default: diff --git a/sys/i386/i386/db_trace.c b/sys/i386/i386/db_trace.c index 4e58144717f6..cf3d0d84a56c 100644 --- a/sys/i386/i386/db_trace.c +++ b/sys/i386/i386/db_trace.c @@ -23,7 +23,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id$ + * $Id: db_trace.c,v 1.18 1997/02/22 09:32:15 peter Exp $ */ #include <sys/param.h> @@ -127,7 +127,7 @@ db_print_stack_entry(name, narg, argnp, argp, callpc) while (narg) { if (argnp) db_printf("%s=", *argnp++); - db_printf("%x", db_get_value((int)argp, 4, FALSE)); + db_printf("%n", db_get_value((int)argp, 4, FALSE)); argp++; if (--narg != 0) db_printf(","); @@ -147,7 +147,7 @@ db_nextframe(fp, ip) { struct trapframe *tf; int frame_type; - int eip, ebp; + int eip, esp, ebp; db_expr_t offset; char *sym, *name; @@ -189,21 +189,24 @@ db_nextframe(fp, ip) */ tf = (struct trapframe *) ((int)*fp + 8); + esp = (ISPL(tf->tf_cs) == SEL_UPL) ? tf->tf_esp : (int)&tf->tf_esp; switch (frame_type) { case TRAP: if (INKERNEL((int) tf)) { eip = tf->tf_eip; ebp = tf->tf_ebp; - db_printf("--- trap %d, eip = 0x%x, ebp = 0x%x ---\n", - tf->tf_trapno, eip, ebp); + db_printf( + "--- trap %#n, eip = %#n, esp = %#n, ebp = %#n ---\n", + tf->tf_trapno, eip, esp, ebp); } break; case SYSCALL: if (INKERNEL((int) tf)) { eip = tf->tf_eip; ebp = tf->tf_ebp; - db_printf("--- syscall %d, eip = 0x%x, ebp = 0x%x ---\n", - tf->tf_eax, eip, ebp); + db_printf( + "--- syscall %#n, eip = %#n, esp = %#n, ebp = %#n ---\n", + tf->tf_eax, eip, esp, ebp); } break; case INTERRUPT: @@ -211,7 +214,9 @@ db_nextframe(fp, ip) if (INKERNEL((int) tf)) { eip = tf->tf_eip; ebp = tf->tf_ebp; - db_printf("--- interrupt, eip = 0x%x, ebp = 0x%x ---\n", eip, ebp); + db_printf( + "--- interrupt, eip = %#n, esp = %#n, ebp = %#n ---\n", + eip, esp, ebp); } break; default: |
