[AArch64] Make gdbserver register set selection dynamic
authorLuis Machado <luis.machado@linaro.org>
Fri, 29 Oct 2021 17:54:36 +0000 (14:54 -0300)
committerLuis Machado <luis.machado@linaro.org>
Wed, 3 Nov 2021 13:02:31 +0000 (10:02 -0300)
commiteb79b2318066cafb75ffdce310e3bbd44f7c79e3
tree7b47e87b5b260045bb0e05c32b94655295876fc6
parenta941d3fdb172c72becb18e14a41b9621c060167f
[AArch64] Make gdbserver register set selection dynamic

The current register set selection mechanism for AArch64 is static, based
on a pre-populated array of register sets.

This means that we might potentially probe register sets that are not
available. This is OK if the kernel errors out during ptrace, but probing the
tag_ctl register, for example, does not result in a ptrace error if the kernel
supports the tagged address ABI but not MTE (PR 28355).

Making the register set selection dynamic, based on feature checks, solves
this and simplifies the code a bit. It allows us to list all of the register
sets only once, and pick and choose based on HWCAP/HWCAP2 or other properties.

gdb/ChangeLog:

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

PR gdb/28355

* arch/aarch64.h (struct aarch64_features): New struct.

gdbserver/ChangeLog:

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

PR gdb/28355

* linux-aarch64-low.cc (is_sve_tdesc): Remove.
(aarch64_target::low_arch_setup): Rework to adjust the register sets.
(aarch64_regsets): Update to list all register sets.
(aarch64_regsets_info, regs_info_aarch64): Replace NULL with nullptr.
(aarch64_sve_regsets, aarch64_sve_regsets_info)
(regs_info_aarch64_sve): Remove.
(aarch64_adjust_register_sets): New.
(aarch64_target::get_regs_info): Remove references to removed structs.
(initialize_low_arch): Likewise.
gdb/ChangeLog
gdb/arch/aarch64.h
gdbserver/ChangeLog
gdbserver/linux-aarch64-low.cc
This page took 0.02555 seconds and 4 git commands to generate.