[all-commits] [llvm/llvm-project] 325416: [lldb][AArch64/Linux] Show memory tagged memory re...

David Spickett via All-commits all-commits at lists.llvm.org
Fri Nov 20 03:22:20 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 32541685b2a980290c320adb289b56395a88d4c3
      https://github.com/llvm/llvm-project/commit/32541685b2a980290c320adb289b56395a88d4c3
  Author: David Spickett <david.spickett at linaro.org>
  Date:   2020-11-20 (Fri, 20 Nov 2020)

  Changed paths:
    M lldb/docs/lldb-gdb-remote.txt
    M lldb/docs/use/qemu-testing.rst
    M lldb/include/lldb/Target/MemoryRegionInfo.h
    M lldb/packages/Python/lldbsuite/test/lldbtest.py
    M lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
    M lldb/scripts/lldb-test-qemu/run-qemu.sh
    M lldb/source/Commands/CommandObjectMemory.cpp
    M lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
    M lldb/source/Plugins/Process/Utility/LinuxProcMaps.cpp
    M lldb/source/Plugins/Process/Utility/LinuxProcMaps.h
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
    M lldb/source/Plugins/Process/minidump/MinidumpParser.cpp
    M lldb/source/Target/MemoryRegionInfo.cpp
    A lldb/test/API/linux/aarch64/mte_memory_region/Makefile
    A lldb/test/API/linux/aarch64/mte_memory_region/TestAArch64LinuxMTEMemoryRegion.py
    A lldb/test/API/linux/aarch64/mte_memory_region/main.c
    M lldb/unittests/Process/Utility/CMakeLists.txt
    A lldb/unittests/Process/Utility/LinuxProcMapsTest.cpp
    M lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
    M lldb/unittests/Process/minidump/MinidumpParserTest.cpp

  Log Message:
  -----------
  [lldb][AArch64/Linux] Show memory tagged memory regions

This extends the "memory region" command to
show tagged regions on AArch64 Linux when the MTE
extension is enabled.

(lldb) memory region the_page
[0x0000fffff7ff8000-0x0000fffff7ff9000) rw-
memory tagging: enabled

This is done by adding an optional "flags" field to
the qMemoryRegion packet. The only supported flag is
"mt" but this can be extended.

This "mt" flag is read from /proc/{pid}/smaps on Linux,
other platforms will leave out the "flags" field.

Where this "mt" flag is received "memory region" will
show that it is enabled. If it is not or the target
doesn't support memory tagging, the line is not shown.
(since majority of the time tagging will not be enabled)

Testing is added for the existing /proc/{pid}/maps
parsing and the new smaps parsing.
Minidump parsing has been updated where needed,
though it only uses maps not smaps.

Target specific tests can be run with QEMU and I have
added MTE flags to the existing helper scripts.

Reviewed By: labath

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




More information about the All-commits mailing list