From: Pedro Alves <palves@redhat.com>
To: gdb-patches@sourceware.org
Subject: [PUSHED] PR gdb/17096: async support breaks remote debugging on Windows
Date: Mon, 07 Jul 2014 18:13:00 -0000 [thread overview]
Message-ID: <1404756790-6767-1-git-send-email-palves@redhat.com> (raw)
On Windows, with "maint set target-async on" (the default since
a09dd441), Ctrl-C fails to stop a remote target.
With maint target-async on, the SIGINT signal handler doesn't send the
remote interrupt request immediately. Instead, it marks an async
handler as ready, and then the main event loop wakes up and notices
that the SIGINT async signal handler token was set, and calls the
corresponding event handler, which sends the remote interrupt request.
On POSIX-like systems, the SIGINT signal makes the select/poll in the
main event loop wake up / return with EINTR. However, on Windows,
signal handlers run on a separate thread, and Windows doesn't really
have a concept of EINTR. So, just marking the async handler
(effectively just setting a flag) does not wake up gdb_select.
Instead, we need to call gdb_call_async_signal_handler from the signal
handler. The Windows version (in mingw-hdep.c) sets a Windows event
that gdb_select's WaitForMultipleObjects is waiting for.
Confirmed that with this, Ctrl-C interrupts the remote target on
Windows. Also regression tested on x86_64 Fedora 20 against
GDBserver.
gdb/
2014-07-07 Pedro Alves <palves@redhat.com>
gdb/17096
* remote.c (async_handle_remote_sigint)
(async_handle_remote_sigint_twice): Call
gdb_call_async_signal_handler instead of
mark_async_signal_handler.
---
gdb/ChangeLog | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 513a919..cb7185e 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -6,6 +6,14 @@
gdb_call_async_signal_handler instead of
mark_async_signal_handler.
+2014-07-07 Pedro Alves <palves@redhat.com>
+
+ PR gdb/17096
+ * remote.c (async_handle_remote_sigint)
+ (async_handle_remote_sigint_twice): Call
+ gdb_call_async_signal_handler instead of
+ mark_async_signal_handler.
+
2014-07-07 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
--
1.9.3
next reply other threads:[~2014-07-07 18:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-07 18:13 Pedro Alves [this message]
2014-07-07 20:30 ` Joel Brobecker
2014-07-08 15:27 ` 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=1404756790-6767-1-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