* regcache.c (registers_changed_ptid): Don't explictly always
authorPedro Alves <palves@redhat.com>
Fri, 4 Feb 2011 15:46:49 +0000 (15:46 +0000)
committerPedro Alves <palves@redhat.com>
Fri, 4 Feb 2011 15:46:49 +0000 (15:46 +0000)
clear `current_regcache'.  Only clear current_thread_ptid and
current_thread_arch when PTID matches.  Only reinit the frame
cache if PTID matches the current inferior_ptid.  Move alloca(0)
call to ...
(registers_changed): ... here.

gdb/ChangeLog
gdb/regcache.c

index ba2512df146d414fb187696e52f944c9e6a2f818..5d251d189761a8a01f120327d88de4228034ffcb 100644 (file)
@@ -1,3 +1,12 @@
+2011-02-04  Pedro Alves  <pedro@codesourcery.com>
+
+       * regcache.c (registers_changed_ptid): Don't explictly always
+       clear `current_regcache'.  Only clear current_thread_ptid and
+       current_thread_arch when PTID matches.  Only reinit the frame
+       cache if PTID matches the current inferior_ptid.  Move alloca(0)
+       call to ...
+       (registers_changed): ... here.
+
 2011-02-03  Ulrich Weigand  <ulrich.weigand@linaro.org>
 
        * arm-tdep.c (arm_skip_stack_protector): Accept any symbol that
index 53e0c598cf06bbf6c07d4f99eb4222874c23474f..286f1d125da79fd32f8e4428f5ace5a54947470e 100644 (file)
@@ -530,6 +530,7 @@ void
 registers_changed_ptid (ptid_t ptid)
 {
   struct regcache_list *list, **list_link;
+  int wildcard = ptid_equal (ptid, minus_one_ptid);
 
   list = current_regcache;
   list_link = &current_regcache;
@@ -550,13 +551,24 @@ registers_changed_ptid (ptid_t ptid)
       list = *list_link;
     }
 
-  current_regcache = NULL;
+  if (wildcard || ptid_equal (ptid, current_thread_ptid))
+    {
+      current_thread_ptid = null_ptid;
+      current_thread_arch = NULL;
+    }
 
-  current_thread_ptid = null_ptid;
-  current_thread_arch = NULL;
+  if (wildcard || ptid_equal (ptid, inferior_ptid))
+    {
+      /* We just deleted the regcache of the current thread.  Need to
+        forget about any frames we have cached, too.  */
+      reinit_frame_cache ();
+    }
+}
 
-  /* Need to forget about any frames we have cached, too.  */
-  reinit_frame_cache ();
+void
+registers_changed (void)
+{
+  registers_changed_ptid (minus_one_ptid);
 
   /* Force cleanup of any alloca areas if using C alloca instead of
      a builtin alloca.  This particular call is used to clean up
@@ -566,12 +578,6 @@ registers_changed_ptid (ptid_t ptid)
   alloca (0);
 }
 
-void
-registers_changed (void)
-{
-  registers_changed_ptid (minus_one_ptid);
-}
-
 void
 regcache_raw_read (struct regcache *regcache, int regnum, gdb_byte *buf)
 {
This page took 0.027708 seconds and 4 git commands to generate.