Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1715)

Unified Diff: src/pkg/runtime/traceback_arm.c

Issue 12248043: code review 12248043: runtime: print "created by" for running goroutines in t... (Closed)
Patch Set: diff -r 6f0b4e0f38f8 https://dvyukov%40google.com@code.google.com/p/go/ Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pkg/runtime/runtime.h ('k') | src/pkg/runtime/traceback_x86.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pkg/runtime/traceback_arm.c
===================================================================
--- a/src/pkg/runtime/traceback_arm.c
+++ b/src/pkg/runtime/traceback_arm.c
@@ -193,20 +193,21 @@
return n;
}
-static void
-printcreatedby(G *gp)
+void
+runtime·printcreatedby(G *gp)
{
int32 line;
uintptr pc, tracepc;
Func *f;
String file;
- if((pc = gp->gopc) != 0 && (f = runtime·findfunc(pc)) != nil
- && runtime·showframe(f, gp) && gp->goid != 1) {
+ // Show what created goroutine, except main goroutine (goid 1).
+ if((pc = gp->gopc) != 0 && (f = runtime·findfunc(pc)) != nil &&
+ runtime·showframe(f, gp) && gp->goid != 1) {
runtime·printf("created by %s\n", runtime·funcname(f));
tracepc = pc; // back up to CALL instruction for funcline.
if(pc > f->entry)
- tracepc -= sizeof(uintptr);
+ tracepc -= PCQuantum;
line = runtime·funcline(f, tracepc, &file);
runtime·printf("\t%S:%d", file, line);
if(pc > f->entry)
@@ -229,7 +230,7 @@
// If that means we print nothing at all, repeat forcing all frames printed.
if(runtime·gentraceback(pc, sp, lr, gp, 0, nil, 100, nil, nil, false) == 0)
runtime·gentraceback(pc, sp, lr, gp, 0, nil, 100, nil, nil, true);
- printcreatedby(gp);
+ runtime·printcreatedby(gp);
}
// func caller(n int) (pc uintptr, file string, line int, ok bool)
« no previous file with comments | « src/pkg/runtime/runtime.h ('k') | src/pkg/runtime/traceback_x86.c » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b