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
-075e67bdbcb730669c1af1aa2d53bb77cbb2a3c5
+f70ef19badafb85b1caa72b51b0082deb48d433a
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
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")
}
}
}