LLDB  mainline
Public Member Functions | Private Attributes | List of all members
lldb_private::IRExecutionUnit::MemoryManager Class Reference
Inheritance diagram for lldb_private::IRExecutionUnit::MemoryManager:
Inheritance graph
[legend]
Collaboration diagram for lldb_private::IRExecutionUnit::MemoryManager:
Collaboration graph
[legend]

Public Member Functions

 MemoryManager (IRExecutionUnit &parent)
 
 ~MemoryManager () override
 
uint8_t * allocateCodeSection (uintptr_t Size, unsigned Alignment, unsigned SectionID, llvm::StringRef SectionName) override
 Allocate space for executable code, and add it to the m_spaceBlocks map. More...
 
uint8_t * allocateDataSection (uintptr_t Size, unsigned Alignment, unsigned SectionID, llvm::StringRef SectionName, bool IsReadOnly) override
 Allocate space for data, and add it to the m_spaceBlocks map. More...
 
bool finalizeMemory (std::string *ErrMsg) override
 Called when object loading is complete and section page permissions can be applied. More...
 
void registerEHFrames (uint8_t *Addr, uint64_t LoadAddr, size_t Size) override
 
void deregisterEHFrames () override
 
uint64_t getSymbolAddress (const std::string &Name) override
 
uint64_t GetSymbolAddressAndPresence (const std::string &Name, bool &missing_weak)
 
llvm::JITSymbol findSymbol (const std::string &Name) override
 
void * getPointerToNamedFunction (const std::string &Name, bool AbortOnFailure=true) override
 

Private Attributes

std::unique_ptr< SectionMemoryManager > m_default_mm_up
 The memory allocator to use in actually creating space. More...
 
IRExecutionUnitm_parent
 The execution unit this is a proxy for. More...
 

Detailed Description

Definition at line 236 of file IRExecutionUnit.h.

Constructor & Destructor Documentation

◆ MemoryManager()

IRExecutionUnit::MemoryManager::MemoryManager ( IRExecutionUnit parent)

Definition at line 496 of file IRExecutionUnit.cpp.

◆ ~MemoryManager()

IRExecutionUnit::MemoryManager::~MemoryManager ( )
overridedefault

Member Function Documentation

◆ allocateCodeSection()

uint8_t * IRExecutionUnit::MemoryManager::allocateCodeSection ( uintptr_t  Size,
unsigned  Alignment,
unsigned  SectionID,
llvm::StringRef  SectionName 
)
override

Allocate space for executable code, and add it to the m_spaceBlocks map.

Parameters
[in]SizeThe size of the area.
[in]AlignmentThe required alignment of the area.
[in]SectionIDA unique identifier for the section.
Returns
Allocated space.

Definition at line 594 of file IRExecutionUnit.cpp.

References lldb_private::IRExecutionUnit::Code, lldb_private::GetLogIfAllCategoriesSet(), lldb_private::IRExecutionUnit::GetSectionTypeFromSectionName(), LIBLLDB_LOG_EXPRESSIONS, and LLDB_LOGF.

◆ allocateDataSection()

uint8_t * IRExecutionUnit::MemoryManager::allocateDataSection ( uintptr_t  Size,
unsigned  Alignment,
unsigned  SectionID,
llvm::StringRef  SectionName,
bool  IsReadOnly 
)
override

Allocate space for data, and add it to the m_spaceBlocks map.

Parameters
[in]SizeThe size of the area.
[in]AlignmentThe required alignment of the area.
[in]SectionIDA unique identifier for the section.
[in]IsReadOnlyFlag indicating the section is read-only.
Returns
Allocated space.

Definition at line 624 of file IRExecutionUnit.cpp.

References lldb_private::IRExecutionUnit::Data, lldb_private::GetLogIfAllCategoriesSet(), lldb_private::IRExecutionUnit::GetSectionTypeFromSectionName(), LIBLLDB_LOG_EXPRESSIONS, and LLDB_LOGF.

◆ deregisterEHFrames()

void lldb_private::IRExecutionUnit::MemoryManager::deregisterEHFrames ( )
inlineoverride

Definition at line 300 of file IRExecutionUnit.h.

◆ finalizeMemory()

bool lldb_private::IRExecutionUnit::MemoryManager::finalizeMemory ( std::string ErrMsg)
inlineoverride

Called when object loading is complete and section page permissions can be applied.

Currently unimplemented for LLDB.

Parameters
[out]ErrMsgThe error that prevented the page protection from succeeding.
Returns
True in case of failure, false in case of success.

Definition at line 289 of file IRExecutionUnit.h.

◆ findSymbol()

llvm::JITSymbol IRExecutionUnit::MemoryManager::findSymbol ( const std::string Name)
override

Definition at line 935 of file IRExecutionUnit.cpp.

◆ getPointerToNamedFunction()

void * IRExecutionUnit::MemoryManager::getPointerToNamedFunction ( const std::string Name,
bool  AbortOnFailure = true 
)
override

Definition at line 975 of file IRExecutionUnit.cpp.

◆ getSymbolAddress()

uint64_t IRExecutionUnit::MemoryManager::getSymbolAddress ( const std::string Name)
override

Definition at line 947 of file IRExecutionUnit.cpp.

◆ GetSymbolAddressAndPresence()

uint64_t IRExecutionUnit::MemoryManager::GetSymbolAddressAndPresence ( const std::string Name,
bool &  missing_weak 
)

◆ registerEHFrames()

void lldb_private::IRExecutionUnit::MemoryManager::registerEHFrames ( uint8_t *  Addr,
uint64_t  LoadAddr,
size_t  Size 
)
inlineoverride

Definition at line 298 of file IRExecutionUnit.h.

Member Data Documentation

◆ m_default_mm_up

std::unique_ptr<SectionMemoryManager> lldb_private::IRExecutionUnit::MemoryManager::m_default_mm_up
private

The memory allocator to use in actually creating space.

All calls are passed through to it.

Definition at line 315 of file IRExecutionUnit.h.

◆ m_parent

IRExecutionUnit& lldb_private::IRExecutionUnit::MemoryManager::m_parent
private

The execution unit this is a proxy for.

Definition at line 322 of file IRExecutionUnit.h.


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