From patchwork Wed Oct 14 15:28:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 9133 Received: (qmail 11213 invoked by alias); 14 Oct 2015 15:37:59 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 11175 invoked by uid 89); 14 Oct 2015 15:37:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 14 Oct 2015 15:37:58 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 08DAEC0BFD0A for ; Wed, 14 Oct 2015 15:28:24 +0000 (UTC) Received: from brno.lan (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t9EFS6Dp016846 for ; Wed, 14 Oct 2015 11:28:23 -0400 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 16/18] gdbserver/linux: Always wake up event loop after resume Date: Wed, 14 Oct 2015 16:28:04 +0100 Message-Id: <1444836486-25679-17-git-send-email-palves@redhat.com> In-Reply-To: <1444836486-25679-1-git-send-email-palves@redhat.com> References: <1444836486-25679-1-git-send-email-palves@redhat.com> Running killed-outside.exp in with "maint set target-non-stop on" hangs currently. This test has the inferior process die with a SIGKILL while stopped. gdbserver gets a SIGCHLD and reacts by retrieveing the SIGKILL events out of waitpid. But because the process is not resumed from GDB's perspective, the event is left pending. When GDB resumes the process afterwards, the process is not really resumed because it already has the event pending. But nothing wakes up the event loop to consume the event. Handle this in the same way nat/linux-nat.c:linux_nat_resume handles this. gdb/gdbserver/ChangeLog: 2015-10-14 Pedro Alves * linux-low.c (linux_resume): Wake up the event loop before returning. --- gdb/gdbserver/linux-low.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index 73abe5c..c464207 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -4773,6 +4773,11 @@ linux_resume (struct thread_resume *resume_info, size_t n) debug_printf ("linux_resume done\n"); debug_exit (); } + + /* We may have events that were pending that can/should be sent to + the client now. Trigger a linux_wait call. */ + if (target_is_async_p ()) + async_file_mark (); } /* This function is called once per thread. We check the thread's