[PUSHED] PR gdb/17096: async support breaks remote debugging on Windows

Message ID 20140707203002.GM6038@adacore.com
State Not applicable
Headers

Commit Message

Joel Brobecker July 7, 2014, 8:30 p.m. UTC
  > 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.

It looks like the remote.c patch was missing, and since I looked it
up to take a look, I thought I might as well provide it here as well!
Thanks for working on this one, Pedro.
  

Comments

Pedro Alves July 8, 2014, 3:26 p.m. UTC | #1
On 07/07/2014 09:30 PM, Joel Brobecker wrote:
>> 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.
> 
> It looks like the remote.c patch was missing, and since I looked it
> up to take a look, I thought I might as well provide it here as well!
> Thanks for working on this one, Pedro.

Thanks Joel!
  

Patch

diff --git a/gdb/remote.c b/gdb/remote.c
index b6f3ddb..3aa030c 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -4818,7 +4818,9 @@  static void
 async_handle_remote_sigint (int sig)
 {
   signal (sig, async_handle_remote_sigint_twice);
-  mark_async_signal_handler (async_sigint_remote_token);
+  /* Note we need to go through gdb_call_async_signal_handler in order
+     to wake up the event loop on Windows.  */
+  gdb_call_async_signal_handler (async_sigint_remote_token, 0);
 }
 
 /* Signal handler for SIGINT, installed after SIGINT has already been
@@ -4828,7 +4830,8 @@  static void
 async_handle_remote_sigint_twice (int sig)
 {
   signal (sig, async_handle_remote_sigint);
-  mark_async_signal_handler (async_sigint_remote_twice_token);
+  /* See note in async_handle_remote_sigint.  */
+  gdb_call_async_signal_handler (async_sigint_remote_twice_token, 0);
 }
 
 /* Perform the real interruption of the target execution, in response