diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2017-06-22 04:16:23 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2017-06-22 04:16:23 +0000 |
commit | c83c219a6359e2ab655e7b8a7fabe829fd7bc6b9 (patch) | |
tree | 2e3bf46eda5e29d75f44af906c268c0ccb288170 /libgo/go | |
parent | 55ea0ea07dc837e596f81ce972361ec46d2cb1fe (diff) | |
download | gcc-c83c219a6359e2ab655e7b8a7fabe829fd7bc6b9.zip gcc-c83c219a6359e2ab655e7b8a7fabe829fd7bc6b9.tar.gz gcc-c83c219a6359e2ab655e7b8a7fabe829fd7bc6b9.tar.bz2 |
runtime: in traceback, print panic rather than runtime.gopanic
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
Diffstat (limited to 'libgo/go')
-rw-r--r-- | libgo/go/runtime/traceback_gccgo.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libgo/go/runtime/traceback_gccgo.go b/libgo/go/runtime/traceback_gccgo.go index 0da5171..715772e 100644 --- a/libgo/go/runtime/traceback_gccgo.go +++ b/libgo/go/runtime/traceback_gccgo.go @@ -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") } } } |