From e5b6ca57460a85dc8bebbc57154beb4c9732e307 Mon Sep 17 00:00:00 2001 From: andrew Date: Tue, 25 Aug 2015 16:49:10 +0000 Subject: [PATCH] Call into kdb on a data abort when it's enabled. This is needed to correctly handle trying to access an invalid address in the debugger. While here document that the breakpoint handler is supposed to fall through to the following case. Sponsored by: ABT Systems Ltd --- sys/arm64/arm64/trap.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c index 58021514509..249322e6d05 100644 --- a/sys/arm64/arm64/trap.c +++ b/sys/arm64/arm64/trap.c @@ -155,6 +155,13 @@ data_abort(struct trapframe *frame, uint64_t esr, int lower) uint64_t far; int error, sig, ucode; +#ifdef KDB + if (kdb_active) { + kdb_reenter(); + return; + } +#endif + td = curthread; pcb = td->td_pcb; @@ -221,6 +228,11 @@ data_abort(struct trapframe *frame, uint64_t esr, int lower) frame->tf_elr = pcb->pcb_onfault; return; } +#ifdef KDB + if (debugger_on_panic || kdb_active) + if (kdb_trap(ESR_ELx_EXCEPTION(esr), 0, frame)) + return; +#endif panic("vm_fault failed: %lx", frame->tf_elr); } } @@ -293,6 +305,7 @@ do_el1h_sync(struct trapframe *frame) break; } #endif + /* FALLTHROUGH */ case EXCP_WATCHPT_EL1: case EXCP_SOFTSTP_EL1: #ifdef KDB -- 2.45.0