Page MenuHomeFreeBSD

D23508.id67801.diff
No OneTemporary

D23508.id67801.diff

Index: sys/riscv/riscv/db_trace.c
===================================================================
--- sys/riscv/riscv/db_trace.c
+++ sys/riscv/riscv/db_trace.c
@@ -38,15 +38,18 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+
#include <sys/param.h>
-#include <sys/proc.h>
#include <sys/kdb.h>
-#include <machine/pcb.h>
+#include <sys/proc.h>
+
#include <ddb/ddb.h>
#include <ddb/db_sym.h>
+#include <machine/pcb.h>
#include <machine/riscvreg.h>
#include <machine/stack.h>
+#include <machine/vmparam.h>
void
db_md_list_watchpoints()
@@ -80,9 +83,6 @@
while (1) {
pc = frame->pc;
- if (unwind_frame(frame) < 0)
- break;
-
sym = db_search_symbol(pc, DB_STGY_ANY, &offset);
if (sym == C_DB_SYM_NULL) {
value = 0;
@@ -94,11 +94,32 @@
db_printsym(frame->pc, DB_STGY_PROC);
db_printf("\n");
- db_printf("\t pc = 0x%016lx ra = 0x%016lx\n",
- pc, frame->pc);
- db_printf("\t sp = 0x%016lx fp = 0x%016lx\n",
- frame->sp, frame->fp);
- db_printf("\n");
+ if (strcmp(name, "cpu_exception_handler_supervisor") == 0 ||
+ strcmp(name, "cpu_exception_handler_user") == 0) {
+ struct trapframe *tf;
+
+ tf = (struct trapframe *)(uintptr_t)frame->sp;
+
+ if (tf->tf_scause & EXCP_INTR)
+ db_printf("--- interrupt %d\n",
+ tf->tf_scause & EXCP_MASK);
+ else
+ db_printf("--- exception %d, tval = %#lx\n",
+ tf->tf_scause & EXCP_MASK,
+ tf->tf_stval);
+ frame->sp = (uint64_t)tf->tf_sp;
+ frame->fp = (uint64_t)tf->tf_s[0];
+ frame->pc = (uint64_t)tf->tf_sepc;
+ if (!INKERNEL(frame->fp))
+ break;
+ continue;
+ }
+
+ if (strcmp(name, "fork_trampoline") == 0)
+ break;
+
+ if (unwind_frame(frame) < 0)
+ break;
}
}

File Metadata

Mime Type
text/plain
Expires
Tue, Sep 8, 3:36 PM (6 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38522557
Default Alt Text
D23508.id67801.diff (1 KB)

Event Timeline