From dd3cc63d8fe087935cb4af7a52e52504538c87ab Mon Sep 17 00:00:00 2001 From: Alessandro Arzilli Date: Thu, 16 Feb 2017 20:20:12 +0100 Subject: [PATCH] proc: use original PC for Call position (#736) The PC we have is relative to the first instruction after the CALL instruction currently being executed. Anyone watching a disassembly will understand what's happening if we report the return PC, but reporting the first PC of the current line is useless and confusing. --- pkg/proc/stack.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/proc/stack.go b/pkg/proc/stack.go index e48773b4..8b282a9a 100644 --- a/pkg/proc/stack.go +++ b/pkg/proc/stack.go @@ -230,7 +230,7 @@ func (dbp *Process) frameInfo(pc, sp uint64, top bool) (Stackframe, error) { r := Stackframe{Current: Location{PC: pc, File: f, Line: l, Fn: fn}, CFA: cfa, FDE: fde, Ret: binary.LittleEndian.Uint64(data), addrret: uint64(retaddr)} if !top { r.Call.File, r.Call.Line, r.Call.Fn = dbp.PCToLine(pc - 1) - r.Call.PC, _, _ = dbp.goSymTable.LineToPC(r.Call.File, r.Call.Line) + r.Call.PC = r.Current.PC } else { r.Call = r.Current }