]> Cypherpunks repositories - gostls13.git/commit
runtime: hide <autogenerated> methods from call stack
authorAustin Clements <austin@google.com>
Mon, 12 Jun 2017 15:12:12 +0000 (11:12 -0400)
committerAustin Clements <austin@google.com>
Fri, 22 Sep 2017 22:17:20 +0000 (22:17 +0000)
commite97209515ad8c4042f5a3ef32068200366892fc2
tree846d1f620bf7a5a4fa13a0fa64f0fda80c688938
parent354fa9a84f7b88fe6b9ebf578e6671c2b511a402
runtime: hide <autogenerated> methods from call stack

The compiler generates wrapper methods to forward interface method
calls (which are always pointer-based) to value methods. These
wrappers appear in the call stack even though they are an
implementation detail. This leaves ugly "<autogenerated>" functions in
stack traces and can throw off skip counts for stack traces.

Fix this by considering these runtime frames in printed stack traces
so they will only be printed if runtime frames are being printed, and
by eliding them from the call stack expansion used by CallersFrames
and Caller.

This removes the test for issue 4388 since that was checking that
"<autogenerated>" appeared in the stack trace instead of something
even weirder. We replace it with various runtime package tests.

Fixes #16723.

Change-Id: Ice3f118c66f254bb71478a664d62ab3fc7125819
Reviewed-on: https://go-review.googlesource.com/45412
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/runtime/stack_test.go
src/runtime/symtab.go
src/runtime/traceback.go
test/fixedbugs/issue4388.go [deleted file]