Skip to content

Commit

Permalink
debug/dwarf: better error message when reading absent debug_line_str
Browse files Browse the repository at this point in the history
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 golang#49590

Change-Id: I1c431392123a86c78c95ef1f185ebd6f17f2476a
Reviewed-on: https://go-review.googlesource.com/c/go/+/363894
Run-TryBot: Alessandro Arzilli <alessandro.arzilli@gmail.com>
Trust: David Chase <drchase@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
  • Loading branch information
aarzilli authored and ianlancetaylor committed Nov 15, 2021
1 parent d156101 commit 9e13a88
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/debug/dwarf/entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,7 @@ func (b *buf) entry(cu *Entry, atab abbrevTable, ubase Offset, vers int) *Entry
} else {
if len(b.dwarf.lineStr) == 0 {
b.error("DW_FORM_line_strp with no .debug_line_str section")
return nil
}
b1 = makeBuf(b.dwarf, b.format, "line_str", 0, b.dwarf.lineStr)
}
Expand Down

0 comments on commit 9e13a88

Please sign in to comment.