LLDB  mainline
Classes | Public Member Functions | List of all members
lldb_private::IRExecutionUnit Class Reference

"lldb/Expression/IRExecutionUnit.h" Contains the IR and, optionally, JIT- compiled code for a module. More...

#include <IRExecutionUnit.h>

Inheritance diagram for lldb_private::IRExecutionUnit:
Inheritance graph
Collaboration diagram for lldb_private::IRExecutionUnit:
Collaboration graph


struct  JittedEntity
class  JittedFunction
 "lldb/Expression/IRExecutionUnit.h" Encapsulates a single function that has been generated by the JIT. More...
struct  JittedGlobalVariable
struct  SearchSpec

Public Member Functions

 IRExecutionUnit (std::unique_ptr< llvm::LLVMContext > &context_up, std::unique_ptr< llvm::Module > &module_up, ConstString &name, const lldb::TargetSP &target_sp, const SymbolContext &sym_ctx, std::vector< std::string > &cpu_features)
 Constructor. More...
 ~IRExecutionUnit () override
 Destructor. More...
ConstString GetFunctionName ()
llvm::ModuleGetModule ()
llvm::FunctionGetFunction ()
void GetRunnableInfo (Status &error, lldb::addr_t &func_addr, lldb::addr_t &func_end)
lldb::addr_t WriteNow (const uint8_t *bytes, size_t size, Status &error)
 Accessors for IRForTarget and other clients that may want binary data placed on their behalf. More...
void FreeNow (lldb::addr_t allocation)
lldb::ByteOrder GetByteOrder () const override
 ObjectFileJITDelegate overrides. More...
uint32_t GetAddressByteSize () const override
void PopulateSymtab (lldb_private::ObjectFile *obj_file, lldb_private::Symtab &symtab) override
void PopulateSectionList (lldb_private::ObjectFile *obj_file, lldb_private::SectionList &section_list) override
ArchSpec GetArchitecture () override
lldb::ModuleSP GetJITModule ()
lldb::addr_t FindSymbol (ConstString name)
void GetStaticInitializers (std::vector< lldb::addr_t > &static_initializers)
const std::vector< JittedFunction > & GetJittedFunctions ()
const std::vector< JittedGlobalVariable > & GetJittedGlobalVariables ()
- Public Member Functions inherited from lldb_private::IRMemoryMap
 IRMemoryMap (lldb::TargetSP target_sp)
 ~IRMemoryMap ()
lldb::addr_t Malloc (size_t size, uint8_t alignment, uint32_t permissions, AllocationPolicy policy, bool zero_memory, Status &error)
void Leak (lldb::addr_t process_address, Status &error)
void Free (lldb::addr_t process_address, Status &error)
void WriteMemory (lldb::addr_t process_address, const uint8_t *bytes, size_t size, Status &error)
void WriteScalarToMemory (lldb::addr_t process_address, Scalar &scalar, size_t size, Status &error)
void WritePointerToMemory (lldb::addr_t process_address, lldb::addr_t address, Status &error)
void ReadMemory (uint8_t *bytes, lldb::addr_t process_address, size_t size, Status &error)
void ReadScalarFromMemory (Scalar &scalar, lldb::addr_t process_address, size_t size, Status &error)
void ReadPointerFromMemory (lldb::addr_t *address, lldb::addr_t process_address, Status &error)
bool GetAllocSize (lldb::addr_t address, size_t &size)
void GetMemoryData (DataExtractor &extractor, lldb::addr_t process_address, size_t size, Status &error)
lldb::ByteOrder GetByteOrder ()
uint32_t GetAddressByteSize ()
ExecutionContextScopeGetBestExecutionContextScope () const
lldb::TargetSP GetTarget ()
- Public Member Functions inherited from lldb_private::ObjectFileJITDelegate
 ObjectFileJITDelegate ()
virtual ~ObjectFileJITDelegate ()

Additional Inherited Members

- Public Types inherited from lldb_private::IRMemoryMap
enum  AllocationPolicy : uint8_t { eAllocationPolicyInvalid, eAllocationPolicyHostOnly, eAllocationPolicyMirror, eAllocationPolicyProcessOnly }
- Protected Member Functions inherited from lldb_private::IRMemoryMap
lldb::ProcessWP & GetProcessWP ()

