LLVM  13.0.0git
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
llvm::orc::TargetProcessControl Class Referenceabstract

TargetProcessControl supports interaction with a JIT target process. More...

#include "llvm/ExecutionEngine/Orc/TargetProcessControl.h"

Inheritance diagram for llvm::orc::TargetProcessControl:
Inheritance graph
[legend]
Collaboration diagram for llvm::orc::TargetProcessControl:
Collaboration graph
[legend]

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< SymbolStringPoolgetSymbolStringPool () const
 Return a shared pointer to the SymbolStringPool for this instance. More...
 
const TriplegetTargetTriple () const
 Return the Triple for the target process. More...
 
unsigned getPageSize () const
 Get the page size for the target process. More...
 
MemoryAccessgetMemoryAccess () const
 Return a MemoryAccess object for the target process. More...
 
jitlink::JITLinkMemoryManagergetMemMgr () const
 Return a JITLinkMemoryManager for the target process. More...
 
virtual Expected< tpctypes::DylibHandleloadDylib (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::WrapperFunctionResultrunWrapper (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< SymbolStringPoolSSP
 
Triple TargetTriple
 
unsigned PageSize = 0
 
MemoryAccessMemAccess = nullptr
 
jitlink::JITLinkMemoryManagerMemMgr = nullptr
 

Detailed Description

TargetProcessControl supports interaction with a JIT target process.

Definition at line 32 of file TargetProcessControl.h.

Constructor & Destructor Documentation

◆ ~TargetProcessControl()

llvm::orc::TargetProcessControl::~TargetProcessControl ( )
virtual

Definition at line 23 of file TargetProcessControl.cpp.

◆ TargetProcessControl()

llvm::orc::TargetProcessControl::TargetProcessControl ( std::shared_ptr< SymbolStringPool SSP)
inlineprotected

Definition at line 155 of file TargetProcessControl.h.

Member Function Documentation

◆ disconnect()

virtual Error llvm::orc::TargetProcessControl::disconnect ( )
pure virtual

Disconnect from the target process.

This should be called after the JIT session is shut down.

Implemented in llvm::orc::SelfTargetProcessControl.

◆ getMemMgr()

jitlink::JITLinkMemoryManager& llvm::orc::TargetProcessControl::getMemMgr ( ) const
inline

Return a JITLinkMemoryManager for the target process.

Definition at line 119 of file TargetProcessControl.h.

References MemMgr.

◆ getMemoryAccess()

MemoryAccess& llvm::orc::TargetProcessControl::getMemoryAccess ( ) const
inline

Return a MemoryAccess object for the target process.

Definition at line 116 of file TargetProcessControl.h.

References MemAccess.

◆ getPageSize()

unsigned llvm::orc::TargetProcessControl::getPageSize ( ) const
inline

Get the page size for the target process.

Definition at line 113 of file TargetProcessControl.h.

References PageSize.

◆ getSymbolStringPool()

std::shared_ptr<SymbolStringPool> llvm::orc::TargetProcessControl::getSymbolStringPool ( ) const
inline

Return a shared pointer to the SymbolStringPool for this instance.

Definition at line 107 of file TargetProcessControl.h.

References SSP.

◆ getTargetTriple()

const Triple& llvm::orc::TargetProcessControl::getTargetTriple ( ) const
inline

◆ intern()

SymbolStringPtr llvm::orc::TargetProcessControl::intern ( StringRef  SymName)
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().

◆ loadDylib()

virtual Expected<tpctypes::DylibHandle> llvm::orc::TargetProcessControl::loadDylib ( const char *  DylibPath)
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().

◆ lookupSymbols()

virtual Expected<std::vector<tpctypes::LookupResult> > llvm::orc::TargetProcessControl::lookupSymbols ( ArrayRef< LookupRequest Request)
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().

◆ runAsMain()

virtual Expected<int32_t> llvm::orc::TargetProcessControl::runAsMain ( JITTargetAddress  MainFnAddr,
ArrayRef< std::string >  Args 
)
pure virtual

Run function with a main-like signature.

Implemented in llvm::orc::OrcRPCTargetProcessControlBase< RPCEndpointT >, and llvm::orc::SelfTargetProcessControl.

◆ runWrapper()

virtual Expected<tpctypes::WrapperFunctionResult> llvm::orc::TargetProcessControl::runWrapper ( JITTargetAddress  WrapperFnAddr,
ArrayRef< uint8_t >  ArgBuffer 
)
pure virtual

Member Data Documentation

◆ MemAccess

MemoryAccess* llvm::orc::TargetProcessControl::MemAccess = nullptr
protected

◆ MemMgr

jitlink::JITLinkMemoryManager* llvm::orc::TargetProcessControl::MemMgr = nullptr
protected

◆ PageSize

unsigned llvm::orc::TargetProcessControl::PageSize = 0
protected

◆ SSP

std::shared_ptr<SymbolStringPool> llvm::orc::TargetProcessControl::SSP
protected

◆ TargetTriple

Triple llvm::orc::TargetProcessControl::TargetTriple
protected

The documentation for this class was generated from the following files:
llvm::Check::Size
@ Size
Definition: FileCheck.h:73