From 27f88731eba585e1d9b5e425f61d270ff170ed68 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Fri, 9 Jun 2017 11:58:53 -0400 Subject: [PATCH] runtime: print pc with fp/sp in traceback If we're in a situation where printing the fp and sp in the traceback is useful, it's almost certainly also useful to print the PC. Change-Id: Ie48a0d5de8a54b5b90ab1d18638a897958e48f70 Reviewed-on: https://go-review.googlesource.com/45210 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Russ Cox --- src/runtime/traceback.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/traceback.go b/src/runtime/traceback.go index 682e490debe..c74d4387576 100644 --- a/src/runtime/traceback.go +++ b/src/runtime/traceback.go @@ -433,7 +433,7 @@ func gentraceback(pc0, sp0, lr0 uintptr, gp *g, skip int, pcbuf *uintptr, max in print(" +", hex(frame.pc-f.entry)) } if g.m.throwing > 0 && gp == g.m.curg || level >= 2 { - print(" fp=", hex(frame.fp), " sp=", hex(frame.sp)) + print(" fp=", hex(frame.fp), " sp=", hex(frame.sp), " pc=", hex(frame.pc)) } print("\n") nprint++