diff options
Diffstat (limited to 'sys/arm64/arm64/db_trace.c')
-rw-r--r-- | sys/arm64/arm64/db_trace.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/sys/arm64/arm64/db_trace.c b/sys/arm64/arm64/db_trace.c index 9123f73079ef..7b0fdeaeba29 100644 --- a/sys/arm64/arm64/db_trace.c +++ b/sys/arm64/arm64/db_trace.c @@ -28,8 +28,6 @@ #include "opt_ddb.h" -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/proc.h> #include <sys/kdb.h> @@ -50,13 +48,20 @@ __FBSDID("$FreeBSD$"); #define FRAME_UNHANDLED 4 void -db_md_list_watchpoints() +db_md_list_breakpoints(void) +{ + + dbg_show_breakpoint(); +} + +void +db_md_list_watchpoints(void) { dbg_show_watchpoint(); } -static void +static void __nosanitizeaddress db_stack_trace_cmd(struct thread *td, struct unwind_state *frame) { c_db_sym_t sym; @@ -94,7 +99,8 @@ db_stack_trace_cmd(struct thread *td, struct unwind_state *frame) struct trapframe *tf; tf = (struct trapframe *)(uintptr_t)frame->fp - 1; - if (!kstack_contains(td, (vm_offset_t)tf, + if (!__is_aligned(tf, _Alignof(struct trapframe)) || + !kstack_contains(td, (vm_offset_t)tf, sizeof(*tf))) { db_printf("--- invalid trapframe %p\n", tf); break; @@ -102,18 +108,18 @@ db_stack_trace_cmd(struct thread *td, struct unwind_state *frame) switch (frame_type) { case FRAME_SYNC: - db_printf("--- exception, esr %#x\n", + db_printf("--- exception, esr %#lx\n", tf->tf_esr); break; case FRAME_IRQ: db_printf("--- interrupt\n"); break; case FRAME_SERROR: - db_printf("--- system error, esr %#x\n", + db_printf("--- system error, esr %#lx\n", tf->tf_esr); break; case FRAME_UNHANDLED: - db_printf("--- unhandled exception, esr %#x\n", + db_printf("--- unhandled exception, esr %#lx\n", tf->tf_esr); break; default: @@ -135,7 +141,7 @@ db_stack_trace_cmd(struct thread *td, struct unwind_state *frame) } } -int +int __nosanitizeaddress db_trace_thread(struct thread *thr, int count) { struct unwind_state frame; @@ -144,15 +150,15 @@ db_trace_thread(struct thread *thr, int count) if (thr != curthread) { ctx = kdb_thr_ctx(thr); - frame.fp = (uintptr_t)ctx->pcb_x[29]; - frame.pc = (uintptr_t)ctx->pcb_lr; + frame.fp = (uintptr_t)ctx->pcb_x[PCB_FP]; + frame.pc = (uintptr_t)ctx->pcb_x[PCB_LR]; db_stack_trace_cmd(thr, &frame); } else db_trace_self(); return (0); } -void +void __nosanitizeaddress db_trace_self(void) { struct unwind_state frame; |