diff options
author | Stephen Hines <srhines@google.com> | 2015-04-01 18:49:24 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-04-01 18:49:26 +0000 |
commit | 3fa16bd6062e23bcdb82ed4dd965674792e6b761 (patch) | |
tree | 9348fc507292f7e8715d22d64ce5a32131b4f875 /lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp | |
parent | beed47390a60f6f0c77532b3d3f76bb47ef49423 (diff) | |
parent | ebe69fe11e48d322045d5949c83283927a0d790b (diff) | |
download | external_llvm-3fa16bd6062e23bcdb82ed4dd965674792e6b761.zip external_llvm-3fa16bd6062e23bcdb82ed4dd965674792e6b761.tar.gz external_llvm-3fa16bd6062e23bcdb82ed4dd965674792e6b761.tar.bz2 |
Merge "Update aosp/master LLVM for rebase to r230699."
Diffstat (limited to 'lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp')
-rw-r--r-- | lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp index 8818349..976a434 100644 --- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp +++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp @@ -8,13 +8,13 @@ //===----------------------------------------------------------------------===// #include "llvm/ADT/STLExtras.h" +#include "RuntimeDyldCheckerImpl.h" +#include "RuntimeDyldImpl.h" #include "llvm/ExecutionEngine/RuntimeDyldChecker.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/MCDisassembler.h" #include "llvm/MC/MCInst.h" #include "llvm/Support/Path.h" -#include "RuntimeDyldCheckerImpl.h" -#include "RuntimeDyldImpl.h" #include <cctype> #include <memory> @@ -260,9 +260,7 @@ private: << "'. Instruction has only " << format("%i", Inst.getNumOperands()) << " operands.\nInstruction is:\n "; - Inst.dump_pretty(ErrMsgStream, - Checker.Disassembler->getContext().getAsmInfo(), - Checker.InstPrinter); + Inst.dump_pretty(ErrMsgStream, Checker.InstPrinter); return std::make_pair(EvalResult(ErrMsgStream.str()), ""); } @@ -272,9 +270,7 @@ private: raw_string_ostream ErrMsgStream(ErrMsg); ErrMsgStream << "Operand '" << format("%i", OpIdx) << "' of instruction '" << Symbol << "' is not an immediate.\nInstruction is:\n "; - Inst.dump_pretty(ErrMsgStream, - Checker.Disassembler->getContext().getAsmInfo(), - Checker.InstPrinter); + Inst.dump_pretty(ErrMsgStream, Checker.InstPrinter); return std::make_pair(EvalResult(ErrMsgStream.str()), ""); } @@ -740,7 +736,9 @@ uint64_t RuntimeDyldCheckerImpl::getSymbolLinkerAddr(StringRef Symbol) const { } uint64_t RuntimeDyldCheckerImpl::getSymbolRemoteAddr(StringRef Symbol) const { - return getRTDyld().getAnySymbolRemoteAddress(Symbol); + if (uint64_t InternalSymbolAddr = getRTDyld().getSymbolLoadAddress(Symbol)) + return InternalSymbolAddr; + return getRTDyld().MemMgr->getSymbolAddress(Symbol); } uint64_t RuntimeDyldCheckerImpl::readMemoryAtAddr(uint64_t SrcAddr, @@ -848,14 +846,16 @@ std::pair<uint64_t, std::string> RuntimeDyldCheckerImpl::getStubAddrFor( StringRef RuntimeDyldCheckerImpl::getSubsectionStartingAt(StringRef Name) const { - RuntimeDyldImpl::SymbolTableMap::const_iterator pos = + RTDyldSymbolTable::const_iterator pos = getRTDyld().GlobalSymbolTable.find(Name); if (pos == getRTDyld().GlobalSymbolTable.end()) return StringRef(); - RuntimeDyldImpl::SymbolLoc Loc = pos->second; - uint8_t *SectionAddr = getRTDyld().getSectionAddress(Loc.first); - return StringRef(reinterpret_cast<const char *>(SectionAddr) + Loc.second, - getRTDyld().Sections[Loc.first].Size - Loc.second); + const auto &SymInfo = pos->second; + uint8_t *SectionAddr = getRTDyld().getSectionAddress(SymInfo.getSectionID()); + return StringRef(reinterpret_cast<const char *>(SectionAddr) + + SymInfo.getOffset(), + getRTDyld().Sections[SymInfo.getSectionID()].Size - + SymInfo.getOffset()); } void RuntimeDyldCheckerImpl::registerSection( @@ -885,9 +885,10 @@ void RuntimeDyldCheckerImpl::registerStubMap( // If this is a (Section, Offset) pair, do a reverse lookup in the // global symbol table to find the name. for (auto &GSTEntry : getRTDyld().GlobalSymbolTable) { - if (GSTEntry.second.first == StubMapEntry.first.SectionID && - GSTEntry.second.second == - static_cast<uint64_t>(StubMapEntry.first.Offset)) { + const auto &SymInfo = GSTEntry.second; + if (SymInfo.getSectionID() == StubMapEntry.first.SectionID && + SymInfo.getOffset() == + static_cast<uint64_t>(StubMapEntry.first.Offset)) { SymbolName = GSTEntry.first(); break; } |