aboutsummaryrefslogtreecommitdiff
path: root/lldb/include/lldb/Target/MemoryTagManager.h
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/include/lldb/Target/MemoryTagManager.h')
-rw-r--r--lldb/include/lldb/Target/MemoryTagManager.h23
1 files changed, 20 insertions, 3 deletions
diff --git a/lldb/include/lldb/Target/MemoryTagManager.h b/lldb/include/lldb/Target/MemoryTagManager.h
index a5e0deba14a9..859c43cb437a 100644
--- a/lldb/include/lldb/Target/MemoryTagManager.h
+++ b/lldb/include/lldb/Target/MemoryTagManager.h
@@ -35,8 +35,8 @@ public:
// you get will have been shifted down 56 before being returned.
virtual lldb::addr_t GetLogicalTag(lldb::addr_t addr) const = 0;
- // Remove non address bits from a pointer
- virtual lldb::addr_t RemoveNonAddressBits(lldb::addr_t addr) const = 0;
+ // Remove tag bits from a pointer
+ virtual lldb::addr_t RemoveTagBits(lldb::addr_t addr) const = 0;
// Return the difference between two addresses, ignoring any logical tags they
// have. If your tags are just part of a larger set of ignored bits, this
@@ -64,7 +64,7 @@ public:
// (which may include one or more memory regions)
//
// If so, return a modified range which will have been expanded
- // to be granule aligned.
+ // to be granule aligned. Otherwise return an error.
//
// Tags in the input addresses are ignored and not present
// in the returned range.
@@ -72,6 +72,23 @@ public:
lldb::addr_t addr, lldb::addr_t end_addr,
const lldb_private::MemoryRegionInfos &memory_regions) const = 0;
+ // Given a range addr to end_addr, check that end_addr >= addr.
+ // If it is not, return an error saying so.
+ // Otherwise, granule align it and return a set of ranges representing
+ // subsections of the aligned range that have memory tagging enabled.
+ //
+ // Basically a sparse version of MakeTaggedRange. Use this when you
+ // want to know which parts of a larger range have memory tagging.
+ //
+ // Regions in memory_regions should be sorted in ascending order and
+ // not overlap. (use Process GetMemoryRegions)
+ //
+ // Tags in the input addresses are ignored and not present
+ // in the returned ranges.
+ virtual llvm::Expected<std::vector<TagRange>> MakeTaggedRanges(
+ lldb::addr_t addr, lldb::addr_t end_addr,
+ const lldb_private::MemoryRegionInfos &memory_regions) const = 0;
+
// Return the type value to use in GDB protocol qMemTags packets to read
// allocation tags. This is named "Allocation" specifically because the spec
// allows for logical tags to be read the same way, though we do not use that.