]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: emit DW_AT_decl_line
authorHeschi Kreinick <heschi@google.com>
Fri, 26 May 2017 19:34:56 +0000 (15:34 -0400)
committerHeschi Kreinick <heschi@google.com>
Tue, 22 Aug 2017 18:05:53 +0000 (18:05 +0000)
commit4a1be1e1da52cc406ef605107e184cb5610f6071
tree51688f89756ec5a4f394cc6a7d73a52839c4d209
parent3216e0cefab43670c788a475237f6f4b235fc200
cmd/compile: emit DW_AT_decl_line

Some debuggers use the declaration line to avoid showing variables
before they're declared. Emit them for local variables and function
parameters.

DW_AT_decl_file would be nice too, but since its value is an index
into a table built by the linker, that's dramatically harder. In
practice, with inlining disabled it's safe to assume that all a
function's variables are declared in the same file, so this should still
be pretty useful.

Change-Id: I8105818c8940cd71bc5473ec98797cce2f3f9872
Reviewed-on: https://go-review.googlesource.com/44350
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/gc/pgen.go
src/cmd/internal/dwarf/dwarf.go
src/cmd/link/internal/ld/dwarf_test.go