aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote.c
diff options
context:
space:
mode:
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 c1e95bb..e81b776 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -7686,9 +7686,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;