#include "lldb/Target/Memory.h"
#include "lldb/Target/Process.h"
#include "lldb/Utility/DataBufferHeap.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/RangeMap.h"
#include "lldb/Utility/State.h"
#include <cinttypes>
#include <memory>
usingnamespacelldb;
usingnamespacelldb_private;
MemoryCache::MemoryCache(Process &process)
: … { … }
MemoryCache::~MemoryCache() = default;
void MemoryCache::Clear(bool clear_invalid_ranges) { … }
void MemoryCache::AddL1CacheData(lldb::addr_t addr, const void *src,
size_t src_len) { … }
void MemoryCache::AddL1CacheData(lldb::addr_t addr,
const DataBufferSP &data_buffer_sp) { … }
void MemoryCache::Flush(addr_t addr, size_t size) { … }
void MemoryCache::AddInvalidRange(lldb::addr_t base_addr,
lldb::addr_t byte_size) { … }
bool MemoryCache::RemoveInvalidRange(lldb::addr_t base_addr,
lldb::addr_t byte_size) { … }
lldb::DataBufferSP MemoryCache::GetL2CacheLine(lldb::addr_t line_base_addr,
Status &error) { … }
size_t MemoryCache::Read(addr_t addr, void *dst, size_t dst_len,
Status &error) { … }
AllocatedBlock::AllocatedBlock(lldb::addr_t addr, uint32_t byte_size,
uint32_t permissions, uint32_t chunk_size)
: … { … }
AllocatedBlock::~AllocatedBlock() = default;
lldb::addr_t AllocatedBlock::ReserveBlock(uint32_t size) { … }
bool AllocatedBlock::FreeBlock(addr_t addr) { … }
AllocatedMemoryCache::AllocatedMemoryCache(Process &process)
: … { … }
AllocatedMemoryCache::~AllocatedMemoryCache() = default;
void AllocatedMemoryCache::Clear(bool deallocate_memory) { … }
AllocatedMemoryCache::AllocatedBlockSP
AllocatedMemoryCache::AllocatePage(uint32_t byte_size, uint32_t permissions,
uint32_t chunk_size, Status &error) { … }
lldb::addr_t AllocatedMemoryCache::AllocateMemory(size_t byte_size,
uint32_t permissions,
Status &error) { … }
bool AllocatedMemoryCache::DeallocateMemory(lldb::addr_t addr) { … }