1 /* $NetBSD: db_interface.c,v 1.4 1998/08/31 14:43:40 tsubai Exp $ */ 2 /* $OpenBSD: db_interface.c,v 1.2 1996/12/28 06:21:50 rahnds Exp $ */ 3 4 #include "opt_ddb.h" 5 6 #include <sys/param.h> 7 #include <sys/proc.h> 8 #include <sys/systm.h> 9 10 #include <machine/frame.h> 11 #include <machine/db_machdep.h> 12 13 void 14 Debugger() 15 { 16 ddb_trap(); 17 } 18 19 int 20 ddb_trap_glue(frame) 21 struct trapframe *frame; 22 { 23 int msr; 24 25 if (!(frame->srr1 & PSL_PR) 26 && (frame->exc == EXC_TRC 27 || (frame->exc == EXC_PGM 28 && (frame->srr1 & 0x20000)) 29 || frame->exc == EXC_BPT)) { 30 31 bcopy(frame->fixreg, DDB_REGS->r, 32 * sizeof(u_int32_t)); 32 DDB_REGS->iar = frame->srr0; 33 DDB_REGS->msr = frame->srr1; 34 35 db_trap(T_BREAKPOINT, 0); 36 37 bcopy(DDB_REGS->r, frame->fixreg, 32 * sizeof(u_int32_t)); 38 39 return 1; 40 } 41 return 0; 42 } 43