2010-03-06 Simo Melenius <simo.melenius@iki.fi>
authorPedro Alves <palves@redhat.com>
Sat, 6 Mar 2010 00:11:42 +0000 (00:11 +0000)
committerPedro Alves <palves@redhat.com>
Sat, 6 Mar 2010 00:11:42 +0000 (00:11 +0000)
* linux-low.c (linux_wait_for_lwp): Fetch the regcache after
switching the current inferior, not before.

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

index 4fae9ccf21960389595558fe1c790467d0f5d689..27af34e8fa789b1ac45b08abbd2df77bc5ed10a3 100644 (file)
@@ -1,3 +1,8 @@
+2010-03-06  Simo Melenius  <simo.melenius@iki.fi>
+
+       * linux-low.c (linux_wait_for_lwp): Fetch the regcache after
+       switching the current inferior, not before.
+
 2010-03-01  H.J. Lu  <hongjiu.lu@intel.com>
 
        * Makefile.in (clean): Replace reg-i386.c, reg-x86-64.c,
index 262a1df15d715bfdf11a09a0fb30f9831c91041c..6499ca7e52e0aca7efad979ca8805a1f09c12f60 100644 (file)
@@ -1067,11 +1067,12 @@ retry:
       && the_low_target.get_pc != NULL)
     {
       struct thread_info *saved_inferior = current_inferior;
-      struct regcache *regcache = get_thread_regcache (current_inferior, 1);
+      struct regcache *regcache;
       CORE_ADDR pc;
 
       current_inferior = (struct thread_info *)
        find_inferior_id (&all_threads, child->head.id);
+      regcache = get_thread_regcache (current_inferior, 1);
       pc = (*the_low_target.get_pc) (regcache);
       fprintf (stderr, "linux_wait_for_lwp: pc is 0x%lx\n", (long) pc);
       current_inferior = saved_inferior;