AArch64: Add MTE register set support for GDB and gdbserver
authorLuis Machado <luis.machado@linaro.org>
Mon, 15 Jun 2020 16:59:40 +0000 (13:59 -0300)
committerLuis Machado <luis.machado@linaro.org>
Wed, 24 Mar 2021 17:52:57 +0000 (14:52 -0300)
commit5e984dbf3523ea86e3ef3750d6ecaeed74d87c87
treef6415f72ff6a9c4aae4905a2ad94b70e48b201eb
parentc1bd443b4d86e12f2a97856270e40df24c7f3df7
AArch64: Add MTE register set support for GDB and gdbserver

AArch64 MTE support in the Linux kernel exposes a new register
through ptrace.  This patch adds the required code to support it.

include/ChangeLog:

2021-03-24  Luis Machado  <luis.machado@linaro.org>

* elf/common.h (NT_ARM_TAGGED_ADDR_CTRL): Define.

gdb/ChangeLog:

2021-03-24  Luis Machado  <luis.machado@linaro.org>

* aarch64-linux-nat.c (fetch_mteregs_from_thread): New function.
(store_mteregs_to_thread): New function.
(aarch64_linux_nat_target::fetch_registers): Update to call
fetch_mteregs_from_thread.
(aarch64_linux_nat_target::store_registers): Update to call
store_mteregs_to_thread.
* aarch64-tdep.c (aarch64_mte_register_names): New struct.
(aarch64_cannot_store_register): Handle MTE registers.
(aarch64_gdbarch_init): Initialize and setup MTE registers.
* aarch64-tdep.h (gdbarch_tdep) <mte_reg_base>: New field.
<has_mte>: New method.
* arch/aarch64-linux.h (AARCH64_LINUX_SIZEOF_MTE): Define.

gdbserver/ChangeLog:

2021-03-24  Luis Machado  <luis.machado@linaro.org>

* linux-aarch64-low.cc (aarch64_fill_mteregset): New function.
(aarch64_store_mteregset): New function.
(aarch64_regsets): Add MTE register set entry.
(aarch64_sve_regsets): Add MTE register set entry.
gdb/ChangeLog
gdb/aarch64-linux-nat.c
gdb/aarch64-tdep.c
gdb/aarch64-tdep.h
gdb/arch/aarch64-mte-linux.h
gdbserver/ChangeLog
gdbserver/linux-aarch64-low.cc
include/elf/common.h