From 6fbfd68bf4c3af11810e73047433de96c37dc484 Mon Sep 17 00:00:00 2001 From: gkoehler Date: Wed, 27 May 2020 22:22:04 +0000 Subject: Enter ddb at a trap instruction or with db_enter(). Tell make that trap_subr.S needs assym.h. Fill in opal_cngetc() so I can type at the "ddb>" prompt. Add enough code to trap_subr.S to "c" continue from ddb. Give registers to ddb. Try to load symbols from initrd. ok kettenis@ --- sys/arch/powerpc64/powerpc64/trap.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'sys/arch/powerpc64/powerpc64/trap.c') diff --git a/sys/arch/powerpc64/powerpc64/trap.c b/sys/arch/powerpc64/powerpc64/trap.c index 091acdfc15a..7f37d556d7c 100644 --- a/sys/arch/powerpc64/powerpc64/trap.c +++ b/sys/arch/powerpc64/powerpc64/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.2 2020/05/22 15:34:43 kettenis Exp $ */ +/* $OpenBSD: trap.c,v 1.3 2020/05/27 22:22:04 gkoehler Exp $ */ /* * Copyright (c) 2020 Mark Kettenis @@ -19,10 +19,22 @@ #include #include +#ifdef DDB +#include +#endif #include void trap(struct trapframe *frame) { +#ifdef DDB + /* At a trap instruction, enter the debugger. */ + if (frame->exc == EXC_PGM && (frame->srr1 & EXC_PGM_TRAP)) { + db_ktrap(T_BREAKPOINT, frame); + frame->srr0 += 4; /* Step to next instruction. */ + return; + } +#endif + panic("trap type %lx at lr %lx", frame->exc, frame->lr); } -- cgit v1.2.3-59-g8ed1b