[lldb][AArch64] Add support for memory tags in core filesThis teaches ProcessElfCore to recognise the MTE tag segments.https://www.kernel.org/doc/html/latest/arm64/memory-tagging-extension.html#c
[lldb][AArch64] Add support for memory tags in core filesThis teaches ProcessElfCore to recognise the MTE tag segments.https://www.kernel.org/doc/html/latest/arm64/memory-tagging-extension.html#core-dump-supportThese segments contain all the tags for a matching memory segmentwhich will have the same size in virtual address terms. In real termsit's 2 tags per byte so the data in the segment is much smaller.Since MTE is the only tag type supported I have hardcoded somethings to those values. We could and should support more formatsas they appear but doing so now would leave code untested until thathappens.A few things to note:* /proc/pid/smaps is not in the core file, only the details you have in "maps". Meaning we mark a region tagged only if it has a tag segment.* A core file supports memory tagging if it has at least 1 memory tag segment, there is no other flag we can check to tell if memory tagging was enabled. (unlike a live process that can support memory tagging even if there are currently no tagged memory regions)Tests have been added at the commands level for a core file withmte and without.There is a lot of overlap between the "memory tag read" tests here and the unit tests forMemoryTagManagerAArch64MTE::UnpackTagsFromCoreFileSegment, but I think it'sworth keeping to check ProcessElfCore doesn't cause an assert.Depends on D129487Reviewed By: omjavaidDifferential Revision: https://reviews.llvm.org/D129489
show more ...