summaryrefslogtreecommitdiff
path: root/gdb/remote.c
diff options
context:
space:
mode:
authorAlan Hayward <alan.hayward@arm.com>2018-08-01 10:57:13 +0100
committerAlan Hayward <alan.hayward@arm.com>2018-09-13 16:49:24 +0100
commit9ad94eaded134cf5824776ab0ccf8ecd47518919 (patch)
tree6e045bbd5995d982a53f5ea0dd68de3abd5e6a95 /gdb/remote.c
parent182f44d67243a3270ec540e92a8ba6ea327ba004 (diff)
downloadbinutils-gdb-9ad94eaded134cf5824776ab0ccf8ecd47518919.tar.gz
Aarch64 SVE: Support changing vector lengths in gdbserverusers/ahayward/variable_sve
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-08-03 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/remote.c')
-rw-r--r--gdb/remote.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/gdb/remote.c b/gdb/remote.c
index 69e7d93c87e..a54bd014a49 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -7689,9 +7689,24 @@ remote_target::process_stop_reply (struct stop_reply *stop_reply,
&& status->kind != TARGET_WAITKIND_SIGNALLED
&& status->kind != TARGET_WAITKIND_NO_RESUMED)
{
+ VEC (cached_reg_t) *stop_regs = stop_reply->regcache;
+
/* Expedited registers. */
- if (stop_reply->regcache)
+ if (stop_regs)
{
+ struct gdbarch *gdbarch = target_gdbarch ();
+
+ /* Check the target descriptor is still valid for the current target.
+ If not, then clear it find the correct one. */
+ if (gdbarch_target_description_changed_p (gdbarch, ptid, stop_regs))
+ {
+ gdbarch_target_info info
+ = gdbarch_target_get_tdep_info (gdbarch, stop_regs);
+ registers_changed ();
+ target_clear_description ();
+ target_find_description (info);
+ }
+
struct regcache *regcache
= get_thread_arch_regcache (ptid, stop_reply->arch);
cached_reg_t *reg;