diff --git a/lib/Interpreter/DynamicLibraryManagerSymbol.cpp b/lib/Interpreter/DynamicLibraryManagerSymbol.cpp index 3e7fbd6d..0df74008 100644 --- a/lib/Interpreter/DynamicLibraryManagerSymbol.cpp +++ b/lib/Interpreter/DynamicLibraryManagerSymbol.cpp @@ -1141,9 +1141,13 @@ namespace cling { auto ObjF = llvm::object::ObjectFile::createObjectFile(FileName); if (!ObjF) { + std::string Message; + handleAllErrors(ObjF.takeError(), [&](llvm::ErrorInfoBase &EIB) { + Message += EIB.message() + "; "; + }); if (DEBUG > 1) cling::errs() << "[DyLD] Failed to read object file " - << FileName << "\n"; + << FileName << ". Message: '" << Message << "\n"; return true; } diff --git a/lib/Interpreter/IncrementalJIT.cpp b/lib/Interpreter/IncrementalJIT.cpp index 09ad059a..fd9930c4 100644 --- a/lib/Interpreter/IncrementalJIT.cpp +++ b/lib/Interpreter/IncrementalJIT.cpp @@ -425,8 +425,10 @@ public: const SymbolLookupSet& LookupSet) override { SymbolMap Symbols; for (auto& KV : LookupSet) { - if (auto Addr = lookup(*KV.first)) - Symbols[KV.first] = Addr.get(); + auto Addr = lookup(*KV.first); + if (auto Err = Addr.takeError()) + return Err; + Symbols[KV.first] = Addr.get(); } if (Symbols.empty()) return Error::success();