diff options
| author | Russ Cox <rsc@golang.org> | 2024-03-14 15:30:13 -0400 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2024-03-14 20:20:55 +0000 |
| commit | 386dcf4c93bfc8af232a12086d73da4bb3558af9 (patch) | |
| tree | ec3b78531f10f9f51d248ed0547265b0bb649b6f /src/runtime/traceback.go | |
| parent | 966609ad9e82ba173bcc8f57f4bfc35a86a62c8a (diff) | |
| download | go-386dcf4c93bfc8af232a12086d73da4bb3558af9.tar.xz | |
runtime: revert "traceback: include pc=0x%x for inline frames"
This reverts commit 643d816c8b43 (CL 561635).
Reason for revert: This works for telemetry but broke various other
properties of the tracebacks as well as some programs that read
tracebacks. We should figure out a solution that works for all uses,
and in the interim we should not be making telemetry work at the
cost of breaking other, existing valid uses.
See #65761 for details.
Change-Id: I467993ae778887e5bd3cca4c0fb54e9d44802ee1
Reviewed-on: https://go-review.googlesource.com/c/go/+/571797
Auto-Submit: Russ Cox <rsc@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src/runtime/traceback.go')
| -rw-r--r-- | src/runtime/traceback.go | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/src/runtime/traceback.go b/src/runtime/traceback.go index 61027ea89a..1c75c447d2 100644 --- a/src/runtime/traceback.go +++ b/src/runtime/traceback.go @@ -993,24 +993,12 @@ func traceback2(u *unwinder, showRuntime bool, skip, max int) (n, lastN int) { } print(")\n") print("\t", file, ":", line) - // The contract between Callers and CallersFrames uses - // return addresses, which are +1 relative to the CALL - // instruction. Follow that convention. - pc := uf.pc + 1 - if !iu.isInlined(uf) && pc > f.entry() { - // Func-relative PCs make no sense for inlined - // frames because there is no actual entry. - print(" +", hex(pc-f.entry())) - } - if gp.m != nil && gp.m.throwing >= throwTypeRuntime && gp == gp.m.curg || level >= 2 { - if !iu.isInlined(uf) { - // The stack information makes no sense for inline frames. - print(" fp=", hex(u.frame.fp), " sp=", hex(u.frame.sp), " pc=", hex(pc)) - } else { - // The PC for an inlined frame is a special marker NOP, - // but crash monitoring tools may still parse the PCs - // and feed them to CallersFrames. - print(" pc=", hex(pc)) + if !iu.isInlined(uf) { + if u.frame.pc > f.entry() { + print(" +", hex(u.frame.pc-f.entry())) + } + if gp.m != nil && gp.m.throwing >= throwTypeRuntime && gp == gp.m.curg || level >= 2 { + print(" fp=", hex(u.frame.fp), " sp=", hex(u.frame.sp), " pc=", hex(u.frame.pc)) } } print("\n") |
