diff options
author | Alan Hayward <alan.hayward@arm.com> | 2018-11-07 15:15:36 +0000 |
---|---|---|
committer | Alan Hayward <alan.hayward@arm.com> | 2018-11-07 15:16:30 +0000 |
commit | e8f3f2047b55760c52f786b46780de997a31d002 (patch) | |
tree | 6b53906125aad9b7e3e9b6e93af7f52e63faddd1 /gdb/target-descriptions.c | |
parent | 7a9abb2bce8f2f52f7f59927b18582f67a0c3208 (diff) | |
download | binutils-users/ahayward/variable_sve2.zip binutils-users/ahayward/variable_sve2.tar.gz binutils-users/ahayward/variable_sve2.tar.bz2 |
Aarch64 SVE: Support changing vector lengths in gdbserverusers/ahayward/variable_sve2
There are two parts to this patch - gdbserver and GDB.
In gdbserver, there needs to be an equivalent of the thread_architecture
method used in GDB. In regcache, validate the tdesc with the
use target_validate_tdesc target function. If this fails then re-obtain
the target descriptor via general setup.
The aarch64 validation step simply checks the value of the VG register to
see if it matches the current kernel value.
In GDB, we have a similar check when receiving a stop reply. Validate the
tdesc using gdbarch_target_description_changed_p. If this fails re-obtain
the target descriptor via general setup - which is done by setting up an
tdep info structure containing the vector length.
The aarch64 validation step checks the value of VG (which is marked as
an expediated register, so is in the stop reply).
2018-11-07 Alan Hayward <alan.hayward@arm.com>
gdb/
* aarch64-tdep.c
(aarch64_target_description_changed_p): Check vector length.
(aarch64_target_get_tdep_info): Store vector length.
* remote.c (remote_target::process_stop_reply): Validate tdesc.
* target-descriptions.c (target_find_description): Pass through info.
* target-descriptions.h (target_find_description): Add arg.
gdbserver/
* linux-aarch64-low.c (aarch64_validate_tdesc): Check vector length.
* regcache.c (get_thread_regcache): Validate tdesc.
Diffstat (limited to 'gdb/target-descriptions.c')
-rw-r--r-- | gdb/target-descriptions.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c index bdd29c0..3d50ed1 100644 --- a/gdb/target-descriptions.c +++ b/gdb/target-descriptions.c @@ -491,11 +491,12 @@ target_desc_info_free (struct target_desc_info *tdesc_info) static char *tdesc_filename_cmd_string; -/* Fetch the current target's description, and switch the current - architecture to one which incorporates that description. */ +/* Fetch the current inferior's description, and switch its current + architecture to one which incorporates that description. If given, use the + tdep_info when finding the description. */ void -target_find_description (void) +target_find_description (gdbarch_target_info target_info) { /* If we've already fetched a description from the target, don't do it again. This allows a target to fetch the description early, @@ -534,6 +535,8 @@ target_find_description (void) gdbarch_info_init (&info); info.target_desc = current_target_desc; + info.target_info = target_info; + if (!gdbarch_update_p (info)) warning (_("Architecture rejected target-supplied description")); else |