aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/DataExtractor.cpp
diff options
context:
space:
mode:
authorJames Henderson <james.henderson@sony.com>2020-05-22 13:53:47 +0100
committerJames Henderson <james.henderson@sony.com>2020-06-01 14:00:01 +0100
commit8d9070e040d0aa916b3b63c319eabdf3e4a5f9df (patch)
tree2907230f34335d04a8037e273a7deb6dd3992b7e /llvm/lib/Support/DataExtractor.cpp
parent54422d21700cfb532c80b22662f7b79d741b21ba (diff)
downloadllvm-8d9070e040d0aa916b3b63c319eabdf3e4a5f9df.zip
llvm-8d9070e040d0aa916b3b63c319eabdf3e4a5f9df.tar.gz
llvm-8d9070e040d0aa916b3b63c319eabdf3e4a5f9df.tar.bz2
[Support] Add more context to DataExtractor getLEB128 errors
Reviewed by: clayborg, dblaikie, labath Differential Revision: https://reviews.llvm.org/D80799
Diffstat (limited to 'llvm/lib/Support/DataExtractor.cpp')
-rw-r--r--llvm/lib/Support/DataExtractor.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Support/DataExtractor.cpp b/llvm/lib/Support/DataExtractor.cpp
index aaf20eb..99265c4 100644
--- a/llvm/lib/Support/DataExtractor.cpp
+++ b/llvm/lib/Support/DataExtractor.cpp
@@ -206,7 +206,10 @@ static T getLEB128(StringRef Data, uint64_t *OffsetPtr, Error *Err,
Decoder(Bytes.data() + *OffsetPtr, &bytes_read, Bytes.end(), &error);
if (error) {
if (Err)
- *Err = createStringError(errc::illegal_byte_sequence, error);
+ *Err = createStringError(errc::illegal_byte_sequence,
+ "unable to decode LEB128 at offset 0x%8.8" PRIx64
+ ": %s",
+ *OffsetPtr, error);
return T();
}
*OffsetPtr += bytes_read;