]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: avoid truncating fieldname var locations
authorThan McIntosh <thanm@google.com>
Mon, 24 Oct 2016 17:05:10 +0000 (13:05 -0400)
committerMatthew Dempsky <mdempsky@google.com>
Wed, 26 Oct 2016 21:14:46 +0000 (21:14 +0000)
commitd80e8de54ec633d018ccef94b67c796dda4e1944
tree74303359c9791acae2135e4fe646704473d79a1e
parentc7e0dda45046c539d99b7e8c3bd3e79b3fab9776
cmd/compile: avoid truncating fieldname var locations

Don't include package path when creating LSyms for auto and param
variables during Prog generation, and update the DWARF emit routine
accordingly (remove the code that chops off package path from names in
DWARF var location expressions). Implementation suggested by mdempsky@.

The intent of this change is to have saner location expressions in cases
where the variable corresponds to a structure field. For example, the
SSA compiler's "decompose" phase can take a slice value and break it
apart into three scalar variables corresponding to the fields (slice "X"
gets split into "X.len", "X.cap", "X.ptr"). In such cases we want the
name in the location expression to omit the package path but preserve
the original variable name (e.g. "X").

Fixes #16338

Change-Id: Ibc444e7f3454b70fc500a33f0397e669d127daa1
Reviewed-on: https://go-review.googlesource.com/31819
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/pgen.go
src/cmd/internal/dwarf/dwarf.go
src/runtime/runtime-gdb_test.go