LLDB mainline
Public Member Functions | Protected Types | Protected Attributes | Private Member Functions | List of all members
lldb_private::MemoryCache Class Reference

#include <Memory.h>

Public Member Functions

 MemoryCache (Process &process)
 
 ~MemoryCache ()
 
void Clear (bool clear_invalid_ranges=false)
 
void Flush (lldb::addr_t addr, size_t size)
 
size_t Read (lldb::addr_t addr, void *dst, size_t dst_len, Status &error)
 
uint32_t GetMemoryCacheLineSize () const
 
void AddInvalidRange (lldb::addr_t base_addr, lldb::addr_t byte_size)
 
bool RemoveInvalidRange (lldb::addr_t base_addr, lldb::addr_t byte_size)
 
void AddL1CacheData (lldb::addr_t addr, const void *src, size_t src_len)
 
void AddL1CacheData (lldb::addr_t addr, const lldb::DataBufferSP &data_buffer_sp)
 

Protected Types

typedef std::map< lldb::addr_t, lldb::DataBufferSPBlockMap
 
typedef RangeVector< lldb::addr_t, lldb::addr_t, 4 > InvalidRanges
 
typedef Range< lldb::addr_t, lldb::addr_tAddrRange
 

Protected Attributes

std::recursive_mutex m_mutex
 
BlockMap m_L1_cache
 
BlockMap m_L2_cache
 
InvalidRanges m_invalid_ranges
 
Processm_process
 
uint32_t m_L2_cache_line_byte_size
 

Private Member Functions

 MemoryCache (const MemoryCache &)=delete
 
const MemoryCacheoperator= (const MemoryCache &)=delete
 
lldb::DataBufferSP GetL2CacheLine (lldb::addr_t addr, Status &error)
 

Detailed Description

Definition at line 21 of file Memory.h.

Member Typedef Documentation

◆ AddrRange

Definition at line 49 of file Memory.h.

◆ BlockMap

Definition at line 47 of file Memory.h.

◆ InvalidRanges

Definition at line 48 of file Memory.h.

Constructor & Destructor Documentation

◆ MemoryCache() [1/2]

MemoryCache::MemoryCache ( Process process)

Definition at line 24 of file Memory.cpp.

◆ ~MemoryCache()

MemoryCache::~MemoryCache ( )
default

◆ MemoryCache() [2/2]

lldb_private::MemoryCache::MemoryCache ( const MemoryCache )
privatedelete

Member Function Documentation

◆ AddInvalidRange()

void MemoryCache::AddInvalidRange ( lldb::addr_t  base_addr,
lldb::addr_t  byte_size 
)

◆ AddL1CacheData() [1/2]

void MemoryCache::AddL1CacheData ( lldb::addr_t  addr,
const lldb::DataBufferSP data_buffer_sp 
)

Definition at line 47 of file Memory.cpp.

References m_L1_cache, and m_mutex.

◆ AddL1CacheData() [2/2]

void MemoryCache::AddL1CacheData ( lldb::addr_t  addr,
const void *  src,
size_t  src_len 
)

◆ Clear()

void MemoryCache::Clear ( bool  clear_invalid_ranges = false)

◆ Flush()

void MemoryCache::Flush ( lldb::addr_t  addr,
size_t  size 
)

◆ GetL2CacheLine()

lldb::DataBufferSP MemoryCache::GetL2CacheLine ( lldb::addr_t  addr,
Status error 
)
private

◆ GetMemoryCacheLineSize()

uint32_t lldb_private::MemoryCache::GetMemoryCacheLineSize ( ) const
inline

Definition at line 34 of file Memory.h.

References m_L2_cache_line_byte_size.

Referenced by lldb_private::Process::ReadCStringFromMemory().

◆ operator=()

const MemoryCache & lldb_private::MemoryCache::operator= ( const MemoryCache )
privatedelete

◆ Read()

size_t MemoryCache::Read ( lldb::addr_t  addr,
void *  dst,
size_t  dst_len,
Status error 
)

◆ RemoveInvalidRange()

bool MemoryCache::RemoveInvalidRange ( lldb::addr_t  base_addr,
lldb::addr_t  byte_size 
)

Member Data Documentation

◆ m_invalid_ranges

InvalidRanges lldb_private::MemoryCache::m_invalid_ranges
protected

Definition at line 57 of file Memory.h.

Referenced by AddInvalidRange(), Clear(), Read(), and RemoveInvalidRange().

◆ m_L1_cache

BlockMap lldb_private::MemoryCache::m_L1_cache
protected

Definition at line 52 of file Memory.h.

Referenced by AddL1CacheData(), Clear(), Flush(), and Read().

◆ m_L2_cache

BlockMap lldb_private::MemoryCache::m_L2_cache
protected

Definition at line 55 of file Memory.h.

Referenced by Clear(), Flush(), and GetL2CacheLine().

◆ m_L2_cache_line_byte_size

uint32_t lldb_private::MemoryCache::m_L2_cache_line_byte_size
protected

Definition at line 59 of file Memory.h.

Referenced by Clear(), Flush(), GetL2CacheLine(), GetMemoryCacheLineSize(), and Read().

◆ m_mutex

std::recursive_mutex lldb_private::MemoryCache::m_mutex
protected

◆ m_process

Process& lldb_private::MemoryCache::m_process
protected

Definition at line 58 of file Memory.h.

Referenced by Clear(), GetL2CacheLine(), and Read().


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