]> Cypherpunks repositories - gostls13.git/commit
cmd/compile,cmd/link: set DW_AT_decl_line for function declarations
authorMichael Pratt <mpratt@google.com>
Wed, 14 Dec 2022 18:36:19 +0000 (13:36 -0500)
committerGopher Robot <gobot@golang.org>
Mon, 30 Jan 2023 15:19:41 +0000 (15:19 +0000)
commit9e45b1d53e4f4c19863bb36276e019b96b8764c0
treeb4434fedbae944479764f2efbb8229347c65c038
parentee5ce77c62483933ae4d5dbdbcbadf6f82dd3f6c
cmd/compile,cmd/link: set DW_AT_decl_line for function declarations

DW_AT_decl_line provides the line number of function declarations (the
line containing the func keyword). This is the equivalent to CL 429638,
but provided via DWARF.

Note that the file of declarations (DW_AT_decl_file) is already provided
for non-inlined functions. It is omitted for inlined functions because
those DWARF subprograms may be generated outside of their source
compilation unit, where referencing the file table is difficult.

Fixes #57308.

Change-Id: I3ad12e1f366c4465c2a588297988a5825ef7efec
Reviewed-on: https://go-review.googlesource.com/c/go/+/458195
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/compile/internal/dwarfgen/dwarf.go
src/cmd/internal/dwarf/dwarf.go
src/cmd/internal/obj/dwarf.go
src/cmd/internal/obj/link.go
src/cmd/link/internal/ld/dwarf_test.go