diff options
Diffstat (limited to 'src/pkg/runtime/arm/traceback.c')
| -rw-r--r-- | src/pkg/runtime/arm/traceback.c | 51 |
1 files changed, 27 insertions, 24 deletions
diff --git a/src/pkg/runtime/arm/traceback.c b/src/pkg/runtime/arm/traceback.c index 5628b8349e..f99d738a93 100644 --- a/src/pkg/runtime/arm/traceback.c +++ b/src/pkg/runtime/arm/traceback.c @@ -117,27 +117,29 @@ runtime·gentraceback(byte *pc0, byte *sp, byte *lr0, G *g, int32 skip, uintptr else if(pcbuf != nil) pcbuf[n++] = pc; else { - // Print during crash. - // main+0xf /home/rsc/go/src/runtime/x.go:23 - // main(0x1, 0x2, 0x3) - runtime·printf("[%p] %S", fp, f->name); - if(pc > f->entry) - runtime·printf("+%p", (uintptr)(pc - f->entry)); - tracepc = pc; // back up to CALL instruction for funcline. - if(n > 0 && pc > f->entry && !waspanic) - tracepc -= sizeof(uintptr); - runtime·printf(" %S:%d\n", f->src, runtime·funcline(f, tracepc)); - runtime·printf("\t%S(", f->name); - for(i = 0; i < f->args; i++) { - if(i != 0) - runtime·prints(", "); - runtime·printhex(((uintptr*)fp)[1+i]); - if(i >= 4) { - runtime·prints(", ..."); - break; + if(showframe(f)) { + // Print during crash. + // main(0x1, 0x2, 0x3) + // /home/rsc/go/src/runtime/x.go:23 +0xf + tracepc = pc; // back up to CALL instruction for funcline. + if(n > 0 && pc > f->entry && !waspanic) + tracepc -= sizeof(uintptr); + runtime·printf("%S(", f->name); + for(i = 0; i < f->args; i++) { + if(i != 0) + runtime·prints(", "); + runtime·printhex(((uintptr*)fp)[1+i]); + if(i >= 4) { + runtime·prints(", ..."); + break; + } } + runtime·prints(")\n"); + runtime·printf("\t%S:%d", f->src, runtime·funcline(f, tracepc)); + if(pc > f->entry) + runtime·printf(" +%p", (uintptr)(pc - f->entry)); + runtime·printf("\n"); } - runtime·prints(")\n"); n++; } @@ -181,14 +183,15 @@ runtime·gentraceback(byte *pc0, byte *sp, byte *lr0, G *g, int32 skip, uintptr sp += 12; } - if(pcbuf == nil && (pc = g->gopc) != 0 && (f = runtime·findfunc(pc)) != nil) { - runtime·printf("----- goroutine created by -----\n%S", f->name); - if(pc > f->entry) - runtime·printf("+%p", (uintptr)(pc - f->entry)); + if(pcbuf == nil && (pc = g->gopc) != 0 && (f = runtime·findfunc(pc)) != nil && g->goid != 1) { + runtime·printf("created by %S\n", f->name); tracepc = pc; // back up to CALL instruction for funcline. if(n > 0 && pc > f->entry) tracepc -= sizeof(uintptr); - runtime·printf(" %S:%d\n", f->src, runtime·funcline(f, tracepc)); + runtime·printf("\t%S:%d", f->src, runtime·funcline(f, tracepc)); + if(pc > f->entry) + runtime·printf(" +%p", (uintptr)(pc - f->entry)); + runtime·printf("\n"); } return n; |
