LLDB mainline
|
#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::DataBufferSP > | BlockMap |
typedef RangeVector< lldb::addr_t, lldb::addr_t, 4 > | InvalidRanges |
typedef Range< lldb::addr_t, lldb::addr_t > | AddrRange |
Protected Attributes | |
std::recursive_mutex | m_mutex |
BlockMap | m_L1_cache |
BlockMap | m_L2_cache |
InvalidRanges | m_invalid_ranges |
Process & | m_process |
uint32_t | m_L2_cache_line_byte_size |
Private Member Functions | |
MemoryCache (const MemoryCache &)=delete | |
const MemoryCache & | operator= (const MemoryCache &)=delete |
lldb::DataBufferSP | GetL2CacheLine (lldb::addr_t addr, Status &error) |
|
protected |
|
protected |
|
protected |
MemoryCache::MemoryCache | ( | Process & | process | ) |
Definition at line 24 of file Memory.cpp.
|
default |
|
privatedelete |
void MemoryCache::AddInvalidRange | ( | lldb::addr_t | base_addr, |
lldb::addr_t | byte_size | ||
) |
Definition at line 101 of file Memory.cpp.
References lldb_private::RangeVector< B, S, N >::Append(), m_invalid_ranges, m_mutex, and lldb_private::RangeVector< B, S, N >::Sort().
Referenced by lldb_private::Process::AddInvalidMemoryRegion().
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.
void MemoryCache::AddL1CacheData | ( | lldb::addr_t | addr, |
const void * | src, | ||
size_t | src_len | ||
) |
Definition at line 41 of file Memory.cpp.
References AddL1CacheData().
Referenced by AddL1CacheData(), Read(), and lldb_private::process_gdb_remote::ProcessGDBRemote::SetThreadStopInfo().
void MemoryCache::Clear | ( | bool | clear_invalid_ranges = false | ) |
Definition at line 32 of file Memory.cpp.
References lldb_private::RangeVector< B, S, N >::Clear(), lldb_private::ProcessProperties::GetMemoryCacheLineSize(), m_invalid_ranges, m_L1_cache, m_L2_cache, m_L2_cache_line_byte_size, m_mutex, and m_process.
Referenced by lldb_private::Process::DidExec(), lldb_private::Process::Finalize(), and lldb_private::Process::SetPrivateState().
void MemoryCache::Flush | ( | lldb::addr_t | addr, |
size_t | size | ||
) |
Definition at line 53 of file Memory.cpp.
References lldb_private::Range< B, S >::DoesIntersect(), m_L1_cache, m_L2_cache, m_L2_cache_line_byte_size, m_mutex, and UINT64_MAX.
Referenced by lldb_private::Process::WriteMemory().
|
private |
Definition at line 126 of file Memory.cpp.
References error(), m_L2_cache, m_L2_cache_line_byte_size, m_mutex, m_process, and lldb_private::Process::ReadMemoryFromInferior().
Referenced by Read().
|
inline |
Definition at line 34 of file Memory.h.
References m_L2_cache_line_byte_size.
Referenced by lldb_private::Process::ReadCStringFromMemory().
|
privatedelete |
size_t MemoryCache::Read | ( | lldb::addr_t | addr, |
void * | dst, | ||
size_t | dst_len, | ||
Status & | error | ||
) |
Definition at line 154 of file Memory.cpp.
References AddL1CacheData(), lldb_private::Range< B, S >::Contains(), error(), lldb_private::RangeVector< B, S, N >::FindEntryThatContains(), GetL2CacheLine(), lldb_private::Range< B, S >::GetRangeBase(), m_invalid_ranges, m_L1_cache, m_L2_cache_line_byte_size, m_mutex, m_process, and lldb_private::Process::ReadMemoryFromInferior().
Referenced by lldb_private::Process::ReadMemory().
bool MemoryCache::RemoveInvalidRange | ( | lldb::addr_t | base_addr, |
lldb::addr_t | byte_size | ||
) |
Definition at line 111 of file Memory.cpp.
References lldb_private::RangeVector< B, S, N >::FindEntryIndexThatContains(), lldb_private::Range< B, S >::GetByteSize(), lldb_private::RangeVector< B, S, N >::GetEntryAtIndex(), lldb_private::Range< B, S >::GetRangeBase(), m_invalid_ranges, m_mutex, lldb_private::RangeVector< B, S, N >::RemoveEntryAtIndex(), and UINT32_MAX.
Referenced by lldb_private::Process::RemoveInvalidMemoryRange().
|
protected |
Definition at line 57 of file Memory.h.
Referenced by AddInvalidRange(), Clear(), Read(), and RemoveInvalidRange().
|
protected |
|
protected |
Definition at line 55 of file Memory.h.
Referenced by Clear(), Flush(), and GetL2CacheLine().
|
protected |
Definition at line 59 of file Memory.h.
Referenced by Clear(), Flush(), GetL2CacheLine(), GetMemoryCacheLineSize(), and Read().
|
protected |
Definition at line 51 of file Memory.h.
Referenced by AddInvalidRange(), AddL1CacheData(), Clear(), Flush(), GetL2CacheLine(), Read(), and RemoveInvalidRange().
|
protected |
Definition at line 58 of file Memory.h.
Referenced by Clear(), GetL2CacheLine(), and Read().