gdb/
authorJan Kratochvil <jan.kratochvil@redhat.com>
Tue, 20 Jul 2010 12:33:30 +0000 (12:33 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Tue, 20 Jul 2010 12:33:30 +0000 (12:33 +0000)
Code cleanup.
* linux-nat.c (linux_nat_wait_1): Reset STATUS after calling
linux_nat_wait_1.  Use always LP->STATUS afterwards.

gdb/ChangeLog
gdb/linux-nat.c

index 8776c0cb1fbf973c4046ab1275f60c90aba2fa8a..f469860ca3beb74473f7d70c18587ceb9b26095b 100644 (file)
@@ -1,3 +1,9 @@
+2010-07-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Code cleanup.
+       * linux-nat.c (linux_nat_wait_1): Reset STATUS after calling
+       linux_nat_wait_1.  Use always LP->STATUS afterwards.
+
 2010-07-20  Hui Zhu  <teawater@gmail.com>
 
        * inf-ptrace.c (inf_ptrace_create_inferior): Initialize back_to.
index a659afa7b643061125ab854186480259ffb8cbf3..b894d848bb6e921daaec8dff34da00e0570ce146 100644 (file)
@@ -3367,6 +3367,9 @@ retry:
 
          lp = linux_nat_filter_event (lwpid, status, options);
 
+         /* STATUS is now no longer valid, use LP->STATUS instead.  */
+         status = 0;
+
          if (lp
              && ptid_is_pid (ptid)
              && ptid_get_pid (lp->ptid) != ptid_get_pid (ptid))
@@ -3375,7 +3378,7 @@ retry:
 
              if (debug_linux_nat)
                fprintf (stderr, "LWP %ld got an event %06x, leaving pending.\n",
-                        ptid_get_lwp (lp->ptid), status);
+                        ptid_get_lwp (lp->ptid), lp->status);
 
              if (WIFSTOPPED (lp->status))
                {
@@ -3412,7 +3415,7 @@ retry:
                      lp->signalled = 0;
                    }
                }
-             else if (WIFEXITED (status) || WIFSIGNALED (status))
+             else if (WIFEXITED (lp->status) || WIFSIGNALED (lp->status))
                {
                  if (debug_linux_nat)
                    fprintf (stderr, "Process %ld exited while stopping LWPs\n",