LLVM
13.0.0git
|
TargetProcessControl supports interaction with a JIT target process. More...
#include "llvm/ExecutionEngine/Orc/TargetProcessControl.h"
Classes | |
struct | LookupRequest |
A pair of a dylib and a set of symbols to be looked up. More... | |
class | MemoryAccess |
APIs for manipulating memory in the target process. More... | |
Public Member Functions | |
virtual | ~TargetProcessControl () |
SymbolStringPtr | intern (StringRef SymName) |
Intern a symbol name in the SymbolStringPool. More... | |
std::shared_ptr< SymbolStringPool > | getSymbolStringPool () const |
Return a shared pointer to the SymbolStringPool for this instance. More... | |
const Triple & | getTargetTriple () const |
Return the Triple for the target process. More... | |
unsigned | getPageSize () const |
Get the page size for the target process. More... | |
MemoryAccess & | getMemoryAccess () const |
Return a MemoryAccess object for the target process. More... | |
jitlink::JITLinkMemoryManager & | getMemMgr () const |
Return a JITLinkMemoryManager for the target process. More... | |
virtual Expected< tpctypes::DylibHandle > | loadDylib (const char *DylibPath)=0 |
Load the dynamic library at the given path and return a handle to it. More... | |
virtual Expected< std::vector< tpctypes::LookupResult > > | lookupSymbols (ArrayRef< LookupRequest > Request)=0 |
Search for symbols in the target process. More... | |
virtual Expected< int32_t > | runAsMain (JITTargetAddress MainFnAddr, ArrayRef< std::string > Args)=0 |
Run function with a main-like signature. More... | |
virtual Expected< tpctypes::WrapperFunctionResult > | runWrapper (JITTargetAddress WrapperFnAddr, ArrayRef< uint8_t > ArgBuffer)=0 |
Run a wrapper function with signature: More... | |
virtual Error | disconnect ()=0 |
Disconnect from the target process. More... | |
Protected Member Functions | |
TargetProcessControl (std::shared_ptr< SymbolStringPool > SSP) | |
Protected Attributes | |
std::shared_ptr< SymbolStringPool > | SSP |
Triple | TargetTriple |
unsigned | PageSize = 0 |
MemoryAccess * | MemAccess = nullptr |
jitlink::JITLinkMemoryManager * | MemMgr = nullptr |
TargetProcessControl supports interaction with a JIT target process.
Definition at line 32 of file TargetProcessControl.h.
|
virtual |
Definition at line 23 of file TargetProcessControl.cpp.
|
inlineprotected |
Definition at line 155 of file TargetProcessControl.h.
|
pure virtual |
Disconnect from the target process.
This should be called after the JIT session is shut down.
Implemented in llvm::orc::SelfTargetProcessControl.
|
inline |
Return a JITLinkMemoryManager for the target process.
Definition at line 119 of file TargetProcessControl.h.
References MemMgr.
|
inline |
Return a MemoryAccess object for the target process.
Definition at line 116 of file TargetProcessControl.h.
References MemAccess.
|
inline |
Get the page size for the target process.
Definition at line 113 of file TargetProcessControl.h.
References PageSize.
|
inline |
Return a shared pointer to the SymbolStringPool for this instance.
Definition at line 107 of file TargetProcessControl.h.
References SSP.
Return the Triple for the target process.
Definition at line 110 of file TargetProcessControl.h.
References TargetTriple.
Referenced by llvm::orc::TPCEHFrameRegistrar::Create(), llvm::orc::TPCIndirectionUtils::Create(), and llvm::orc::createJITLoaderGDBRegistrar().
|
inline |
Intern a symbol name in the SymbolStringPool.
Definition at line 104 of file TargetProcessControl.h.
References SSP.
Referenced by llvm::orc::TPCEHFrameRegistrar::Create(), and llvm::orc::createJITLoaderGDBRegistrar().
|
pure virtual |
Load the dynamic library at the given path and return a handle to it.
If LibraryPath is null this function will return the global handle for the target process.
Implemented in llvm::orc::OrcRPCTargetProcessControlBase< RPCEndpointT >, and llvm::orc::SelfTargetProcessControl.
Referenced by llvm::orc::TPCEHFrameRegistrar::Create(), llvm::orc::createJITLoaderGDBRegistrar(), and llvm::orc::TPCDynamicLibrarySearchGenerator::Load().
|
pure virtual |
Search for symbols in the target process.
The result of the lookup is a 2-dimentional array of target addresses that correspond to the lookup order. If a required symbol is not found then this method will return an error. If a weakly referenced symbol is not found then it be assigned a '0' value in the result. that correspond to the lookup order.
Implemented in llvm::orc::OrcRPCTargetProcessControlBase< RPCEndpointT >, and llvm::orc::SelfTargetProcessControl.
Referenced by llvm::orc::TPCEHFrameRegistrar::Create(), llvm::orc::createJITLoaderGDBRegistrar(), and llvm::orc::TPCDynamicLibrarySearchGenerator::tryToGenerate().
|
pure virtual |
Run function with a main-like signature.
Implemented in llvm::orc::OrcRPCTargetProcessControlBase< RPCEndpointT >, and llvm::orc::SelfTargetProcessControl.
|
pure virtual |
Run a wrapper function with signature:
{.cpp}
Implemented in llvm::orc::OrcRPCTargetProcessControlBase< RPCEndpointT >, and llvm::orc::SelfTargetProcessControl.
Referenced by llvm::orc::TPCEHFrameRegistrar::deregisterEHFrames(), llvm::orc::TPCDebugObjectRegistrar::registerDebugObject(), and llvm::orc::TPCEHFrameRegistrar::registerEHFrames().
|
protected |
Definition at line 161 of file TargetProcessControl.h.
Referenced by getMemoryAccess(), and llvm::orc::SelfTargetProcessControl::SelfTargetProcessControl().
|
protected |
Definition at line 162 of file TargetProcessControl.h.
Referenced by llvm::orc::SelfTargetProcessControl::Create(), getMemMgr(), and llvm::orc::SelfTargetProcessControl::SelfTargetProcessControl().
|
protected |
Definition at line 160 of file TargetProcessControl.h.
Referenced by llvm::orc::SelfTargetProcessControl::Create(), getPageSize(), and llvm::orc::SelfTargetProcessControl::SelfTargetProcessControl().
|
protected |
Definition at line 158 of file TargetProcessControl.h.
Referenced by llvm::orc::SelfTargetProcessControl::Create(), getSymbolStringPool(), and intern().
|
protected |
Definition at line 159 of file TargetProcessControl.h.
Referenced by getTargetTriple(), and llvm::orc::SelfTargetProcessControl::SelfTargetProcessControl().