[PATCH] D42492: [XRay] clarify error messages when parsing broken traces
Martin Pelikán via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 24 09:13:48 PST 2018
pelikan created this revision.
pelikan added reviewers: dberris, eizan, kpw.
When there's a mismatch of a function argument being right after the
wrong function, print an offset into the file where that happened, to
ease further debugging.
Repository:
rL LLVM
https://reviews.llvm.org/D42492
Files:
lib/XRay/Trace.cpp
Index: lib/XRay/Trace.cpp
===================================================================
--- lib/XRay/Trace.cpp
+++ lib/XRay/Trace.cpp
@@ -120,9 +120,10 @@
auto TId = RecordExtractor.getU32(&OffsetPtr);
if (Record.FuncId != FuncId || Record.TId != TId)
return make_error<StringError>(
- Twine("Corrupted log, found payload following non-matching "
- "function + thread record. Record for ") +
- Twine(Record.FuncId) + " != " + Twine(FuncId),
+ Twine("Corrupted log, found arg payload following non-matching "
+ "function + thread record. Record for function ") +
+ Twine(Record.FuncId) + " != " + Twine(FuncId) + "; offset: " +
+ Twine(S.data() - Data.data()),
std::make_error_code(std::errc::executable_format_error));
// Advance another four bytes to avoid padding.
OffsetPtr += 4;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42492.131288.patch
Type: text/x-patch
Size: 940 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180124/6ac52eca/attachment.bin>
More information about the llvm-commits
mailing list