From 591c5c404503abc86c748233f32c289c47244a69 Mon Sep 17 00:00:00 2001 From: peter Date: Sat, 21 May 2005 00:02:12 +0000 Subject: [PATCH] For non-profiling kernels, there were two symbols assigned to the same address. One was alltraps_with_regs_pushed, the other was calltrap. When the stack tracer walks up, it looks for magic symbol names to determine how to parse non-standard stack frames, such as a trapframe. It was looking for "calltrap". Which of the two symbols you got depended on things like Phase of moon, etc. If you were unlucky, you got a garbage stack trace for things like 'debug.trace_on_panic', which would completely hide the actual source of the problem. --- sys/amd64/amd64/exception.S | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/amd64/amd64/exception.S b/sys/amd64/amd64/exception.S index 8f80a43db068..3a0008e75cce 100644 --- a/sys/amd64/amd64/exception.S +++ b/sys/amd64/amd64/exception.S @@ -165,8 +165,9 @@ alltraps_pushregs_no_rdi: movq %r13,TF_R13(%rsp) movq %r14,TF_R14(%rsp) movq %r15,TF_R15(%rsp) -alltraps_with_regs_pushed: FAKE_MCOUNT(TF_RIP(%rsp)) + .globl calltrap + .type calltrap,@function calltrap: call trap MEXITCOUNT @@ -434,4 +435,5 @@ doreti_iret_fault: movq %r15,TF_R15(%rsp) movq $T_PROTFLT,TF_TRAPNO(%rsp) movq $0,TF_ERR(%rsp) /* XXX should be the error code */ - jmp alltraps_with_regs_pushed + FAKE_MCOUNT(TF_RIP(%rsp)) + jmp calltrap