Bug 14725

Summary: Ctrl-C cygwin/mingw32
Product: gdb Reporter: Jan Smets <jan.smets>
Component: gdbAssignee: Not yet assigned to anyone <unassigned>
Status: NEW ---    
Severity: enhancement CC: jojelino, pedro
Priority: P3    
Version: 7.5   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:
Attachments: strace

Description Jan Smets 2012-10-15 15:32:52 UTC
Created attachment 6689 [details]
strace

(gdb) set target-async on
(gdb) set pagination off
(gdb) set non-stop on
(gdb) set may-insert-fast-tracepoints off
(gdb) set may-insert-tracepoints off
(gdb) set displaced-stepping off
(gdb) set gnutarget a.out-i386
(gdb) target extended-remote 1.2.3.4:2159
Remote debugging using 1.2.3.4:2159
(gdb)
(gdb)
(gdb) attach 559480756
Attaching to process 559480756
[New Thread 559480756.559480756]
0x07c4e2a6 in ?? ()
(gdb) c
Continuing.

<ctrl-c> => nothing happens
<window-resize> => thread is stopped.

[Thread 559480756.559480756] #1 stopped.


A Ctrl-C or (ctrl-break) at this point should suspend the thread again. The ctrl-c is not handled correctly by GDB.
In cygwin 1.7 the Ctrl-C is handled correctly after a *window*resize*. 

See attached strace done on cygwin 1.7. 
(output taken after the 'continue' has been issued. There are two parts: 1 part is output after ctrl-c , part two is what happened after the window resize.)
Comment 1 gee 2012-10-25 20:32:30 UTC
Seems related to 14685
Comment 2 Pedro Alves 2013-01-02 19:18:35 UTC
Cygwin strace is unreadable to me.

In any case, "set debug remote 1" should show GDB sending a vCont;t packet in response to ctrl-c.  That starts out by SIGINT being handled in GDB in handle_remote_sigint, and that setting things up for the event loop to break and call async_remote_interrupt -> target_stop -> ... -> remote_stop_ns.

If that isn't working on Cygwin hosts, and vCont;t isn't being sent, someone motivated will need to debug GDB and figure out why not.  It was, last I tried (years ago).