From 112049176fce4324bd752460c2454d6d41562d8b Mon Sep 17 00:00:00 2001 From: Alessandro Arzilli Date: Fri, 20 Mar 2020 19:32:41 +0100 Subject: [PATCH] proc: fix switch to goroutine stack (#1948) When switching to the goroutine stack the stack iterator registers might not have any entry for the BP register, make sure to add it instead of just trying to change it. --- 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 e3182d4e..44709e28 100644 --- a/pkg/proc/stack.go +++ b/pkg/proc/stack.go @@ -267,7 +267,7 @@ func (it *stackIterator) switchToGoroutineStack() { it.top = false it.pc = it.g.PC it.regs.Reg(it.regs.SPRegNum).Uint64Val = it.g.SP - it.regs.Reg(it.regs.BPRegNum).Uint64Val = it.g.BP + it.regs.AddReg(it.regs.BPRegNum, op.DwarfRegisterFromUint64(it.g.BP)) if _, ok := it.bi.Arch.(*ARM64); ok { it.regs.Reg(it.regs.LRRegNum).Uint64Val = it.g.LR }