16 assert(
m_manager &&
"valid tag manager required to construct a MemoryTagMap");
20 const std::vector<lldb::addr_t> tags) {
22 size_t granule_size =
m_manager->GetGranuleSize();
23 for (
auto tag : tags) {
31std::vector<std::optional<lldb::addr_t>>
36 range =
m_manager->ExpandToGranule(range);
38 std::vector<std::optional<lldb::addr_t>> tags;
41 bool got_valid_tags =
false;
42 size_t granule_size =
m_manager->GetGranuleSize();
44 for (; addr < end_addr; addr += granule_size) {
45 std::optional<lldb::addr_t> tag =
GetTag(addr);
48 got_valid_tags =
true;
Range< lldb::addr_t, lldb::addr_t > TagRange
std::optional< lldb::addr_t > GetTag(lldb::addr_t addr) const
Lookup the tag for address.
MemoryTagMap(const MemoryTagManager *manager)
Init an empty tag map.
std::map< lldb::addr_t, lldb::addr_t > m_addr_to_tag
std::vector< std::optional< lldb::addr_t > > GetTags(lldb::addr_t addr, size_t len) const
Lookup memory tags for a range of memory from addr to addr+len.
void InsertTags(lldb::addr_t addr, const std::vector< lldb::addr_t > tags)
Insert tags into the map starting from addr.
const MemoryTagManager * m_manager
A class that represents a running process on the host machine.
BaseType GetRangeBase() const
BaseType GetRangeEnd() const