[Lldb-commits] [PATCH] D105630: [lldb][AArch64] Refactor memory tag range handling

David Spickett via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Jul 8 07:06:46 PDT 2021


DavidSpickett created this revision.
Herald added subscribers: danielkiss, kristof.beyls.
DavidSpickett requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

Previously GetMemoryTagManager checked many things in one:

- architecture supports memory tagging
- process supports memory tagging
- memory range isn't inverted
- memory range is all tagged

Since writing follow up patches for tag writing (in review
at the moment) it has become clear that this gets unwieldy
once we add the features needed for that.

It also implies that the memory tag manager is tied to the
range you used to request it with but it is not. It's a per
process object.

Instead:

- GetMemoryTagManager just checks architecture and process.
- Then the MemoryTagManager can later be asked to check a memory range.

This is better because:

- We don't imply that range and manager are tied together.
- A slightly diferent range calculation for tag writing doesn't add more code to Process.
- Range checking code can now be unit tested.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D105630

Files:
  lldb/include/lldb/Target/MemoryTagManager.h
  lldb/include/lldb/Target/Process.h
  lldb/source/Commands/CommandObjectMemoryTag.cpp
  lldb/source/Plugins/Process/Utility/MemoryTagManagerAArch64MTE.cpp
  lldb/source/Plugins/Process/Utility/MemoryTagManagerAArch64MTE.h
  lldb/source/Target/Process.cpp
  lldb/unittests/Process/Utility/MemoryTagManagerAArch64MTETest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105630.357215.patch
Type: text/x-patch
Size: 18186 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210708/3bc6b998/attachment-0001.bin>


More information about the lldb-commits mailing list