]> Cypherpunks repositories - gostls13.git/commit
runtime: traceback: include pc=0x%x for inline frames
authorAlan Donovan <adonovan@google.com>
Mon, 5 Feb 2024 21:38:41 +0000 (16:38 -0500)
committerAlan Donovan <adonovan@google.com>
Thu, 8 Feb 2024 21:44:52 +0000 (21:44 +0000)
commit643d816c8b4348850a8a2a622d73256beea104cd
tree31c78b014701c6ea5f275873ce9d20106d7f3508
parent08370dcd9af8122956fc3ab024889c5357fffd5a
runtime: traceback: include pc=0x%x for inline frames

Crash monitoring tools may parse the PC values and feed them
to CallersFrames, which does not run the inline unwinder, since
Callers already did so. So, the GOTRACEBACK=system output
must also include PC values even for inlined frames.
(The actual values are just marker NOP instructions,
but that isn't important.)

This CL also includes a test that the PC values can be
parsed out of the crash report and fed to CallersFrames
to yield a sensible result. (The logic is a distillation
of the x/telemetry crashmonitor.)

The previously printed PCs were in fact slightly wrong
for frames containing inlined calls: instead of the
virtual CALL instruction (a NOP) to the first
inlined call, it would display the PC of the
CALL in the innermost inlined function.

Change-Id: I64a06771fc191ba16c1383b8139b714f4f299703
Reviewed-on: https://go-review.googlesource.com/c/go/+/561635
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/runtime/crash_test.go
src/runtime/traceback.go
src/runtime/traceback_system_test.go [new file with mode: 0644]