LLDB  mainline
Classes | Public Types | Public Member Functions | Protected Member Functions | List of all members
lldb_private::IRMemoryMap Class Reference

Encapsulates memory that may exist in the process but must also be available in the host process. More...

#include "lldb/Expression/IRMemoryMap.h"

Inheritance diagram for lldb_private::IRMemoryMap:
Inheritance graph
[legend]

Public Types

enum  AllocationPolicy : uint8_t { eAllocationPolicyInvalid, eAllocationPolicyHostOnly, eAllocationPolicyMirror, eAllocationPolicyProcessOnly }
 

Public Member Functions

 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 ()
 

Protected Member Functions

lldb::ProcessWP & GetProcessWP ()
 

Detailed Description

Encapsulates memory that may exist in the process but must also be available in the host process.

This class encapsulates a group of memory objects that must be readable or writable from the host process regardless of whether the process exists. This allows the IR interpreter as well as JITted code to access the same memory. All allocations made by this class are represented as disjoint intervals.

Point queries against this group of memory objects can be made by the address in the tar at which they reside. If the inferior does not exist, allocations still get made-up addresses. If an inferior appears at some point, then those addresses need to be re-mapped.

Definition at line 34 of file IRMemoryMap.h.

Member Enumeration Documentation

◆ AllocationPolicy

Enumerator
eAllocationPolicyInvalid 

It is an error for an allocation to have this policy.

eAllocationPolicyHostOnly 

This allocation was created in the host and will never make it into the process.

It is an error to create other types of allocations while such allocations exist.

eAllocationPolicyMirror 

The intent is that this allocation exist both in the host and the process and have the same content in both.

eAllocationPolicyProcessOnly 

The intent is that this allocation exist only in the process.

Definition at line 39 of file IRMemoryMap.h.

Constructor & Destructor Documentation

◆ IRMemoryMap()

IRMemoryMap::IRMemoryMap ( lldb::TargetSP  target_sp)

Definition at line 22 of file IRMemoryMap.cpp.

◆ ~IRMemoryMap()

IRMemoryMap::~IRMemoryMap ( )

Member Function Documentation

◆ Free()

void IRMemoryMap::Free ( lldb::addr_t  process_address,
Status error 
)

◆ GetAddressByteSize()

uint32_t IRMemoryMap::GetAddressByteSize ( )

◆ GetAllocSize()

bool IRMemoryMap::GetAllocSize ( lldb::addr_t  address,
size_t &  size 
)

Definition at line 489 of file IRMemoryMap.cpp.

Referenced by IRInterpreter::Interpret().

◆ GetBestExecutionContextScope()

ExecutionContextScope * IRMemoryMap::GetBestExecutionContextScope ( ) const

◆ GetByteOrder()

lldb::ByteOrder IRMemoryMap::GetByteOrder ( )

◆ GetMemoryData()

void IRMemoryMap::GetMemoryData ( DataExtractor extractor,
lldb::addr_t  process_address,
size_t  size,
Status error 
)

◆ GetProcessWP()

lldb::ProcessWP& lldb_private::IRMemoryMap::GetProcessWP ( )
inlineprotected

Definition at line 86 of file IRMemoryMap.h.

Referenced by lldb_private::IRExecutionUnit::GetRunnableInfo().

◆ GetTarget()

lldb::TargetSP lldb_private::IRMemoryMap::GetTarget ( )
inline

Definition at line 80 of file IRMemoryMap.h.

Referenced by IRForTarget::~IRForTarget().

◆ Leak()

void IRMemoryMap::Leak ( lldb::addr_t  process_address,
Status error 
)

◆ Malloc()

lldb::addr_t IRMemoryMap::Malloc ( size_t  size,
uint8_t  alignment,
uint32_t  permissions,
AllocationPolicy  policy,
bool  zero_memory,
Status error 
)

◆ ReadMemory()

void IRMemoryMap::ReadMemory ( uint8_t *  bytes,
lldb::addr_t  process_address,
size_t  size,
Status error 
)

◆ ReadPointerFromMemory()

void IRMemoryMap::ReadPointerFromMemory ( lldb::addr_t address,
lldb::addr_t  process_address,
Status error 
)

◆ ReadScalarFromMemory()

void IRMemoryMap::ReadScalarFromMemory ( Scalar scalar,
lldb::addr_t  process_address,
size_t  size,
Status error 
)

◆ WriteMemory()

void IRMemoryMap::WriteMemory ( lldb::addr_t  process_address,
const uint8_t *  bytes,
size_t  size,
Status error 
)

◆ WritePointerToMemory()

void IRMemoryMap::WritePointerToMemory ( lldb::addr_t  process_address,
lldb::addr_t  address,
Status error 
)

◆ WriteScalarToMemory()

void IRMemoryMap::WriteScalarToMemory ( lldb::addr_t  process_address,
Scalar scalar,
size_t  size,
Status error 
)

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