From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7868) id E70DC3857C48; Mon, 18 Apr 2022 12:03:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E70DC3857C48 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Takashi Yano To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: pty: Fix Ctrl-C behaviour in latest GDB. X-Act-Checkin: newlib-cygwin X-Git-Author: Takashi Yano X-Git-Refname: refs/heads/master X-Git-Oldrev: 98b6f23d98c5c75f96abd91860a2dccbebe7ffda X-Git-Newrev: 0a67adb0f518b1590bd94cdf98bed60888156bed Message-Id: <20220418120342.E70DC3857C48@sourceware.org> Date: Mon, 18 Apr 2022 12:03:42 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2022 12:03:43 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D0a67adb0f51= 8b1590bd94cdf98bed60888156bed commit 0a67adb0f518b1590bd94cdf98bed60888156bed Author: Takashi Yano Date: Mon Apr 18 20:07:48 2022 +0900 Cygwin: pty: Fix Ctrl-C behaviour in latest GDB. =20 - 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. Diff: --- winsup/cygwin/fhandler_termios.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/fhandler_termios.cc b/winsup/cygwin/fhandler_ter= mios.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, fhan= dler_termios *fh) cygwin apps started from non-cygwin shell. */ if (c =3D=3D '\003' && p && p->ctty =3D=3D ttyp->ntty && p->pgid =3D= =3D pgid && ((p->process_state & PID_NOTCYGWIN) - || (p->exec_dwProcessId =3D=3D p->dwProcessId) + || ((p->exec_dwProcessId =3D=3D 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, fhan= dler_termios *fh) with_debugger =3D true; /* inferior is cygwin app */ if (!(p->process_state & PID_NOTCYGWIN) && (p->exec_dwProcessId =3D=3D p->dwProcessId) /* Check marker */ + && ttyp->pty_input_state_eq (tty::to_nat) && p->pid =3D=3D pgid) with_debugger_nat =3D true; /* inferior is non-cygwin app */ }