• Jeremy Faller's avatar
    cmd/compile: generate debug_lines in compiler · ee3dded3
    Jeremy Faller authored
    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: default avatarAustin Clements <austin@google.com>
    ee3dded3
dwarf.go 8.29 KB