]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: generate debug_lines in compiler
authorJeremy Faller <jeremy@golang.org>
Wed, 31 Jul 2019 14:33:11 +0000 (10:33 -0400)
committerJeremy Faller <jeremy@golang.org>
Tue, 24 Sep 2019 22:14:05 +0000 (22:14 +0000)
commitee3dded36d69264998c39af0ec851371850d842b
tree3b0cc64dab2b404aec26341233bfa71d6c0121eb
parent78a37347143bd03026a6c6860a550b1638ce5314
cmd/compile: generate debug_lines in compiler

This is mostly a copy-paste jobs from the linker to generate the debug
information in the compiler instead of the linker. The new data is
inserted into the debug line numbers symbol defined in CL 188238.

Generating the debug information BEFORE deadcode results in one subtle
difference, and that is that the state machine needs to be reset at the
end of every function's debug line table. The reasoning is that
generating the table AFTER dead code allows the producer and consumer of
the table to agree on the state of the state machine, and since these
blocks will (eventually) be concatenated in the linker, we don't KNOW
the state of the state machine unless we reset it. So,
generateDebugLinesSymbol resets the state machine at the end of every
function.

Right now, we don't do anything with this line information, or the file
table -- we just populate the symbols.

Change-Id: If9103eda6cc5f1f7a11e7e1a97184a060a4ad7fb
Reviewed-on: https://go-review.googlesource.com/c/go/+/188317
Run-TryBot: Jeremy Faller <jeremy@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
src/cmd/internal/obj/dwarf.go [new file with mode: 0644]
src/cmd/internal/obj/objfile.go
src/cmd/internal/obj/plist.go
src/cmd/internal/objabi/symkind.go
src/cmd/internal/src/xpos.go
src/cmd/link/internal/objfile/objfile.go