|
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) |
| llvm::SmallVector< llvm::MutableArrayRef< uint8_t > > | ReadRanges (llvm::ArrayRef< Range< lldb::addr_t, size_t > > ranges, llvm::MutableArrayRef< uint8_t > buffer) |
| Reads multiple memory ranges, serving cache hits from L1 and batching all misses through Process::DoReadMemoryRanges. | |
| 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, llvm::ArrayRef< uint8_t > src) |
| 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) |
| const uint8_t * | FindL1CacheEntry (lldb::addr_t addr, size_t len) const |
|
protected |
|
protected |
|
protected |
| MemoryCache::MemoryCache | ( | Process & | process | ) |
Definition at line 26 of file Memory.cpp.
References GetMemoryCacheLineSize(), m_invalid_ranges, m_L1_cache, m_L2_cache, m_L2_cache_line_byte_size, m_mutex, and m_process.
Referenced by MemoryCache(), and operator=().
|
default |
References error().
|
privatedelete |
References MemoryCache().
| void MemoryCache::AddInvalidRange | ( | lldb::addr_t | base_addr, |
| lldb::addr_t | byte_size ) |
Definition at line 102 of file Memory.cpp.
References m_invalid_ranges, and m_mutex.
| void MemoryCache::AddL1CacheData | ( | lldb::addr_t | addr, |
| const lldb::DataBufferSP & | data_buffer_sp ) |
Definition at line 48 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 43 of file Memory.cpp.
References AddL1CacheData().
Referenced by AddL1CacheData(), AddL1CacheData(), Read(), and ReadRanges().
|
inline |
Definition at line 52 of file Memory.h.
References AddL1CacheData().
| void MemoryCache::Clear | ( | bool | clear_invalid_ranges = false | ) |
Definition at line 34 of file Memory.cpp.
References m_invalid_ranges, m_L1_cache, m_L2_cache, m_L2_cache_line_byte_size, m_mutex, and m_process.
Referenced by CommandObjectProcessFreeBSDKernelCoreRefreshThreads::DoExecute().
|
private |
Definition at line 127 of file Memory.cpp.
References lldb_private::Range< B, S >::Contains(), lldb_private::Range< B, S >::GetRangeBase(), and m_L1_cache.
Referenced by Read(), and ReadRanges().
| void MemoryCache::Flush | ( | lldb::addr_t | addr, |
| size_t | size ) |
Definition at line 54 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.
|
private |
Definition at line 141 of file Memory.cpp.
References error(), m_L2_cache, m_L2_cache_line_byte_size, m_mutex, and m_process.
Referenced by Read().
|
inline |
Definition at line 43 of file Memory.h.
References m_L2_cache_line_byte_size.
Referenced by MemoryCache().
|
privatedelete |
References error(), and MemoryCache().
| size_t MemoryCache::Read | ( | lldb::addr_t | addr, |
| void * | dst, | ||
| size_t | dst_len, | ||
| Status & | error ) |
Definition at line 169 of file Memory.cpp.
References AddL1CacheData(), error(), FindL1CacheEntry(), lldb_private::Status::FromErrorStringWithFormat(), GetL2CacheLine(), m_invalid_ranges, m_L2_cache_line_byte_size, m_mutex, and m_process.
| llvm::SmallVector< llvm::MutableArrayRef< uint8_t > > MemoryCache::ReadRanges | ( | llvm::ArrayRef< Range< lldb::addr_t, size_t > > | ranges, |
| llvm::MutableArrayRef< uint8_t > | buffer ) |
Reads multiple memory ranges, serving cache hits from L1 and batching all misses through Process::DoReadMemoryRanges.
The semantics of the return value match Process::ReadMemoryRanges.
Definition at line 275 of file Memory.cpp.
References AddL1CacheData(), FindL1CacheEntry(), m_invalid_ranges, m_mutex, and m_process.
| bool MemoryCache::RemoveInvalidRange | ( | lldb::addr_t | base_addr, |
| lldb::addr_t | byte_size ) |
Definition at line 112 of file Memory.cpp.
References lldb_private::Range< B, S >::GetByteSize(), lldb_private::Range< B, S >::GetRangeBase(), m_invalid_ranges, m_mutex, and UINT32_MAX.
|
protected |
Definition at line 71 of file Memory.h.
Referenced by AddInvalidRange(), Clear(), MemoryCache(), Read(), ReadRanges(), and RemoveInvalidRange().
|
protected |
Definition at line 66 of file Memory.h.
Referenced by AddL1CacheData(), Clear(), FindL1CacheEntry(), Flush(), and MemoryCache().
|
protected |
Definition at line 69 of file Memory.h.
Referenced by Clear(), Flush(), GetL2CacheLine(), and MemoryCache().
|
protected |
Definition at line 73 of file Memory.h.
Referenced by Clear(), Flush(), GetL2CacheLine(), GetMemoryCacheLineSize(), MemoryCache(), and Read().
|
protected |
Definition at line 65 of file Memory.h.
Referenced by AddInvalidRange(), AddL1CacheData(), Clear(), Flush(), GetL2CacheLine(), MemoryCache(), Read(), ReadRanges(), and RemoveInvalidRange().
|
protected |
Definition at line 72 of file Memory.h.
Referenced by Clear(), GetL2CacheLine(), MemoryCache(), Read(), and ReadRanges().