Skip to content

Commit 9e13a88

Browse files
aarzilliianlancetaylor
authored andcommitted
debug/dwarf: better error message when reading absent debug_line_str
When a DW_FORM_line_strp is used without a debug_line_str section a good error message (about the missing section) is generated but immediately overwritten by the underflow error generated by trying to read the non-existent section. Updates #49590 Change-Id: I1c431392123a86c78c95ef1f185ebd6f17f2476a Reviewed-on: https://go-review.googlesource.com/c/go/+/363894 Run-TryBot: Alessandro Arzilli <[email protected]> Trust: David Chase <[email protected]> Reviewed-by: Than McIntosh <[email protected]>
1 parent d156101 commit 9e13a88

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/debug/dwarf/entry.go

+1
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,7 @@ func (b *buf) entry(cu *Entry, atab abbrevTable, ubase Offset, vers int) *Entry
641641
} else {
642642
if len(b.dwarf.lineStr) == 0 {
643643
b.error("DW_FORM_line_strp with no .debug_line_str section")
644+
return nil
644645
}
645646
b1 = makeBuf(b.dwarf, b.format, "line_str", 0, b.dwarf.lineStr)
646647
}

0 commit comments

Comments
 (0)