diff mbox

libgo patch committed: Skip runtime functions with no name in runtime/pprof

Message ID CAOyqgcXu7EqBeDNE15ia_QMwM3p2g0+XZa7h1w84acZF08hNug@mail.gmail.com
State New
Headers show

Commit Message

Ian Lance Taylor April 17, 2015, 9:29 p.m. UTC
GCC PR 65797 causes some of the runtime functions to be compiled with
no name in the debug info.  This in turn causes the runtime/pprof test
to fail as reported in GCC PR 64683.

There are no good choices when a function has no name in the debug
info, but this patch assumes that if we see such a function while
reading the runtime functions, we assume that it is also a runtime
function.

Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.
Committed to mainline and GCC 5 branch.

Ian
diff mbox

Patch

diff -r df28882adbdf libgo/go/runtime/pprof/pprof.go
--- a/libgo/go/runtime/pprof/pprof.go	Fri Apr 17 12:28:57 2015 -0700
+++ b/libgo/go/runtime/pprof/pprof.go	Fri Apr 17 14:24:43 2015 -0700
@@ -351,6 +351,10 @@ 
 			if !show && !strings.Contains(name, ".") && strings.HasPrefix(name, "__go_") {
 				continue
 			}
+			if !show && name == "" {
+				// This can happen due to http://gcc.gnu.org/PR65797.
+				continue
+			}
 			show = true
 			fmt.Fprintf(w, "#\t%#x\t%s+%#x\t%s:%d\n", pc, name, pc-f.Entry(), file, line)
 		}