[DebugInfo] Improve error message text

Unlike most of our errors in the debug line parser, the "no end of
sequence" message was missing any reference to which line table it
refererred to. This change adds the offset to this message.

Reviewed by: dblaikie

Differential Revision: https://reviews.llvm.org/D72443
This commit is contained in:
James Henderson 2020-01-09 12:20:18 +00:00
parent b19c0810e5
commit 6e3ca962fa
4 changed files with 770 additions and 766 deletions
lld/test/ELF
llvm
lib/DebugInfo/DWARF
test/tools/llvm-dwarfdump/X86
unittests/DebugInfo/DWARF

@ -52,7 +52,7 @@
# is requested, even if that particular part of the line information is not currently required.
# Also show that the warnings are only printed once.
# CHECK: warning: parsing line table prologue at 0x00000000 should have ended at 0x00000038 but it ended at 0x00000037
# CHECK-NEXT: warning: last sequence in debug line table is not terminated!
# CHECK-NEXT: warning: last sequence in debug line table at offset 0x0000005b is not terminated
# CHECK: error: undefined symbol: zed6a
# CHECK-NEXT: >>> referenced by {{.*}}tmp4.o:(.text+0x0)
# CHECK: error: undefined symbol: zed6b

@ -883,9 +883,11 @@ Error DWARFDebugLine::LineTable::parse(
}
if (!State.Sequence.Empty)
RecoverableErrorCallback(
createStringError(errc::illegal_byte_sequence,
"last sequence in debug line table is not terminated!"));
RecoverableErrorCallback(createStringError(
errc::illegal_byte_sequence,
"last sequence in debug line table at offset 0x%8.8" PRIx64
" is not terminated",
DebugLineOffset));
// Sort all sequences so that address lookup will work faster.
if (!Sequences.empty()) {

@ -158,7 +158,7 @@
# ALL-NEXT: warning: parsing line table prologue at 0x00000081 should have ended at 0x000000b9 but it ended at 0x000000ba
# ALL-NEXT: warning: parsing line table prologue at 0x000000c9 should have ended at 0x00000104 but it ended at 0x00000103
# OTHER-NEXT: warning: unexpected line op length at offset 0x00000158 expected 0x02 found 0x01
# OTHER-NEXT: warning: last sequence in debug line table is not terminated!
# OTHER-NEXT: warning: last sequence in debug line table at offset 0x00000167 is not terminated
# ALL-NEXT: warning: parsing line table prologue at 0x000001ad should have ended at 0x000001c8 but it ended at 0x000001df
# ALL-NEXT: warning: parsing line table prologue at 0x000001ed should have ended at 0x00000218 but it ended at 0x0000021f
# ALL-NEXT: warning: parsing line table prologue at 0x0000022d should have ended at 0x0000024f but it ended at 0x0000025f

File diff suppressed because it is too large Load Diff