diff options
author | Alan Hayward <alan.hayward@arm.com> | 2019-03-22 09:58:42 +0000 |
---|---|---|
committer | Alan Hayward <alan.hayward@arm.com> | 2019-03-22 09:58:42 +0000 |
commit | 6dc0ebde59dfb73eae507ced718bafa54023bf33 (patch) | |
tree | 9cc851b66b4b94d633e576f1b955edfe9b63d81c /gdb/aarch64-tdep.c | |
parent | 968aa7ae389d9e6cecb5fda6826bf889ed959fce (diff) | |
download | gdb-6dc0ebde59dfb73eae507ced718bafa54023bf33.zip gdb-6dc0ebde59dfb73eae507ced718bafa54023bf33.tar.gz gdb-6dc0ebde59dfb73eae507ced718bafa54023bf33.tar.bz2 |
AArch64: Add pointer authentication feature
Pointer Authentication is a new feature in AArch64 v8.3-a. When enabled in
the compiler, function return addresses will be mangled by the kernel.
Add register description xml and wire up to aarch64_linux_read_description.
This description includes the two pauth user registers.
Nothing yet uses the feature - that is added in later patches.
gdb/ChangeLog:
* aarch64-linux-nat.c
(aarch64_linux_nat_target::read_description): Add pauth param.
* aarch64-linux-tdep.c
(aarch64_linux_core_read_description): Likewise.
* aarch64-tdep.c (struct target_desc): Add in pauth.
(aarch64_read_description): Add pauth param.
(aarch64_gdbarch_init): Likewise.
* aarch64-tdep.h (aarch64_read_description): Likewise.
* arch/aarch64.c (aarch64_create_target_description): Likewise.
* arch/aarch64.h (aarch64_create_target_description): Likewise.
* features/Makefile: Add new files.
* features/aarch64-pauth.c: New file.
* features/aarch64-pauth.xml: New file.
gdb/doc/ChangeLog:
* gdb.texinfo: Describe pauth feature.
gdb/gdbserver/ChangeLog:
* linux-aarch64-ipa.c (get_ipa_tdesc): Add pauth param.
(initialize_low_tracepoint): Likewise.
* linux-aarch64-low.c (aarch64_arch_setup): Likewise.
* linux-aarch64-tdesc-selftest.c (aarch64_tdesc_test): Likewise.
* linux-aarch64-tdesc.c (struct target_desc): Likewise.
(aarch64_linux_read_description): Likewise.
* linux-aarch64-tdesc.h (aarch64_linux_read_description): Likewise.
Diffstat (limited to 'gdb/aarch64-tdep.c')
-rw-r--r-- | gdb/aarch64-tdep.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c index dd57ef9..0518837 100644 --- a/gdb/aarch64-tdep.c +++ b/gdb/aarch64-tdep.c @@ -69,7 +69,7 @@ #define HA_MAX_NUM_FLDS 4 /* All possible aarch64 target descriptors. */ -struct target_desc *tdesc_aarch64_list[AARCH64_MAX_SVE_VQ + 1]; +struct target_desc *tdesc_aarch64_list[AARCH64_MAX_SVE_VQ + 1][2/*pauth*/]; /* The standard register names, and all the valid aliases for them. */ static const struct @@ -2885,18 +2885,18 @@ aarch64_displaced_step_hw_singlestep (struct gdbarch *gdbarch, (It is not possible to set VQ to zero on an SVE system). */ const target_desc * -aarch64_read_description (uint64_t vq) +aarch64_read_description (uint64_t vq, bool pauth_p) { if (vq > AARCH64_MAX_SVE_VQ) error (_("VQ is %" PRIu64 ", maximum supported value is %d"), vq, AARCH64_MAX_SVE_VQ); - struct target_desc *tdesc = tdesc_aarch64_list[vq]; + struct target_desc *tdesc = tdesc_aarch64_list[vq][pauth_p]; if (tdesc == NULL) { - tdesc = aarch64_create_target_description (vq); - tdesc_aarch64_list[vq] = tdesc; + tdesc = aarch64_create_target_description (vq, pauth_p); + tdesc_aarch64_list[vq][pauth_p] = tdesc; } return tdesc; @@ -2961,7 +2961,7 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Ensure we always have a target description. */ if (!tdesc_has_registers (tdesc)) - tdesc = aarch64_read_description (0); + tdesc = aarch64_read_description (0, false); gdb_assert (tdesc); feature_core = tdesc_find_feature (tdesc, "org.gnu.gdb.aarch64.core"); @@ -3190,7 +3190,7 @@ When on, AArch64 specific debugging is enabled."), selftests::register_test ("aarch64-process-record", selftests::aarch64_process_record_test); selftests::record_xml_tdesc ("aarch64.xml", - aarch64_create_target_description (0)); + aarch64_create_target_description (0, false)); #endif } |