[all-commits] [llvm/llvm-project] 5d3436: [lldb][AArch64] Add MTE memory tag reading to lldb

David Spickett via All-commits all-commits at lists.llvm.org
Thu Jun 24 09:17:24 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5d3436200147a999670f754288a03c4ac5a15aeb
      https://github.com/llvm/llvm-project/commit/5d3436200147a999670f754288a03c4ac5a15aeb
  Author: David Spickett <david.spickett at linaro.org>
  Date:   2021-06-24 (Thu, 24 Jun 2021)

  Changed paths:
    M lldb/include/lldb/Core/Architecture.h
    M lldb/include/lldb/Target/Process.h
    A lldb/source/Plugins/Architecture/AArch64/ArchitectureAArch64.cpp
    A lldb/source/Plugins/Architecture/AArch64/ArchitectureAArch64.h
    A lldb/source/Plugins/Architecture/AArch64/CMakeLists.txt
    M lldb/source/Plugins/Architecture/CMakeLists.txt
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
    M lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
    M lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
    M lldb/source/Target/Process.cpp
    M lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp

  Log Message:
  -----------
  [lldb][AArch64] Add MTE memory tag reading to lldb

This adds GDB client support for the qMemTags packet
which reads memory tags. Following the design
which was recently committed to GDB.

https://sourceware.org/gdb/current/onlinedocs/gdb/General-Query-Packets.html#General-Query-Packets
(look for qMemTags)

lldb commands will use the new Process methods
GetMemoryTagManager and ReadMemoryTags.

The former takes a range and checks that:
* The current process architecture has an architecture plugin
* That plugin provides a MemoryTagManager
* That the range of memory requested lies in a tagged range
  (it will expand it to granules for you)

If all that was true you get a MemoryTagManager you
can give to ReadMemoryTags.

This two step process is done to allow commands to get the
tag manager without having to read tags as well. For example
you might just want to remove a logical tag, or error early
if a range with tagged addresses is inverted.

Note that getting a MemoryTagManager doesn't mean that the process
or a specific memory range is tagged. Those are seperate checks.
Having a tag manager just means this architecture *could* have
a tagging feature enabled.

An architecture plugin has been added for AArch64 which
will return a MemoryTagManagerAArch64MTE, which was added in a
previous patch.

Reviewed By: omjavaid

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




More information about the All-commits mailing list