summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2018-02-10 10:25:45 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2018-02-10 10:25:45 +0000
commit9e225bd8aced6a2d6f5f72da97216afbadafd635 (patch)
treeec0f3d1e30a371c35df6c8e5bef0c094722d1c25 /sys
parentcc88a7f83b313b55b8c5d75042526bd9488433e2 (diff)
Revert previous & incorrect NULL dereference fix.
This unbreak backtrace across interrupt frames.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/amd64/db_trace.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/sys/arch/amd64/amd64/db_trace.c b/sys/arch/amd64/amd64/db_trace.c
index f3234a70cb3..5b3e9e27487 100644
--- a/sys/arch/amd64/amd64/db_trace.c
+++ b/sys/arch/amd64/amd64/db_trace.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_trace.c,v 1.37 2017/12/08 08:54:03 mpi Exp $ */
+/* $OpenBSD: db_trace.c,v 1.38 2018/02/10 10:25:44 mpi Exp $ */
/* $NetBSD: db_trace.c,v 1.1 2003/04/26 18:39:27 fvdl Exp $ */
/*
@@ -300,15 +300,14 @@ db_stack_trace_print(db_expr_t addr, boolean_t have_addr, db_expr_t count,
continue;
}
- if (is_trap == INTERRUPT) {
+ if (is_trap == INTERRUPT && lastframe != NULL) {
/*
* Interrupt routines don't update %rbp, so it still
* points to the frame that was interrupted. Pull
* back to just above lastframe so we can find the
* trapframe as with syscalls and traps.
*/
- frame = (struct callframe *)db_get_value(
- (db_addr_t)&lastframe->f_retaddr, sizeof(long), 0);
+ frame = (struct callframe *)&lastframe->f_retaddr;
arg0 = &frame->f_arg0;
}
@@ -397,9 +396,8 @@ db_save_stack_trace(struct db_stack_trace *st)
if (lastframe == NULL)
break;
- frame = (struct callframe *)db_get_value(
- (db_addr_t)&lastframe->f_retaddr,
- sizeof(long), 0);
+ frame =
+ (struct callframe *)&lastframe->f_retaddr;
}
lastframe = frame;