summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1997-07-19 21:05:05 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1997-07-19 21:05:05 +0000
commit6da41e637beaebb419e55b03c208b8c76b60af8b (patch)
treee7ff0123c36ca6807050a2ccf349a279123ba23f
parent70652360986c7f3b8c1ffbd8426585df715466ec (diff)
If we are using DDB, be sure to setup the SP entry of the trapframe.
Feed the trapcode to DDB. a0 is not the address of the instruction fault, maybe a1 is?
-rw-r--r--sys/arch/alpha/alpha/trap.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/arch/alpha/alpha/trap.c b/sys/arch/alpha/alpha/trap.c
index a2a36e124db..7d50bdca91c 100644
--- a/sys/arch/alpha/alpha/trap.c
+++ b/sys/arch/alpha/alpha/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.13 1997/07/06 17:18:50 niklas Exp $ */
+/* $OpenBSD: trap.c,v 1.14 1997/07/19 21:05:04 niklas Exp $ */
/* $NetBSD: trap.c,v 1.19 1996/11/27 01:28:30 cgd Exp $ */
/*
@@ -157,6 +157,9 @@ trap(a0, a1, a2, entry, framep)
v = 0;
ucode = 0;
user = (framep->tf_regs[FRAME_PS] & ALPHA_PSL_USERMODE) != 0;
+#ifdef DDB
+ framep->tf_regs[FRAME_SP] = (long)framep + FRAME_SIZE*8;
+#endif
if (user) {
sticks = p->p_sticks;
p->p_md.md_tf = framep;
@@ -230,16 +233,16 @@ sigfpe: i = SIGFPE;
goto sigfpe;
case ALPHA_IF_CODE_BPT:
case ALPHA_IF_CODE_BUGCHK:
- /* XXX is a0 trap type or address? */
- v = (caddr_t)a0;
+ /* XXX what is the address? Guess on a1 for now */
+ v = (caddr_t)a1;
ucode = 0; /* XXX determine */
i = SIGTRAP;
typ = TRAP_BRKPT;
break;
case ALPHA_IF_CODE_OPDEC:
- /* XXX is a0 trap type or address? */
- v = (caddr_t)a0;
+ /* XXX what is the address? Guess on a1 for now */
+ v = (caddr_t)a1;
ucode = 0; /* XXX determine */
#ifdef NEW_PMAP
{
@@ -438,7 +441,7 @@ panic("foo");
default:
we_re_toast:
#ifdef DDB
- if (kdb_trap(entry, 0, framep))
+ if (kdb_trap(entry, a0, framep))
return;
#endif
goto dopanic;