diff options
author | Luis Machado <luis.machado@linaro.org> | 2021-10-29 14:54:36 -0300 |
---|---|---|
committer | Luis Machado <luis.machado@linaro.org> | 2021-11-03 09:50:53 -0300 |
commit | 7fd8546853e3f0333ba8d8238413aba7eb45c69f (patch) | |
tree | 2714fa190e169b928e56618cfdaaaa45d32117b8 /gdb/arch | |
parent | 5fff6115feae7aaa23c0ae8d144e1c8418ee2ee1 (diff) | |
download | binutils-7fd8546853e3f0333ba8d8238413aba7eb45c69f.zip binutils-7fd8546853e3f0333ba8d8238413aba7eb45c69f.tar.gz binutils-7fd8546853e3f0333ba8d8238413aba7eb45c69f.tar.bz2 |
[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.
I plan to backport this fix to GDB 11 as well.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28355
Diffstat (limited to 'gdb/arch')
-rw-r--r-- | gdb/arch/aarch64.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/arch/aarch64.h b/gdb/arch/aarch64.h index 0eb702c..95edb66 100644 --- a/gdb/arch/aarch64.h +++ b/gdb/arch/aarch64.h @@ -22,6 +22,15 @@ #include "gdbsupport/tdesc.h" +/* Holds information on what architectural features are available. This is + used to select register sets. */ +struct aarch64_features +{ + bool sve = false; + bool pauth = false; + bool mte = false; +}; + /* Create the aarch64 target description. A non zero VQ value indicates both the presence of SVE and the Vector Quotient - the number of 128bit chunks in an SVE Z register. HAS_PAUTH_P indicates the presence of the PAUTH |