Detailed Description

"lldb/Expression/IRExecutionUnit.h" Contains the IR and, optionally, JIT- compiled code for a module.

This class encapsulates the compiled version of an expression, in IR form (for interpretation purposes) and in raw machine code form (for execution in the target).

This object wraps an IR module that comes from the expression parser, and knows how to use the JIT to make it into executable code. It can then be used as input to the IR interpreter, or the address of the executable code can be passed to a thread plan to run in the target.

This class creates a subclass of LLVM's SectionMemoryManager, because that is how the JIT emits code. Because LLDB needs to move JIT-compiled code into the target process, the IRExecutionUnit knows how to copy the emitted code into the target process.

Definition at line 56 of file IRExecutionUnit.h.

Constructor & Destructor Documentation

◆ IRExecutionUnit()

IRExecutionUnit::IRExecutionUnit ( std::unique_ptr< llvm::LLVMContext > &  context_up,
std::unique_ptr< llvm::Module > &  module_up,
ConstString name,
const lldb::TargetSP &  target_sp,
const SymbolContext sym_ctx,
std::vector< std::string > &  cpu_features 


Definition at line 39 of file IRExecutionUnit.cpp.

◆ ~IRExecutionUnit()

IRExecutionUnit::~IRExecutionUnit ( )

Member Function Documentation

◆ FindSymbol()

lldb::addr_t IRExecutionUnit::FindSymbol ( lldb_private::ConstString  name)

◆ FreeNow()

void IRExecutionUnit::FreeNow ( lldb::addr_t  allocation)

◆ GetAddressByteSize()

uint32_t IRExecutionUnit::GetAddressByteSize ( ) const

◆ GetArchitecture()

ArchSpec IRExecutionUnit::GetArchitecture ( )

◆ GetByteOrder()

lldb::ByteOrder IRExecutionUnit::GetByteOrder ( ) const

◆ GetFunction()

llvm::Function* lldb_private::IRExecutionUnit::GetFunction ( )

Definition at line 73 of file IRExecutionUnit.h.

◆ GetFunctionName()

ConstString lldb_private::IRExecutionUnit::GetFunctionName ( )

Definition at line 69 of file IRExecutionUnit.h.

◆ GetJITModule()

lldb::ModuleSP IRExecutionUnit::GetJITModule ( )

◆ GetJittedFunctions()

const std::vector<JittedFunction>& lldb_private::IRExecutionUnit::GetJittedFunctions ( )

Definition at line 156 of file IRExecutionUnit.h.

◆ GetJittedGlobalVariables()

const std::vector<JittedGlobalVariable>& lldb_private::IRExecutionUnit::GetJittedGlobalVariables ( )

Definition at line 160 of file IRExecutionUnit.h.

References lldb_private::Bytes, and LLDB_INVALID_ADDRESS.

◆ GetModule()

llvm::Module* lldb_private::IRExecutionUnit::GetModule ( )

Definition at line 71 of file IRExecutionUnit.h.

◆ GetRunnableInfo()

void IRExecutionUnit::GetRunnableInfo ( Status error,
lldb::addr_t func_addr,
lldb::addr_t func_end 

◆ GetStaticInitializers()

void IRExecutionUnit::GetStaticInitializers ( std::vector< lldb::addr_t > &  static_initializers)

◆ PopulateSectionList()

void IRExecutionUnit::PopulateSectionList ( lldb_private::ObjectFile obj_file,
lldb_private::SectionList section_list 

◆ PopulateSymtab()

void IRExecutionUnit::PopulateSymtab ( lldb_private::ObjectFile obj_file,
lldb_private::Symtab symtab 

Implements lldb_private::ObjectFileJITDelegate.

Definition at line 1195 of file IRExecutionUnit.cpp.

◆ WriteNow()

lldb::addr_t IRExecutionUnit::WriteNow ( const uint8_t *  bytes,
size_t  size,
Status error 

The documentation for this class was generated from the following files: