summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2008-06-22 21:02:12 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2008-06-22 21:02:12 +0000
commit8af57fdf574da8b61433ede4ae2b3b17f6d9cb5c (patch)
tree8742b7bffbc7c2d2956e3e6d14683f93c3632946 /sys
parent59be0deb6c8aa359e4c31003703d97b85e6e3e94 (diff)
Like alpha, db_stack_dump() on mips and sh needs complete frame information
and can not work from a stack address only. Mention this and abort instead of printing a wrong trace. (prefer kern.splassert=3 to =2 on these platforms)
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/mips64/mips64/db_machdep.c7
-rw-r--r--sys/arch/sh/sh/db_trace.c7
2 files changed, 12 insertions, 2 deletions
diff --git a/sys/arch/mips64/mips64/db_machdep.c b/sys/arch/mips64/mips64/db_machdep.c
index 245a5808b31..f84585025a0 100644
--- a/sys/arch/mips64/mips64/db_machdep.c
+++ b/sys/arch/mips64/mips64/db_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_machdep.c,v 1.16 2008/02/29 19:00:39 miod Exp $ */
+/* $OpenBSD: db_machdep.c,v 1.17 2008/06/22 21:02:10 miod Exp $ */
/*
* Copyright (c) 1998-2003 Opsycon AB (www.opsycon.se)
@@ -224,6 +224,11 @@ db_stack_trace_print(addr, have_addr, count, modif, pr)
extern char k_general[];
struct trap_frame *regs = &ddb_regs;
+ if (have_addr) {
+ (*pr)("mips trace requires a trap frame... giving up\n");
+ return;
+ }
+
/* get initial values from the exception frame */
sp = (vaddr_t)regs->sp;
pc = (vaddr_t)regs->pc;
diff --git a/sys/arch/sh/sh/db_trace.c b/sys/arch/sh/sh/db_trace.c
index 5e01584a975..311b6161e48 100644
--- a/sys/arch/sh/sh/db_trace.c
+++ b/sys/arch/sh/sh/db_trace.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_trace.c,v 1.4 2007/03/17 20:23:05 miod Exp $ */
+/* $OpenBSD: db_trace.c,v 1.5 2008/06/22 21:02:11 miod Exp $ */
/* $NetBSD: db_trace.c,v 1.19 2006/01/21 22:10:59 uwe Exp $ */
/*-
@@ -81,6 +81,11 @@ db_stack_trace_print(db_expr_t addr, int have_addr, db_expr_t count,
db_addr_t callpc, frame, lastframe;
uint32_t vbr;
+ if (have_addr) {
+ (*print)("sh trace requires a trap frame... giving up\n");
+ return;
+ }
+
__asm volatile("stc vbr, %0" : "=r"(vbr));
frame = ddb_regs.tf_r14;