]> Cypherpunks repositories - gostls13.git/commit
runtime: fix traceback of crash before LR is stored
authorRuss Cox <rsc@golang.org>
Mon, 2 Mar 2015 02:29:25 +0000 (21:29 -0500)
committerRuss Cox <rsc@golang.org>
Mon, 2 Mar 2015 05:32:05 +0000 (05:32 +0000)
commitdd82d5e72867392d2ca4656685c6af0945c5f83d
treee7d18c85aacbb2d176716899cff5edcb7bf1a662
parente15221acece3ffeb7aaca9cf967f8ea7dac6e664
runtime: fix traceback of crash before LR is stored

This fixes runtime's TestBreakpoint on ppc64:
the Breakpoint frame was not showing up in the trace.

It seems like f.frame should be either the frame size
including the saved LR (if any) or the frame size
not including the saved LR.

On ppc64, f.frame is the frame size not including the saved LR.

On arm, f.frame is the frame size not including the saved LR,
except when that's -4, f.frame is 0 instead.

The code here in the runtime expects that f.frame is the frame
size including the saved LR.

Since all three disagree and nothing else uses f.frame anymore,
stop using it here too. Use funcspdelta, which tells us the exact
difference between the FP and SP. If it's zero, LR has not been
saved yet, so the one saved for sigpanic should be recorded.

This fixes TestBreakpoint on both ppc64 and ppc64le.
I don't really understand how it ever worked there.

Change-Id: I2d2c580d5c0252cc8471e828980aeedcab76858d
Reviewed-on: https://go-review.googlesource.com/6430
Reviewed-by: Minux Ma <minux@golang.org>
src/runtime/traceback.go