* linux-low.c (linux_wait_for_process): Don't clobber current_inferior
authorDoug Evans <dje@google.com>
Fri, 12 Dec 2008 23:14:28 +0000 (23:14 +0000)
committerDoug Evans <dje@google.com>
Fri, 12 Dec 2008 23:14:28 +0000 (23:14 +0000)
in debugging printf.

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

index 3eecdd0857aec749c20cf838e4cda5c62bf0c9fc..9448e714bd189ebe990fe33b52fe5a00af96af26 100644 (file)
@@ -1,5 +1,8 @@
 2008-12-12  Doug Evans  <dje@google.com>
 
+       * linux-low.c (linux_wait_for_process): Don't clobber current_inferior
+       in debugging printf.
+
        * linux-low.c (handle_extended_wait): Simplify, use my_waitpid.
 
 2008-12-09  Doug Evans  <dje@google.com>
index 4a6acd8f3bc17cc1a6717aa5206fe3d334d22213..24ac4844d0cc0234a88752481318fd7af88c5785 100644 (file)
@@ -642,11 +642,13 @@ retry:
   if (debug_threads
       && WIFSTOPPED (*wstatp))
     {
+      struct thread_info *saved_inferior = current_inferior;
       current_inferior = (struct thread_info *)
        find_inferior_id (&all_threads, (*childp)->lwpid);
       /* For testing only; i386_stop_pc prints out a diagnostic.  */
       if (the_low_target.get_pc != NULL)
        get_stop_pc ();
+      current_inferior = saved_inferior;
     }
 }