LLDB mainline
lldb_private::IRExecutionUnit::MemoryManager Class Reference
Inheritance diagram for lldb_private::IRExecutionUnit::MemoryManager:
[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.
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.
bool finalizeMemory (std::string *ErrMsg) override
 Called when object loading is complete and section page permissions can be applied.
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.
IRExecutionUnitm_parent
 The execution unit this is a proxy for.

Detailed Description

Definition at line 243 of file IRExecutionUnit.h.

Constructor & Destructor Documentation

◆ MemoryManager()

IRExecutionUnit::MemoryManager::MemoryManager ( IRExecutionUnit & parent)

◆ ~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 555 of file IRExecutionUnit.cpp.

References lldb_private::IRExecutionUnit::Code, lldb_private::Expressions, lldb_private::GetLog(), lldb_private::IRExecutionUnit::GetSectionTypeFromSectionName(), LLDB_LOGF, m_default_mm_up, and m_parent.

◆ 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 585 of file IRExecutionUnit.cpp.

References lldb_private::IRExecutionUnit::Data, lldb_private::Expressions, lldb_private::GetLog(), lldb_private::IRExecutionUnit::GetSectionTypeFromSectionName(), LLDB_LOGF, m_default_mm_up, and m_parent.

◆ deregisterEHFrames()

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

Definition at line 307 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 296 of file IRExecutionUnit.h.

◆ findSymbol()

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

Definition at line 996 of file IRExecutionUnit.cpp.

References GetSymbolAddressAndPresence().

◆ getPointerToNamedFunction()

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

Definition at line 1036 of file IRExecutionUnit.cpp.

References getSymbolAddress().

◆ getSymbolAddress()

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

Definition at line 1008 of file IRExecutionUnit.cpp.

References GetSymbolAddressAndPresence().

Referenced by getPointerToNamedFunction().

◆ 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 305 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 322 of file IRExecutionUnit.h.

Referenced by allocateCodeSection(), allocateDataSection(), and MemoryManager().

◆ m_parent

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

The execution unit this is a proxy for.

Definition at line 329 of file IRExecutionUnit.h.

Referenced by allocateCodeSection(), allocateDataSection(), GetSymbolAddressAndPresence(), and MemoryManager().


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