Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 5/6] Make gdb/linux-nat.c consider a waitstatus pending on the infrun side
Date: Thu, 19 May 2016 14:56:00 -0000	[thread overview]
Message-ID: <1463669290-30415-6-git-send-email-palves@redhat.com> (raw)
In-Reply-To: <1463669290-30415-1-git-send-email-palves@redhat.com>

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:
yyyy-mm-dd  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/linux-nat.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index ea2e4dc..f2bdddc 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -1330,7 +1330,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 ())
     {
-- 
2.5.5


  parent reply	other threads:[~2016-05-19 14:56 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-19 14:48 [PATCH 0/6] Fix PR gdb/19828 (attach -> internal error) and attach optimizations Pedro Alves
2016-05-19 14:48 ` [PATCH 3/6] [Linux] Avoid refetching core-of-thread if thread hasn't run Pedro Alves
2016-05-23 12:45   ` Yao Qi
2016-05-19 14:48 ` [PATCH 1/6] Linux native thread create/exit events support Pedro Alves
2016-05-23 10:49   ` Yao Qi
2016-05-23 13:00     ` Pedro Alves
2016-05-19 14:48 ` [PATCH 2/6] [Linux] Read vDSO range from /proc/PID/task/PID/maps instead of /proc/PID/maps Pedro Alves
2016-05-23 11:08   ` Yao Qi
2016-05-19 14:56 ` Pedro Alves [this message]
2016-05-19 14:57 ` [PATCH 6/6] Fix PR gdb/19828: gdb -p <process from a container>: internal error Pedro Alves
2016-05-23 10:14   ` Yao Qi
2016-05-25 17:43   ` [pushed/7.11.1] " Pedro Alves
2016-05-19 14:57 ` [PATCH 4/6] [Linux] Optimize PID -> struct lwp_info lookup Pedro Alves
2016-05-23 13:12   ` Yao Qi
2016-05-23 18:10     ` [PATCH v2/htab " Pedro Alves
2016-05-24  9:33       ` Yao Qi
2016-05-24 13:47         ` Pedro Alves
2016-05-19 15:11 ` [PATCH 0/6] Fix PR gdb/19828 (attach -> internal error) and attach optimizations Pedro Alves
2016-05-24 13:57 ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1463669290-30415-6-git-send-email-palves@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox