From 68cffbbd4406b4efe1aa6e18460b1d7ca02549f1 Mon Sep 17 00:00:00 2001 From: Luis Machado Date: Thu, 31 Mar 2022 11:42:35 +0100 Subject: [AArch64] MTE corefile support Teach GDB how to dump memory tags for AArch64 when using the gcore command and how to read memory tag data back from a core file generated by GDB (via gcore) or by the Linux kernel. The format is documented in the Linux Kernel documentation [1]. Each tagged memory range (listed in /proc//smaps) gets dumped to its own PT_AARCH64_MEMTAG_MTE segment. A section named ".memtag" is created for each of those segments when reading the core file back. To save a little bit of space, given MTE tags only take 4 bits, the memory tags are stored packed as 2 tags per byte. When reading the data back, the tags are unpacked. I've added a new testcase to exercise the feature. Build-tested with --enable-targets=all and regression tested on aarch64-linux Ubuntu 20.04. [1] Documentation/arm64/memory-tagging-extension.rst (Core Dump Support) --- gdb/NEWS | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'gdb/NEWS') diff --git a/gdb/NEWS b/gdb/NEWS index 4d6de31..d2efe2a 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -3,6 +3,16 @@ *** Changes since GDB 12 +* GDB now supports dumping memory tag data for AArch64 MTE. It also supports + reading memory tag data for AArch64 MTE from core files generated by + the gcore command or the Linux kernel. + + When a process uses memory-mapped pages protected by memory tags (for + example, AArch64 MTE), this additional information will be recorded in + the core file in the event of a crash or if GDB generates a core file + from the current process state. GDB will show this additional information + automatically, or through one of the memory-tag subcommands. + * "info breakpoints" now displays enabled breakpoint locations of disabled breakpoints as in the "y-" state. For example: -- cgit v1.1