Fix slight bogosity in trap frame handling, and combine with syscall case.

This commit is contained in:
mycroft 1994-10-09 13:48:40 +00:00
parent e19b0472c8
commit aef750bbec

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the * any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes. * rights to redistribute these changes.
* *
* $Id: db_trace.c,v 1.9 1994/10/09 13:27:09 mycroft Exp $ * $Id: db_trace.c,v 1.10 1994/10/09 13:48:40 mycroft Exp $
*/ */
#include <sys/param.h> #include <sys/param.h>
@ -134,7 +134,6 @@ db_nextframe(fp, ip, argp, is_trap)
int *argp; /* in */ int *argp; /* in */
int is_trap; /* in */ int is_trap; /* in */
{ {
db_regs_t *saved_regs;
switch (is_trap) { switch (is_trap) {
case 0: case 0:
@ -143,33 +142,21 @@ db_nextframe(fp, ip, argp, is_trap)
*fp = (struct i386_frame *) *fp = (struct i386_frame *)
db_get_value((int) &(*fp)->f_frame, 4, FALSE); db_get_value((int) &(*fp)->f_frame, 4, FALSE);
break; break;
case SYSCALL:
case TRAP: case TRAP:
default: default: {
/* struct trapframe *tf;
* We know that trap() has 1 argument and we know that
* it is an (int *).
*/
#if 0
saved_regs = (db_regs_t *)
db_get_value((int)argp, 4, FALSE);
#endif
saved_regs = (db_regs_t *)argp;
db_printf("--- trap (number %d) ---\n",
saved_regs->tf_trapno & 0xffff);
db_printsym(saved_regs->tf_eip, DB_STGY_XTRN);
db_printf(":\n");
*fp = (struct i386_frame *)saved_regs->tf_ebp;
*ip = (db_addr_t)saved_regs->tf_eip;
break;
case SYSCALL: { /* The only argument to trap() or syscall() is the trapframe. */
struct trapframe *saved_regs = (struct trapframe *)argp; tf = (struct trapframe *)argp;
db_printf("--- %s (number %d) ---\n",
db_printf("--- syscall (number %d) ---\n", saved_regs->tf_eax); is_trap == SYSCALL ? "syscall" : "trap",
db_printsym(saved_regs->tf_eip, DB_STGY_XTRN); is_trap == SYSCALL ? tf->tf_eax : tf->tf_trapno);
db_printsym(tf->tf_eip, DB_STGY_XTRN);
db_printf(":\n"); db_printf(":\n");
*fp = (struct i386_frame *)saved_regs->tf_ebp; *fp = (struct i386_frame *)tf->tf_ebp;
*ip = (db_addr_t)saved_regs->tf_eip; *ip = (db_addr_t)tf->tf_eip;
break; break;
} }
} }