|
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 memory ranges, serving hits from the cache and batching 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 | AddCacheData (lldb::addr_t addr, const void *src, size_t src_len) |
| Allow external sources to populate data into the memory cache. | |
| void | AddCacheData (lldb::addr_t addr, llvm::ArrayRef< uint8_t > src) |
| void | AddCacheData (lldb::addr_t addr, const lldb::DataBufferSP &data_buffer_sp) |
Protected Types | |
| 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 |
| ChunkCache | m_L1_cache |
| LineCache | m_L2_cache |
| InvalidRanges | m_invalid_ranges |
| Process & | m_process |
Private Member Functions | |
| MemoryCache (const MemoryCache &)=delete | |
| const MemoryCache & | operator= (const MemoryCache &)=delete |
| void | InsertWholeLine (lldb::addr_t line_base_addr, llvm::ArrayRef< uint8_t > src) |
| void | InsertPartialLine (lldb::addr_t addr, llvm::ArrayRef< uint8_t > src) |
| void | InsertData (lldb::addr_t addr, llvm::ArrayRef< uint8_t > src) |
| size_t | ReadFromCaches (lldb::addr_t addr, void *dst, size_t len) const |
| AddrRange | GrowReadRange (lldb::addr_t read_addr, lldb::addr_t caller_end, size_t bytes_filled) const |
|
protected |
|
protected |
| MemoryCache::MemoryCache | ( | Process & | process | ) |
Definition at line 116 of file Memory.cpp.
References GetMemoryCacheLineSize(), m_invalid_ranges, m_L1_cache, m_L2_cache, m_mutex, and m_process.
Referenced by MemoryCache(), and operator=().
|
default |
References error().
|
privatedelete |
References MemoryCache().
| void MemoryCache::AddCacheData | ( | lldb::addr_t | addr, |
| const lldb::DataBufferSP & | data_buffer_sp ) |
Definition at line 185 of file Memory.cpp.
References InsertData().
| void MemoryCache::AddCacheData | ( | lldb::addr_t | addr, |
| const void * | src, | ||
| size_t | src_len ) |
Allow external sources to populate data into the memory cache.
Definition at line 131 of file Memory.cpp.
References InsertData().
Referenced by AddCacheData(), Read(), and ReadRanges().
|
inline |
Definition at line 138 of file Memory.h.
References AddCacheData().
| void MemoryCache::AddInvalidRange | ( | lldb::addr_t | base_addr, |
| lldb::addr_t | byte_size ) |
Definition at line 200 of file Memory.cpp.
References m_invalid_ranges, and m_mutex.
| void MemoryCache::Clear | ( | bool | clear_invalid_ranges = false | ) |
Definition at line 123 of file Memory.cpp.
References m_invalid_ranges, m_L1_cache, m_L2_cache, m_mutex, and m_process.
Referenced by CommandObjectProcessFreeBSDKernelCoreRefreshThreads::DoExecute().
| void MemoryCache::Flush | ( | lldb::addr_t | addr, |
| size_t | size ) |
Definition at line 190 of file Memory.cpp.
References m_L1_cache, m_L2_cache, and m_mutex.
|
inline |
|
private |
Definition at line 250 of file Memory.cpp.
References m_invalid_ranges, m_L2_cache, and UINT64_MAX.
Referenced by Read().
|
private |
Definition at line 155 of file Memory.cpp.
References InsertPartialLine(), InsertWholeLine(), m_L2_cache, and m_mutex.
Referenced by AddCacheData(), and AddCacheData().
|
private |
Definition at line 143 of file Memory.cpp.
References m_L1_cache, and m_L2_cache.
Referenced by InsertData().
|
private |
Definition at line 136 of file Memory.cpp.
References m_L1_cache, and m_L2_cache.
Referenced by InsertData().
|
privatedelete |
References MemoryCache().
| size_t MemoryCache::Read | ( | lldb::addr_t | addr, |
| void * | dst, | ||
| size_t | dst_len, | ||
| Status & | error ) |
Definition at line 290 of file Memory.cpp.
References AddCacheData(), error(), lldb_private::Status::FromErrorStringWithFormat(), lldb_private::Range< B, S >::GetRangeBase(), lldb_private::Range< B, S >::GetRangeEnd(), GrowReadRange(), LLDB_INVALID_ADDRESS, m_invalid_ranges, m_mutex, m_process, and ReadFromCaches().
|
private |
Definition at line 225 of file Memory.cpp.
References m_L1_cache, m_L2_cache, and UINT64_MAX.
Referenced by Read(), and ReadRanges().
| llvm::SmallVector< llvm::MutableArrayRef< uint8_t > > MemoryCache::ReadRanges | ( | llvm::ArrayRef< Range< lldb::addr_t, size_t > > | ranges, |
| llvm::MutableArrayRef< uint8_t > | buffer ) |
Reads memory ranges, serving hits from the cache and batching misses through Process::DoReadMemoryRanges.
Matches Process::ReadMemoryRanges.
Definition at line 338 of file Memory.cpp.
References AddCacheData(), m_invalid_ranges, m_mutex, m_process, and ReadFromCaches().
| bool MemoryCache::RemoveInvalidRange | ( | lldb::addr_t | base_addr, |
| lldb::addr_t | byte_size ) |
Definition at line 210 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 155 of file Memory.h.
Referenced by AddInvalidRange(), Clear(), GrowReadRange(), MemoryCache(), Read(), ReadRanges(), and RemoveInvalidRange().
|
protected |
Definition at line 153 of file Memory.h.
Referenced by Clear(), Flush(), InsertPartialLine(), InsertWholeLine(), MemoryCache(), and ReadFromCaches().
|
protected |
Definition at line 154 of file Memory.h.
Referenced by Clear(), Flush(), GetMemoryCacheLineSize(), GrowReadRange(), InsertData(), InsertPartialLine(), InsertWholeLine(), MemoryCache(), and ReadFromCaches().
|
protected |
Definition at line 150 of file Memory.h.
Referenced by AddInvalidRange(), Clear(), Flush(), InsertData(), MemoryCache(), Read(), ReadRanges(), and RemoveInvalidRange().
|
protected |
Definition at line 156 of file Memory.h.
Referenced by Clear(), MemoryCache(), Read(), and ReadRanges().