This libgo patch changes tracebacks to print "panic" rather than
"runtime.gopanic".  Since the user's code calls "panic", this is
generally clearer.  The test for this is TestPanicTraceback in
runtime/crash_test.go; we don't run it yet, but we will soon.
Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu.  Committed
to mainline.

Ian
Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE     (revision 249494)
+++ gcc/go/gofrontend/MERGE     (working copy)
@@ -1,4 +1,4 @@
-075e67bdbcb730669c1af1aa2d53bb77cbb2a3c5
+f70ef19badafb85b1caa72b51b0082deb48d433a
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
Index: libgo/go/runtime/traceback_gccgo.go
===================================================================
--- libgo/go/runtime/traceback_gccgo.go (revision 249205)
+++ libgo/go/runtime/traceback_gccgo.go (working copy)
@@ -77,7 +77,11 @@ func traceback(skip int32) {
 func printtrace(locbuf []location, gp *g) {
        for i := range locbuf {
                if showframe(locbuf[i].function, gp) {
-                       print(locbuf[i].function, "\n\t", locbuf[i].filename, 
":", locbuf[i].lineno, "\n")
+                       name := locbuf[i].function
+                       if name == "runtime.gopanic" {
+                               name = "panic"
+                       }
+                       print(name, "\n\t", locbuf[i].filename, ":", 
locbuf[i].lineno, "\n")
                }
        }
 }

Reply via email to