]> Cypherpunks repositories - gostls13.git/commit
runtime: change top-most return PC from goexit to goexit+PCQuantum
authorRuss Cox <rsc@golang.org>
Thu, 30 Oct 2014 00:37:44 +0000 (20:37 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 30 Oct 2014 00:37:44 +0000 (20:37 -0400)
commita5a07331444f9b48a5e09728e3d0085cfbfb2222
tree8baefd3eacf998bb1e04a758018d2ab8c2223beb
parentf9c4c16dce621f1834943f3ccda0d0a079f7b1a4
runtime: change top-most return PC from goexit to goexit+PCQuantum

If you get a stack of PCs from Callers, it would be expected
that every PC is immediately after a call instruction, so to find
the line of the call, you look up the line for PC-1.
CL 163550043 now explicitly documents that.

The most common exception to this is the top-most return PC
on the stack, which is the entry address of the runtime.goexit
function. Subtracting 1 from that PC will end up in a different
function entirely.

To remove this special case, make the top-most return PC
goexit+PCQuantum and then implement goexit in assembly
so that the first instruction can be skipped.

Fixes #7690.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/170720043
src/runtime/asm_386.s
src/runtime/asm_amd64.s
src/runtime/asm_amd64p32.s
src/runtime/asm_arm.s
src/runtime/proc.c