This is an archive of the discontinued LLVM Phabricator instance.

[lldb][AArch64] Add tag packing and repetition memory tag manager
ClosedPublic

Authored by DavidSpickett on Jun 30 2021, 3:29 AM.

Details

Summary

PackTags is used by to compress tags to go in the QMemTags packet
and be passed to ptrace when writing memory tags.

The behaviour of RepeatTagsForRange matches that described for QMemTags
in the GDB documentation:
https://sourceware.org/gdb/current/onlinedocs/gdb/General-Query-Packets.html#General-Query-Packets

In addition, unpacking tags with number of tags 0 now means
do not check that number of tags matches the range.
This will be used by lldb-server to unpack tags before repeating
them to fill the requested range.

Diff Detail

Event Timeline

DavidSpickett created this revision.Jun 30 2021, 3:29 AM
DavidSpickett requested review of this revision.Jun 30 2021, 3:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 30 2021, 3:29 AM
omjavaid accepted this revision.Jul 6 2021, 9:45 AM

This looks good. I just made some cosmetic comments.

lldb/include/lldb/Target/MemoryTagManager.h
92

Do you think it will be better if we default granules to 0 then granules will become optional?

lldb/unittests/Process/Utility/MemoryTagManagerAArch64MTETest.cpp
61

May be add a comment here as you have done for all the tests above and below this one.

274

May be add a comment explaining this helper.

This revision is now accepted and ready to land.Jul 6 2021, 9:45 AM
  • Make granules default to 0 for UnpackTagsData
  • Add more comments to tests

(I'll add a method to repeat packed tags in the later patch
that'll use it)

DavidSpickett marked 3 inline comments as done.Jul 7 2021, 2:17 AM
DavidSpickett retitled this revision from [lldb][AArch64] Add tag repeat and unpack to memory tag manager to [lldb][AArch64] Add tag packing and repetition memory tag manager.Jul 15 2021, 7:53 AM

Rebase, correct the commit title and printf formatters for 32 bit build.

This revision was landed with ongoing or failed builds.Jul 16 2021, 6:21 AM
This revision was automatically updated to reflect the committed changes.