[lldb] Add MemoryTagMap class
authorDavid Spickett <david.spickett@linaro.org>
Fri, 29 Oct 2021 15:10:36 +0000 (16:10 +0100)
committerDavid Spickett <david.spickett@linaro.org>
Wed, 26 Jan 2022 13:55:48 +0000 (13:55 +0000)
commit37c4bd0fdbc6bc5ec6145765d6f4dcd06540201d
treeceae28bc7dc53bce08dcc73978bfd945b9d1485b
parent31c1842a7b5ef4897fe3cbec21d261dae6ed5a74
[lldb] Add MemoryTagMap class

The tag map holds a sparse set of memory tags and allows
you to query ranges for tags.

Granules that do not have tags will be set to llvm::None.
to keep the ordering intact. If there are no tags for the
requested range we'll just return an empty result so that
callers don't need to check that all values are llvm::None.

This will be combined with MemoryTagManager's MakeTaggedRanges:
* MakeTaggedRanges
* Read from all those ranges
* Insert the results into the tag map
* Give the tag map to whatever needs to print tags

Which in this case will be "memory read"/DumpDataExtractor.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D112825
lldb/include/lldb/Target/MemoryTagMap.h [new file with mode: 0644]
lldb/source/Target/CMakeLists.txt
lldb/source/Target/MemoryTagMap.cpp [new file with mode: 0644]
lldb/unittests/Target/CMakeLists.txt
lldb/unittests/Target/MemoryTagMapTest.cpp [new file with mode: 0644]