* regcache.c (set_register_cache): Invalidate regcaches before
authorPedro Alves <palves@redhat.com>
Mon, 12 Apr 2010 13:25:51 +0000 (13:25 +0000)
committerPedro Alves <palves@redhat.com>
Mon, 12 Apr 2010 13:25:51 +0000 (13:25 +0000)
changing the register cache layout.
(regcache_invalidate_one): Allow a NULL regcache.
* linux-x86-low.c (x86_linux_update_xmltarget): Invalidate
regcaches before changing the register cache layout or the target
regsets.

gdb/gdbserver/ChangeLog
gdb/gdbserver/linux-x86-low.c
gdb/gdbserver/regcache.c

index 87bf6956e1a76da5f5e2181ef428c248df1ba563..a860f5217bca146734b22a9e63b6a8a24b9098dd 100644 (file)
@@ -1,3 +1,12 @@
+2010-04-12  Pedro Alves  <pedro@codesourcery.com>
+
+       * regcache.c (set_register_cache): Invalidate regcaches before
+       changing the register cache layout.
+       (regcache_invalidate_one): Allow a NULL regcache.
+       * linux-x86-low.c (x86_linux_update_xmltarget): Invalidate
+       regcaches before changing the register cache layout or the target
+       regsets.
+
 2010-04-12  H.J. Lu  <hongjiu.lu@intel.com>
 
        * linux-x86-low.c (x86_linux_update_xmltarget): Avoid unused
index 1c282791ba32b8d1d9d2d5860af36fe715838b73..ec01f37e6def72b92374ebdd1158c5c9135f48c7 100644 (file)
@@ -841,6 +841,11 @@ x86_linux_update_xmltarget (void)
   if (!current_inferior)
     return;
 
+  /* Before changing the register cache internal layout or the target
+     regsets, flush the contents of the current valid caches back to
+     the threads.  */
+  regcache_invalidate ();
+
   pid = pid_of (get_thread_lwp (current_inferior));
 #ifdef __x86_64__
   if (num_xmm_registers == 8)
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.031547 seconds and 4 git commands to generate.