aboutsummaryrefslogtreecommitdiff
path: root/src/debug/dwarf
diff options
context:
space:
mode:
authorAlessandro Arzilli <alessandro.arzilli@gmail.com>2021-11-15 09:42:28 +0100
committerIan Lance Taylor <iant@golang.org>2021-11-15 23:55:09 +0000
commit9e13a8876fb531861cbb8e865e57431de9818c16 (patch)
tree194c7e5b0cbdb9c53609182d58b17e062347ea4d /src/debug/dwarf
parentd15610128e63e299e39af02ea0e6be1afd38b1ff (diff)
downloadgo-9e13a8876fb531861cbb8e865e57431de9818c16.tar.xz
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 <alessandro.arzilli@gmail.com> Trust: David Chase <drchase@google.com> Reviewed-by: Than McIntosh <thanm@google.com>
Diffstat (limited to 'src/debug/dwarf')
-rw-r--r--src/debug/dwarf/entry.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/debug/dwarf/entry.go b/src/debug/dwarf/entry.go
index 9f5ac57080..25a3b5beec 100644
--- a/src/debug/dwarf/entry.go
+++ b/src/debug/dwarf/entry.go
@@ -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)
}