Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Yano <takashi.yano@nifty.ne.jp>2022-04-18 14:07:48 +0300
committerTakashi Yano <takashi.yano@nifty.ne.jp>2022-04-18 14:07:48 +0300
commit0a67adb0f518b1590bd94cdf98bed60888156bed (patch)
treec6fdab73a964c766e960fb8fe896bbb6683ef665 /winsup/cygwin/fhandler_termios.cc
parent98b6f23d98c5c75f96abd91860a2dccbebe7ffda (diff)
Cygwin: pty: Fix Ctrl-C behaviour in latest GDB.
- In the latest GDB (11.2-1), Ctrl-C behaviour is broken a bit for non-cygwin inferior. For example, Ctrl-C on GDB prompt is not sent to GDB but to the inferior. This patch fixes the issue.
Diffstat (limited to 'winsup/cygwin/fhandler_termios.cc')
-rw-r--r--winsup/cygwin/fhandler_termios.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/winsup/cygwin/fhandler_termios.cc b/winsup/cygwin/fhandler_termios.cc
index 5cd44d7bf..4eff5eab3 100644
--- a/winsup/cygwin/fhandler_termios.cc
+++ b/winsup/cygwin/fhandler_termios.cc
@@ -350,7 +350,8 @@ fhandler_termios::process_sigs (char c, tty* ttyp, fhandler_termios *fh)
cygwin apps started from non-cygwin shell. */
if (c == '\003' && p && p->ctty == ttyp->ntty && p->pgid == pgid
&& ((p->process_state & PID_NOTCYGWIN)
- || (p->exec_dwProcessId == p->dwProcessId)
+ || ((p->exec_dwProcessId == p->dwProcessId)
+ && ttyp->pty_input_state_eq (tty::to_nat))
|| !(p->process_state & PID_CYGPARENT)))
{
/* Ctrl-C event will be sent only to the processes attaching
@@ -406,6 +407,7 @@ fhandler_termios::process_sigs (char c, tty* ttyp, fhandler_termios *fh)
with_debugger = true; /* inferior is cygwin app */
if (!(p->process_state & PID_NOTCYGWIN)
&& (p->exec_dwProcessId == p->dwProcessId) /* Check marker */
+ && ttyp->pty_input_state_eq (tty::to_nat)
&& p->pid == pgid)
with_debugger_nat = true; /* inferior is non-cygwin app */
}