[all-commits] [llvm/llvm-project] d046fb: [lldb][AArch64] Refactor memory tag range handling

David Spickett via All-commits all-commits at lists.llvm.org
Fri Jul 16 03:02:21 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d046fb62b7e7cd273b104fee0162725003411c00
      https://github.com/llvm/llvm-project/commit/d046fb62b7e7cd273b104fee0162725003411c00
  Author: David Spickett <david.spickett at linaro.org>
  Date:   2021-07-16 (Fri, 16 Jul 2021)

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

  Log Message:
  -----------
  [lldb][AArch64] Refactor memory tag range handling

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.

Reviewed By: omjavaid

Differential Revision: https://reviews.llvm.org/D105630




More information about the All-commits mailing list