* corelow.c (core_open): Flush the register cache before doing
authorPedro Alves <palves@redhat.com>
Mon, 18 May 2009 12:12:16 +0000 (12:12 +0000)
committerPedro Alves <palves@redhat.com>
Mon, 18 May 2009 12:12:16 +0000 (12:12 +0000)
anything with registers.

gdb/ChangeLog
gdb/corelow.c

index 1a99b111789e780840c9e6294c5393f7b242b96f..ecfe85adca6691b0f0e1a0114aa4586cf441e611 100644 (file)
@@ -1,3 +1,8 @@
+2009-05-18  Pedro Alves  <pedro@codesourcery.com>
+
+       * corelow.c (core_open): Flush the register cache before doing
+       anything with registers.
+
 2009-05-18  Pedro Alves  <pedro@codesourcery.com>
 
        * inflow.h (our_process_group): Remove declaration.
index 5d6f0726150c182e653e22065c6120caf52b55b7..ffaf04c93ae313f020740fa60221e50f53030709 100644 (file)
@@ -379,6 +379,14 @@ core_open (char *filename, int from_tty)
      from ST to MT.  */
   add_thread_silent (inferior_ptid);
 
+  /* Need to flush the register cache (and the frame cache) from a
+     previous debug session.  If inferior_ptid ends up the same as the
+     last debug session --- e.g., b foo; run; gcore core1; step; gcore
+     core2; core core1; core core2 --- then there's potential for
+     get_current_regcache to return the cached regcache of the
+     previous session, and the frame cache being stale.  */
+  registers_changed ();
+
   /* Build up thread list from BFD sections, and possibly set the
      current thread to the .reg/NN section matching the .reg
      section. */
This page took 0.02927 seconds and 4 git commands to generate.