]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: show frame pointer values during throw
authorRuss Cox <rsc@golang.org>
Fri, 15 Feb 2013 19:48:47 +0000 (14:48 -0500)
committerRuss Cox <rsc@golang.org>
Fri, 15 Feb 2013 19:48:47 +0000 (14:48 -0500)
Should help if stack overflows start happening again.

Fixes #3582.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/7311098

src/pkg/runtime/traceback_arm.c
src/pkg/runtime/traceback_x86.c

index 77aeb820a6fa4b8a0667d30614116a57878c7855..8ce000c1fe682afabfdd9d1a4383c2cba18e4218 100644 (file)
@@ -125,6 +125,8 @@ runtime·gentraceback(byte *pc0, byte *sp, byte *lr0, G *gp, int32 skip, uintptr
                                tracepc = pc;   // back up to CALL instruction for funcline.
                                if(n > 0 && pc > f->entry && !waspanic)
                                        tracepc -= sizeof(uintptr);
+                               if(m->throwing && gp == m->curg)
+                                       runtime·printf("[fp=%p] ", fp);
                                runtime·printf("%S(", f->name);
                                for(i = 0; i < f->args; i++) {
                                        if(i != 0)
index b0d85fd52f14c17f791fd0eaf8d9fa5f05ed0bf2..a11df6b781030c5ef77de65a5d0a6d460546092b 100644 (file)
@@ -127,6 +127,8 @@ runtime·gentraceback(byte *pc0, byte *sp, byte *lr0, G *gp, int32 skip, uintptr
                                tracepc = pc;   // back up to CALL instruction for funcline.
                                if(n > 0 && pc > f->entry && !waspanic)
                                        tracepc--;
+                               if(m->throwing && gp == m->curg)
+                                       runtime·printf("[fp=%p] ", fp);
                                runtime·printf("%S(", f->name);
                                for(i = 0; i < f->args; i++) {
                                        if(i != 0)