Added machine command for reporting panic related information.
Trap undefined instructions that are used for breakpoints for all processors modes. If the mode was USR32 then post a SIGTRAP signal.
This commit is contained in:
parent
2fb1f405f7
commit
7568e05e32
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: db_interface.c,v 1.8 1996/06/12 19:57:08 mark Exp $ */
|
||||
/* $NetBSD: db_interface.c,v 1.9 1996/08/29 22:23:45 mark Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996 Scott K. Stevens
|
||||
|
@ -236,12 +236,14 @@ void db_show_vmstat_cmd __P((db_expr_t addr, int have_addr, db_expr_t count, cha
|
|||
void db_show_fs_cmd __P((db_expr_t addr, int have_addr, db_expr_t count, char *modif));
|
||||
void db_show_vnode_cmd __P((db_expr_t addr, int have_addr, db_expr_t count, char *modif));
|
||||
void db_show_intrchain_cmd __P((db_expr_t addr, int have_addr, db_expr_t count, char *modif));
|
||||
void db_show_panic_cmd __P((db_expr_t addr, int have_addr, db_expr_t count, char *modif));
|
||||
|
||||
struct db_command arm32_db_command_table[] = {
|
||||
{ "vmstat", db_show_vmstat_cmd, 0, NULL },
|
||||
{ "fs", db_show_fs_cmd, 0, NULL },
|
||||
{ "vnode", db_show_vnode_cmd, 0, NULL },
|
||||
{ "intrchain", db_show_intrchain_cmd, 0, NULL },
|
||||
{ "panic", db_show_panic_cmd, 0, NULL },
|
||||
{ NULL, NULL, 0, NULL }
|
||||
};
|
||||
|
||||
|
@ -251,8 +253,13 @@ db_trapper(addr, inst, frame)
|
|||
u_int inst;
|
||||
trapframe_t *frame;
|
||||
{
|
||||
/* db_printf("db_trapper\n");*/
|
||||
kdb_trap(1, frame);
|
||||
if ((frame->tf_spsr & PSR_MODE) != PSR_USR32_MODE) {
|
||||
if (inst == BKPT_INST)
|
||||
kdb_trap(1, frame);
|
||||
else
|
||||
panic("Undefined instruction 0x%08x @ 0x%08x in kernel\n", inst, addr);
|
||||
} else
|
||||
trapsignal(curproc, SIGTRAP, 0);
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue