|
LLDB mainline
|
A set of non-overlapping byte ranges at arbitrary addresses. More...
#include <Memory.h>
Public Types | |
| using | const_iterator = Collection::const_iterator |
| Iteration yields a chunk's start address and its bytes, in address order. | |
Public Member Functions | |
| llvm::ArrayRef< uint8_t > | Lookup (lldb::addr_t addr) const |
| The cached bytes from addr to the end of the chunk holding it, empty if no chunk holds it. | |
| bool | Holds (lldb::addr_t addr) const |
| void | InsertMissing (lldb::addr_t addr, llvm::ArrayRef< uint8_t > src) |
| Add the bytes of [addr, addr+src.size()) that no chunk holds yet. | |
| void | EraseRange (lldb::addr_t addr, lldb::addr_t size) |
| Drop every chunk that intersects [addr, addr+size). | |
| void | Clear () |
| size_t | GetSize () const |
| const_iterator | begin () const |
| const_iterator | end () const |
Private Types | |
| using | Collection = std::map<lldb::addr_t, std::vector<uint8_t>> |
Private Member Functions | |
| Collection::const_iterator | FindChunkContaining (lldb::addr_t addr) const |
| The chunk holding addr, or end(). | |
Private Attributes | |
| Collection | m_chunks |
A set of non-overlapping byte ranges at arbitrary addresses.
Lengths vary, so every chunk carries its own.
|
private |
| using lldb_private::ChunkCache::const_iterator = Collection::const_iterator |
|
inline |
|
inline |
|
inline |
| void ChunkCache::EraseRange | ( | lldb::addr_t | addr, |
| lldb::addr_t | size ) |
Drop every chunk that intersects [addr, addr+size).
Definition at line 99 of file Memory.cpp.
References m_chunks.
|
private |
The chunk holding addr, or end().
Chunks never overlap, so only the one starting at or below addr can hold it.
Definition at line 58 of file Memory.cpp.
References m_chunks.
Referenced by Lookup().
|
inline |
|
inline |
| void ChunkCache::InsertMissing | ( | lldb::addr_t | addr, |
| llvm::ArrayRef< uint8_t > | src ) |
Add the bytes of [addr, addr+src.size()) that no chunk holds yet.
Bytes already held are kept: which read produced a byte does not matter.
Definition at line 75 of file Memory.cpp.
| llvm::ArrayRef< uint8_t > ChunkCache::Lookup | ( | lldb::addr_t | addr | ) | const |
The cached bytes from addr to the end of the chunk holding it, empty if no chunk holds it.
Definition at line 68 of file Memory.cpp.
References FindChunkContaining(), and m_chunks.
Referenced by Holds(), and InsertMissing().
|
private |
Definition at line 103 of file Memory.h.
Referenced by begin(), Clear(), end(), EraseRange(), FindChunkContaining(), GetSize(), InsertMissing(), and Lookup().