diff options
author | Pavel Labath <labath@google.com> | 2018-01-30 12:19:34 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2018-01-30 12:19:34 +0000 |
commit | c561a6a920dbf0a53203fafcc6e0c470c840c41a (patch) | |
tree | b7670b0a1bfe766da1204c874853e2708c4428b5 /lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | |
parent | eb07016156237790a9949338b6c0ecf33884605f (diff) | |
download | bcm5719-llvm-c561a6a920dbf0a53203fafcc6e0c470c840c41a.tar.gz bcm5719-llvm-c561a6a920dbf0a53203fafcc6e0c470c840c41a.zip |
Add LLDB_LOG_ERROR macro
Summary:
The difference between this and regular LLDB_LOG is that this one clears
the error object unconditionally. This was inspired by the
ObjectFileELF bug (r322664), where the error object was being cleared
only if logging was enabled.
Reviewers: davide, zturner, jingham, clayborg
Subscribers: lldb-commits, emaste
Differential Revision: https://reviews.llvm.org/D42182
llvm-svn: 323753
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp')
-rw-r--r-- | lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index 433a2297aa9..614c76b2e2f 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -3491,9 +3491,9 @@ size_t ObjectFileELF::ReadSectionData(Section *section, size_t(section_data.GetByteSize())}, GetByteOrder() == eByteOrderLittle, GetAddressByteSize() == 8); if (!Decompressor) { - LLDB_LOG(log, "Unable to initialize decompressor for section {0}: {1}", - section->GetName(), llvm::toString(Decompressor.takeError())); - consumeError(Decompressor.takeError()); + LLDB_LOG_ERROR(log, Decompressor.takeError(), + "Unable to initialize decompressor for section {0}", + section->GetName()); return result; } auto buffer_sp = @@ -3501,9 +3501,8 @@ size_t ObjectFileELF::ReadSectionData(Section *section, if (auto Error = Decompressor->decompress( {reinterpret_cast<char *>(buffer_sp->GetBytes()), size_t(buffer_sp->GetByteSize())})) { - LLDB_LOG(log, "Decompression of section {0} failed: {1}", - section->GetName(), llvm::toString(std::move(Error))); - consumeError(std::move(Error)); + LLDB_LOG_ERROR(log, std::move(Error), "Decompression of section {0} failed", + section->GetName()); return result; } section_data.SetData(buffer_sp); |