[lldb][AArch64] Add UnpackTagsFromCoreFileSegment to MemoryTagManager
authorDavid Spickett <david.spickett@linaro.org>
Mon, 11 Jul 2022 12:26:36 +0000 (13:26 +0100)
committerDavid Spickett <david.spickett@linaro.org>
Mon, 25 Jul 2022 14:51:36 +0000 (15:51 +0100)
commit883b0d5b7f873a7d6f8c8ee13c7f6174a2a79a50
tree9d2d5aa31fc37d81fc36161fb77d2fc8bcc71cbf
parent0f00e588418e75422d42502eaa8ad491b8a4b7a2
[lldb][AArch64] Add UnpackTagsFromCoreFileSegment to MemoryTagManager

This is the first part of support for reading MTE tags from Linux
core files. The format is documented here:
https://www.kernel.org/doc/html/latest/arm64/memory-tagging-extension.html#core-dump-support

This patch adds a method to unpack from the format the core
file uses, which is different to the one chosen for GDB packets.

MemoryTagManagerAArch64MTE is not tied one OS so another OS
might choose a different format in future. However, infrastructure
to handle that would go untested until then so I've chosen not to
attempt to handle that.

Reviewed By: omjavaid

Differential Revision: https://reviews.llvm.org/D129487
lldb/include/lldb/Target/MemoryTagManager.h
lldb/source/Plugins/Process/Utility/MemoryTagManagerAArch64MTE.cpp
lldb/source/Plugins/Process/Utility/MemoryTagManagerAArch64MTE.h
lldb/unittests/Process/Utility/MemoryTagManagerAArch64MTETest.cpp