Re: [PATCH v4 3/6] GDB: aarch64-linux: Reorganize MTE-related definitions

Thiago Jung Bauermann
2026-03-04T04:18:24Z

Thiago Jung Bauermann <thiago.bauermann@linaro.org> writes:

> diff --git a/gdb/nat/aarch64-mte-linux-ptrace.h b/gdb/nat/aarch64-mte-linux-ptrace.h
> index d31fa9f3c071..653de33108c8 100644
> --- a/gdb/nat/aarch64-mte-linux-ptrace.h
> +++ b/gdb/nat/aarch64-mte-linux-ptrace.h
> @@ -20,6 +20,11 @@
> #ifndef GDB_NAT_AARCH64_MTE_LINUX_PTRACE_H
> #define GDB_NAT_AARCH64_MTE_LINUX_PTRACE_H
>
> +/* Feature check for Memory Tagging Extension. */
> +#ifndef HWCAP2_MTE
> +#define HWCAP2_MTE (1 << 18)
> +#endif
> +
> /* MTE allocation tag access */
>
> #ifndef PTRACE_PEEKMTETAGS

As with the previous patches, I locally amended this one to also include
<asm/hwcap.h>. And since this header also defines some ptrace constants,
also include <asm/ptrace.h>:

diff --git a/gdb/nat/aarch64-mte-linux-ptrace.h b/gdb/nat/aarch64-mte-linux-ptrace.h
index 653de33108c8..7d1e7c1960d1 100644
--- a/gdb/nat/aarch64-mte-linux-ptrace.h
+++ b/gdb/nat/aarch64-mte-linux-ptrace.h
@@ -20,6 +20,9 @@
#ifndef GDB_NAT_AARCH64_MTE_LINUX_PTRACE_H
#define GDB_NAT_AARCH64_MTE_LINUX_PTRACE_H

+#include <asm/hwcap.h>
+#include <asm/ptrace.h>
+
/* Feature check for Memory Tagging Extension. */
#ifndef HWCAP2_MTE
#define HWCAP2_MTE (1 << 18)

--
Thiago