Index: win32-nat.c =================================================================== --- win32-nat.c (revision 130731) +++ win32-nat.c (working copy) @@ -1467,7 +1467,20 @@ win32_wait (ptid_t ptid, struct target_w while (1) { - int retval = get_win32_debug_event (pid, ourstatus); + int retval; + void (*ofunc) (int); + + /* For some reason, even when the terminal is owned by the inferior, + pressing control-c in the debugger window sometimes leads to + the debugger getting the associated SIGINT, which is unexpected. + In fact, both the inferior and the debugger get this signal. + To avoid getting this signal in the debugger, we temporarily + ignore SIGINT while waiting for debug events. However, this + might be a symptom of a problem in our terminal settings. */ + ofunc = signal (SIGINT, SIG_IGN); + retval = get_win32_debug_event (pid, ourstatus); + signal (SIGINT, ofunc); + if (retval) return pid_to_ptid (retval); else