* regcache.c (set_register_cache): Invalidate regcaches before
[deliverable/binutils-gdb.git] / gdb / gdbserver / regcache.c
index 29fa2ff30a76b32216e605ab5aacf2421f22b1eb..9077a7198c8b8561a291b459895c9f4718d06895 100644 (file)
@@ -61,6 +61,9 @@ regcache_invalidate_one (struct inferior_list_entry *entry)
 
   regcache = (struct regcache *) inferior_regcache_data (thread);
 
+  if (regcache == NULL)
+    return;
+
   if (regcache->registers_valid)
     {
       struct thread_info *saved_inferior = current_inferior;
@@ -149,6 +152,10 @@ set_register_cache (struct reg *regs, int n)
 {
   int offset, i;
 
+  /* Before changing the register cache internal layout, flush the
+     contents of valid caches back to the threads.  */
+  regcache_invalidate ();
+
   reg_defs = regs;
   num_registers = n;
 
This page took 0.023442 seconds and 4 git commands to generate.