summaryrefslogtreecommitdiff
path: root/src/pkg/runtime/traceback_x86.c
diff options
context:
space:
mode:
authorMichael Stapelberg <stapelberg@debian.org>2014-03-03 17:40:19 +0100
committerMichael Stapelberg <stapelberg@debian.org>2014-03-03 17:40:19 +0100
commitc8bf49ef8a92e2337b69c14b9b88396efe498600 (patch)
tree79832126e4ea62c62aa4e23003864d706fa2e903 /src/pkg/runtime/traceback_x86.c
parent64d2a7c8945ba05af859901f5e248f1befdd8621 (diff)
downloadgolang-c8bf49ef8a92e2337b69c14b9b88396efe498600.tar.gz
Imported Upstream version 1.2.1upstream/1.2.1
Diffstat (limited to 'src/pkg/runtime/traceback_x86.c')
-rw-r--r--src/pkg/runtime/traceback_x86.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/pkg/runtime/traceback_x86.c b/src/pkg/runtime/traceback_x86.c
index d658e8f11..8e3063f43 100644
--- a/src/pkg/runtime/traceback_x86.c
+++ b/src/pkg/runtime/traceback_x86.c
@@ -30,6 +30,16 @@ runtime·gentraceback(uintptr pc0, uintptr sp0, uintptr lr0, G *gp, int32 skip,
String file;
USED(lr0);
+
+ if(pc0 == ~(uintptr)0 && sp0 == ~(uintptr)0) { // Signal to fetch saved values from gp.
+ if(gp->syscallstack != (uintptr)nil) {
+ pc0 = gp->syscallpc;
+ sp0 = gp->syscallsp;
+ } else {
+ pc0 = gp->sched.pc;
+ sp0 = gp->sched.sp;
+ }
+ }
nprint = 0;
runtime·memclr((byte*)&frame, sizeof frame);