1 //===-- RuntimeDyldCheckerImpl.h -- RuntimeDyld test framework --*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_LIB_EXECUTIONENGINE_RUNTIMEDYLD_RUNTIMEDYLDCHECKERIMPL_H
11 #define LLVM_LIB_EXECUTIONENGINE_RUNTIMEDYLD_RUNTIMEDYLDCHECKERIMPL_H
13 #include "RuntimeDyldImpl.h"
18 class RuntimeDyldCheckerImpl {
19 friend class RuntimeDyldImpl;
20 friend class RuntimeDyldCheckerExprEval;
23 RuntimeDyldCheckerImpl(RuntimeDyld &RTDyld, MCDisassembler *Disassembler,
24 MCInstPrinter *InstPrinter,
25 llvm::raw_ostream &ErrStream);
27 bool check(StringRef CheckExpr) const;
28 bool checkAllRulesInBuffer(StringRef RulePrefix, MemoryBuffer *MemBuf) const;
31 RuntimeDyldImpl &getRTDyld() const { return *RTDyld.Dyld; }
33 bool isSymbolValid(StringRef Symbol) const;
34 uint64_t getSymbolLinkerAddr(StringRef Symbol) const;
35 uint64_t getSymbolRemoteAddr(StringRef Symbol) const;
36 uint64_t readMemoryAtAddr(uint64_t Addr, unsigned Size) const;
37 std::pair<uint64_t, std::string> getStubAddrFor(StringRef FilePath,
38 StringRef SectionName,
40 bool IsInsideLoad) const;
41 StringRef getSubsectionStartingAt(StringRef Name) const;
43 void registerStubMap(StringRef FileName, unsigned SectionID,
44 const RuntimeDyldImpl::StubMap &RTDyldStubs);
47 MCDisassembler *Disassembler;
48 MCInstPrinter *InstPrinter;
49 llvm::raw_ostream &ErrStream;
52 typedef std::pair<unsigned, uint64_t> StubLoc;
53 typedef std::map<std::string, StubLoc> SymbolStubMap;
54 typedef std::map<std::string, SymbolStubMap> SectionStubMap;
55 typedef std::map<std::string, SectionStubMap> StubMap;