Skip to content

Commit 9ef65ff

Browse files
aarzillithanm
authored andcommitted
cmd/compile: do not emit an extra debug_line entry for the end of seq addr
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 <[email protected]> Run-TryBot: Than McIntosh <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Than McIntosh <[email protected]> Reviewed-by: Cherry Zhang <[email protected]>
1 parent 4bc5f6f commit 9ef65ff

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/cmd/internal/obj/dwarf.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ func (ctxt *Link) generateDebugLinesSymbol(s, lines *LSym) {
104104
// GDB will assign a line number of zero the last row in the line
105105
// table, which we don't want.
106106
lastlen := uint64(s.Size - (lastpc - s.Func().Text.Pc))
107-
putpclcdelta(ctxt, dctxt, lines, lastlen, 0)
107+
dctxt.AddUint8(lines, dwarf.DW_LNS_advance_pc)
108+
dwarf.Uleb128put(dctxt, lines, int64(lastlen))
108109
dctxt.AddUint8(lines, 0) // start extended opcode
109110
dwarf.Uleb128put(dctxt, lines, 1)
110111
dctxt.AddUint8(lines, dwarf.DW_LNE_end_sequence)

0 commit comments

Comments
 (0)