[PATCH] D72443: [DebugInfo] Improve error message text
James Henderson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 9 04:23:42 PST 2020
jhenderson created this revision.
jhenderson added reviewers: dblaikie, JDevlieghere, ikudrin, MaskRay, probinson.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.
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.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D72443
Files:
llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp
Index: llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp
===================================================================
--- llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp
+++ llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp
@@ -632,7 +632,8 @@
auto ExpectedLineTable = Line.getOrParseLineTable(LineData, 0, *Context,
nullptr, RecordRecoverable);
- checkError("last sequence in debug line table is not terminated!",
+ checkError("last sequence in debug line table at offset 0x00000000 is not "
+ "terminated",
std::move(Recoverable));
ASSERT_TRUE(ExpectedLineTable.operator bool());
EXPECT_EQ((*ExpectedLineTable)->Rows.size(), 6u);
@@ -791,7 +792,8 @@
Parser.parseNext(RecordRecoverable, RecordUnrecoverable);
EXPECT_TRUE(Parser.done());
- checkError("last sequence in debug line table is not terminated!",
+ checkError("last sequence in debug line table at offset 0x00000031 is not "
+ "terminated",
std::move(Recoverable));
EXPECT_FALSE(Unrecoverable);
}
Index: llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
===================================================================
--- llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
+++ llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
@@ -907,9 +907,11 @@
}
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()) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72443.237014.patch
Type: text/x-patch
Size: 1861 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200109/b18d7ca7/attachment.bin>
More information about the llvm-commits
mailing list