Make gdb/linux-nat.c consider a waitstatus pending on the infrun side
authorPedro Alves <palves@redhat.com>
Tue, 24 May 2016 13:47:57 +0000 (14:47 +0100)
committerPedro Alves <palves@redhat.com>
Tue, 24 May 2016 13:51:03 +0000 (14:51 +0100)
Working on the fix for gdb/19828, I saw
gdb.threads/attach-many-short-lived-threads.exp fail once in an
unusual way.  Unfortunately I didn't keep debug logs, but it's an
issue similar to what's been fixed in remote.c a while ago --
linux-nat.c was not fetching the pending status from the right place.

gdb/ChangeLog:
2016-05-24  Pedro Alves  <palves@redhat.com>

PR gdb/19828
* linux-nat.c (get_pending_status): If the thread reported the
event to the core and it's pending, use the pending status signal
number.

gdb/ChangeLog
gdb/linux-nat.c

index d08372b03fd0f44a1acde4d6f15d3e94da33436a..fa20332d08abcb49a8bb174a0bac03b2c06e3ef4 100644 (file)
@@ -1,3 +1,10 @@
+2016-05-24  Pedro Alves  <palves@redhat.com>
+
+       PR gdb/19828
+       * linux-nat.c (get_pending_status): If the thread reported the
+       event to the core and it's pending, use the pending status signal
+       number.
+
 2016-05-24  Pedro Alves  <palves@redhat.com>
 
        PR gdb/19828
index 6cd9fc673db6cb65284425d355a797e68468da92..fdd1ae4ed0ebbea534a6f3a5301acbc69f2cee61 100644 (file)
@@ -1320,7 +1320,10 @@ get_pending_status (struct lwp_info *lp, int *status)
     {
       struct thread_info *tp = find_thread_ptid (lp->ptid);
 
-      signo = tp->suspend.stop_signal;
+      if (tp->suspend.waitstatus_pending_p)
+       signo = tp->suspend.waitstatus.value.sig;
+      else
+       signo = tp->suspend.stop_signal;
     }
   else if (!target_is_non_stop_p ())
     {