From cce313b082f0fd609d10ca4f4bf7f3fe1b8a70a0 Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Tue, 22 Jul 2014 23:07:52 +0000 Subject: [PATCH] [MCJIT] Improve stub_addr file-not-found diagnostic to help track down a buildbot failure. llvm-svn: 213701 --- .../RuntimeDyld/RuntimeDyldChecker.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp index 3ac4dd6b4f04..72075f5202e1 100644 --- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp +++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp @@ -713,8 +713,23 @@ std::pair RuntimeDyldCheckerImpl::getStubAddrFor( 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);