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.
This commit is contained in:
Takashi Yano 2022-04-18 20:43:44 +09:00
parent cb77d244b8
commit 6c22956ad8
1 changed files with 3 additions and 1 deletions

View File

@ -349,7 +349,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->process_state & PID_NEW_PG)
|| ((p->process_state & PID_NEW_PG)
&& ttyp->pcon_input_state_eq (tty::to_nat))
|| !(p->process_state & PID_CYGPARENT)))
{
/* Ctrl-C event will be sent only to the processes attaching
@ -423,6 +424,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->process_state & PID_NEW_PG) /* Check marker */
&& ttyp->pcon_input_state_eq (tty::to_nat)
&& p->pid == pgid)
with_debugger_nat = true; /* inferior is non-cygwin app */
}