1 /* $NetBSD: db_interface.c,v 1.3 1998/07/04 22:18:37 jonathan 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 9 #include <machine/frame.h> 10 #include <machine/db_machdep.h> 11 12 void 13 Debugger() 14 { 15 ddb_trap(); 16 } 17 18 int 19 ddb_trap_glue(frame) 20 struct trapframe *frame; 21 { 22 int msr; 23 24 if (!(frame->srr1 & PSL_PR) 25 && (frame->exc == EXC_TRC 26 || (frame->exc == EXC_PGM 27 && (frame->srr1 & 0x20000)) 28 || frame->exc == EXC_BPT)) { 29 30 bcopy(frame->fixreg, DDB_REGS->r, 32 * sizeof(u_int32_t)); 31 DDB_REGS->iar = frame->srr0; 32 DDB_REGS->msr = frame->srr1; 33 34 db_trap(T_BREAKPOINT, 0); 35 36 bcopy(DDB_REGS->r, frame->fixreg, 32 * sizeof(u_int32_t)); 37 38 return 1; 39 } 40 return 0; 41 } 42