]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix DWARF type symbol buglet
authorThan McIntosh <thanm@google.com>
Fri, 1 Dec 2017 14:39:59 +0000 (09:39 -0500)
committerThan McIntosh <thanm@google.com>
Fri, 1 Dec 2017 18:52:50 +0000 (18:52 +0000)
commit9372166faa1bf04f0d83706da2b33ed2659ee976
treee02cfa9d9b8ae8f046ca2e80c6e299b3aa0a03d9
parent0c0c3c186b1c1a7d3bc9d8a4aaec24767b5bfa81
cmd/compile: fix DWARF type symbol buglet

The code that generates the list of DWARF variables for a function
(params and autos) will emit a "no-location" entry in the DWARF for a
user var that appears in the original pre-optimization version of the
function but is no longer around when optimization is complete. The
intent is that if a GDB user types "print foo" (where foo has been
optimized out), the response will be "<optimized out>" as opposed to
"there is no such variable 'foo'). This change fixes said code to
include vars on the autom list for the function, to insure that the
type symbol for the variable makes it to the linker.

Fixes #22941.

Change-Id: Id29f1f39d68fbb798602dfd6728603040624fc41
Reviewed-on: https://go-review.googlesource.com/81415
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/compile/internal/gc/pgen.go
test/fixedbugs/issue22941.dir/a.go [new file with mode: 0644]
test/fixedbugs/issue22941.dir/b.go [new file with mode: 0644]
test/fixedbugs/issue22941.dir/main.go [new file with mode: 0644]
test/fixedbugs/issue22941.go [new file with mode: 0644]