runtime: in traceback, print panic rather than runtime.gopanic
authorIan Lance Taylor <ian@gcc.gnu.org>
Thu, 22 Jun 2017 04:16:23 +0000 (04:16 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Thu, 22 Jun 2017 04:16:23 +0000 (04:16 +0000)
    The gc toolchain does the same thing, in gentraceback in
    runtime/traceback.go.

    The test for this is TestPanicTraceback in runtime/crash_test.go.  We
    don't yet run that test, but we will in a future change.

    Reviewed-on: https://go-review.googlesource.com/46397

From-SVN: r249495

gcc/go/gofrontend/MERGE
libgo/go/runtime/traceback_gccgo.go

index 9a23eb98b98ec140e34af414a7df7efb20922f72..17df499a095b9c4b79188613c68ba554f8b1fb6c 100644 (file)
@@ -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 0da517189ec221298714ec3ba4615fb4829e942d..715772edf92532bee3ea3d543b0842014253d2d6 100644 (file)
@@ -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")
                }
        }
 }