summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp')
-rw-r--r--lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
index deec50dafb4..37e1120838f 100644
--- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
+++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
@@ -167,9 +167,15 @@ size_t ObjectFilePECOFF::GetModuleSpecifications(
if (!data_sp || !ObjectFilePECOFF::MagicBytesMatch(data_sp))
return initial_count;
+ Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_OBJECT));
+
auto binary = llvm::object::createBinary(file.GetPath());
- if (!binary)
+
+ if (!binary) {
+ LLDB_LOG_ERROR(log, binary.takeError(),
+ "Failed to create binary for file ({1}): {0}", file);
return initial_count;
+ }
if (!binary->getBinary()->isCOFF() &&
!binary->getBinary()->isCOFFImportFile())
@@ -242,11 +248,8 @@ bool ObjectFilePECOFF::CreateBinary() {
auto binary = llvm::object::createBinary(m_file.GetPath());
if (!binary) {
- LLDB_LOGF(log,
- "ObjectFilePECOFF::CreateBinary() - failed to create binary "
- "for file (%s): %s",
- m_file ? m_file.GetPath().c_str() : "<NULL>",
- errorToErrorCode(binary.takeError()).message().c_str());
+ LLDB_LOG_ERROR(log, binary.takeError(),
+ "Failed to create binary for file ({1}): {0}", m_file);
return false;
}
OpenPOWER on IntegriCloud