]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: do not emit an extra debug_line entry for the end of seq addr
authorAlessandro Arzilli <alessandro.arzilli@gmail.com>
Tue, 10 Nov 2020 16:02:27 +0000 (17:02 +0100)
committerThan McIntosh <thanm@google.com>
Thu, 12 Nov 2020 13:47:13 +0000 (13:47 +0000)
Uses DW_LNS_advance_pc directly, instead of calling putpclcdelta
because the latter will create a new debug_line entry for the end of
sequence address.

Fixes #42484

Change-Id: Ib6355605cac101b9bf37a3b4961ab0cee678a839
Reviewed-on: https://go-review.googlesource.com/c/go/+/268937
Trust: Than McIntosh <thanm@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/internal/obj/dwarf.go

index 328fb03b245818b790d57b17b9dbc015f70e59fa..87c62e298165cb9ff640237013d1e929bdffb545 100644 (file)
@@ -104,7 +104,8 @@ func (ctxt *Link) generateDebugLinesSymbol(s, lines *LSym) {
        // GDB will assign a line number of zero the last row in the line
        // table, which we don't want.
        lastlen := uint64(s.Size - (lastpc - s.Func().Text.Pc))
-       putpclcdelta(ctxt, dctxt, lines, lastlen, 0)
+       dctxt.AddUint8(lines, dwarf.DW_LNS_advance_pc)
+       dwarf.Uleb128put(dctxt, lines, int64(lastlen))
        dctxt.AddUint8(lines, 0) // start extended opcode
        dwarf.Uleb128put(dctxt, lines, 1)
        dctxt.AddUint8(lines, dwarf.DW_LNE_end_sequence)