gp is a user G running on the same M as getg(), so it is a fine proxy
for gp.m.
Change-Id: I9aa1dd283ecf28878eeedd7da4ded5c901809832
Reviewed-on: https://go-review.googlesource.com/c/go/+/418576
Run-TryBot: Michael Pratt <mpratt@google.com>
Reviewed-by: Austin Clements <austin@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
var didothers bool
var deadlock mutex
+// gp is the crashing g running on this M, but may be a user G, while getg() is
+// always g0.
func dopanic_m(gp *g, pc, sp uintptr) bool {
if gp.sig != 0 {
signame := signame(gp.sig)
}
level, all, docrash := gotraceback()
- _g_ := getg()
if level > 0 {
if gp != gp.m.curg {
all = true
print("\n")
goroutineheader(gp)
traceback(pc, sp, 0, gp)
- } else if level >= 2 || _g_.m.throwing >= throwTypeRuntime {
+ } else if level >= 2 || gp.m.throwing >= throwTypeRuntime {
print("\nruntime stack:\n")
traceback(pc, sp, 0, gp)
}