9#ifndef LLDB_EXPRESSION_IRMEMORYMAP_H
10#define LLDB_EXPRESSION_IRMEMORYMAP_H
15#include "llvm/Support/Error.h"
57 llvm::Expected<lldb::addr_t>
Malloc(
size_t size, uint8_t alignment,
59 AllocationPolicy policy,
bool zero_memory,
60 AllocationPolicy *used_policy =
nullptr);
113 size_t size, uint32_t permissions, uint8_t alignment,
122 "IRMemoryMap::Allocation is larger than expected");
static llvm::raw_ostream & error(Stream &strm)
A subclass of DataBuffer that stores a data buffer on the heap.
"lldb/Target/ExecutionContextScope.h" Inherit from this if your object can reconstruct its execution ...
bool ContainsHostOnlyAllocations()
lldb::TargetWP m_target_wp
void Free(lldb::addr_t process_address, Status &error)
lldb::ByteOrder GetByteOrder()
llvm::Expected< lldb::addr_t > Malloc(size_t size, uint8_t alignment, uint32_t permissions, AllocationPolicy policy, bool zero_memory, AllocationPolicy *used_policy=nullptr)
void ReadPointerFromMemory(lldb::addr_t *address, lldb::addr_t process_address, Status &error)
lldb::ProcessWP m_process_wp
AllocationMap m_allocations
lldb::TargetSP GetTarget()
bool IntersectsAllocation(lldb::addr_t addr, size_t size) const
ExecutionContextScope * GetBestExecutionContextScope() const
std::map< lldb::addr_t, Allocation > AllocationMap
static bool AllocationsIntersect(lldb::addr_t addr1, size_t size1, lldb::addr_t addr2, size_t size2)
void GetMemoryData(DataExtractor &extractor, lldb::addr_t process_address, size_t size, Status &error)
lldb::ProcessWP & GetProcessWP()
AllocationMap::iterator FindAllocation(lldb::addr_t addr, size_t size)
uint32_t GetAddressByteSize()
void WritePointerToMemory(lldb::addr_t process_address, lldb::addr_t pointer, Status &error)
IRMemoryMap(lldb::TargetSP target_sp)
void ReadScalarFromMemory(Scalar &scalar, lldb::addr_t process_address, size_t size, Status &error)
lldb::addr_t FindSpace(size_t size)
void WriteScalarToMemory(lldb::addr_t process_address, Scalar &scalar, size_t size, Status &error)
bool GetAllocSize(lldb::addr_t address, size_t &size)
void Leak(lldb::addr_t process_address, Status &error)
void WriteMemory(lldb::addr_t process_address, const uint8_t *bytes, size_t size, Status &error)
void ReadMemory(uint8_t *bytes, lldb::addr_t process_address, size_t size, Status &error)
@ eAllocationPolicyProcessOnly
The intent is that this allocation exist only in the process.
@ eAllocationPolicyHostOnly
This allocation was created in the host and will never make it into the process.
@ eAllocationPolicyMirror
The intent is that this allocation exist both in the host and the process and have the same content i...
@ eAllocationPolicyInvalid
It is an error for an allocation to have this policy.
A class that represents a running process on the host machine.
ByteOrder
Byte ordering definitions.
std::weak_ptr< lldb_private::Process > ProcessWP
std::weak_ptr< lldb_private::Target > TargetWP
std::shared_ptr< lldb_private::Target > TargetSP
size_t m_size
The size of the requested allocation.
lldb::addr_t m_process_alloc
The (unaligned) base for the remote allocation.
Allocation(const Allocation &)=delete
AllocationPolicy m_policy
Flags. Keep these grouped together to avoid structure padding.
uint8_t m_permissions
The access permissions on the memory in the process.
Allocation(lldb::addr_t process_alloc, lldb::addr_t process_start, size_t size, uint32_t permissions, uint8_t alignment, AllocationPolicy m_policy)
lldb::addr_t m_process_start
The base address of the allocation in the process.
const Allocation & operator=(const Allocation &)=delete
uint8_t m_alignment
The alignment of the requested allocation.