]> Cypherpunks repositories - gostls13.git/commit
cmd/link, runtime: include full symbol name for generic functions in runtime table
authorCherry Mui <cherryyz@google.com>
Tue, 2 May 2023 20:46:20 +0000 (16:46 -0400)
committerCherry Mui <cherryyz@google.com>
Fri, 5 May 2023 19:53:20 +0000 (19:53 +0000)
commit1a612783c5c15e4d69d94877154601b7caddae9d
tree8f94ee88fa370b5018a23dbc0433d35d5ce65695
parent75136fc14c0d3ec64a2f6728e96fc86066d853c9
cmd/link, runtime: include full symbol name for generic functions in runtime table

For generic functions and methods, we replace the instantiated
shape type parameter name to "...", to make the function name
printed in stack traces looks more user friendly. Currently, this
is done in the binary's runtime func table at link time, and the
runtime has no way to access the full symbol name. This causes
the profile to also contain the replaced name. For PGO, this also
cause the compiler to not be able to find out the original fully
instantiated function name from the profile.

With this CL, we change the linker to record the full name, and
do the name substitution at run time when a printing a function's
name in traceback.

For #58712.

Change-Id: Ia0ea0989a1ec231f3c4fbf59365c9333405396c6
Reviewed-on: https://go-review.googlesource.com/c/go/+/491677
Reviewed-by: Michael Pratt <mpratt@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/link/internal/ld/pcln.go
src/runtime/error.go
src/runtime/symtab.go
src/runtime/traceback.go
src/runtime/traceback_test.go