[llvm] r213701 - [MCJIT] Improve stub_addr file-not-found diagnostic to help track down a
Lang Hames
lhames at gmail.com
Tue Jul 22 16:07:52 PDT 2014
Author: lhames
Date: Tue Jul 22 18:07:52 2014
New Revision: 213701
URL: http://llvm.org/viewvc/llvm-project?rev=213701&view=rev
Log:
[MCJIT] Improve stub_addr file-not-found diagnostic to help track down a
buildbot failure.
Modified:
llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp
Modified: llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp?rev=213701&r1=213700&r2=213701&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp Tue Jul 22 18:07:52 2014
@@ -713,8 +713,23 @@ std::pair<uint64_t, std::string> Runtime
bool IsInsideLoad) const {
auto SI1 = Stubs.find(FileName);
- if (SI1 == Stubs.end())
- return std::make_pair(0, ("File '" + FileName + "' not found.\n").str());
+ if (SI1 == Stubs.end()) {
+ std::string ErrorMsg = "File '";
+ ErrorMsg += FileName;
+ ErrorMsg += "' not found. ";
+ if (Stubs.empty())
+ ErrorMsg += "No stubs registered.";
+ else {
+ ErrorMsg += "Available files are:";
+ for (const auto& StubEntry : Stubs) {
+ ErrorMsg += " '";
+ ErrorMsg += StubEntry.first;
+ ErrorMsg += "'";
+ }
+ }
+ ErrorMsg += "\n";
+ return std::make_pair(0, ErrorMsg);
+ }
const SectionStubMap &SectionStubs = SI1->second;
auto SI2 = SectionStubs.find(SectionName);
More information about the llvm-commits
mailing list