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-02-28 01:24:45 +0300
committerTakashi Yano <takashi.yano@nifty.ne.jp>2022-02-28 02:00:16 +0300
commit15a35758d8490368fedfe595246b100c7af59a11 (patch)
tree1886d0fb7d969c4fabd81cd5142dcecc5d998ad8 /winsup/cygwin/fhandler_termios.cc
parent33d8578feb51f807e89d9592d5aaf28e88df4e0d (diff)
Cygwin: termios: Ensure detection of GDB inferior in process_sigs().
- In some situations, some cygwin processes might wrongly identified as GDB inferior. This patch ensures the detection of GDB inferior.
Diffstat (limited to 'winsup/cygwin/fhandler_termios.cc')
-rw-r--r--winsup/cygwin/fhandler_termios.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/winsup/cygwin/fhandler_termios.cc b/winsup/cygwin/fhandler_termios.cc
index f82ac76dc..028210d98 100644
--- a/winsup/cygwin/fhandler_termios.cc
+++ b/winsup/cygwin/fhandler_termios.cc
@@ -345,7 +345,8 @@ fhandler_termios::process_sigs (char c, tty* ttyp, fhandler_termios *fh)
without pcon enabled. In this case, the inferior is not
cygwin process list. PID_NEW_PG is set as a marker for
GDB with non-cygwin inferior in pty code.
- !PID_CYGPARENT: check this for GDB with cygwin inferior. */
+ !PID_CYGPARENT: check this for GDB with cygwin inferior or
+ 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)
@@ -408,13 +409,12 @@ fhandler_termios::process_sigs (char c, tty* ttyp, fhandler_termios *fh)
if (p->process_state & PID_TTYIN)
cyg_reader = true; /* Theh process is reading the tty */
if (!p->cygstarted && !(p->process_state & PID_NOTCYGWIN)
- && (p != myself || being_debugged ())
- && cyg_leader) /* inferior is cygwin app */
- with_debugger = true;
+ && (p->process_state & PID_DEBUGGED))
+ with_debugger = true; /* inferior is cygwin app */
if (!(p->process_state & PID_NOTCYGWIN)
&& (p->process_state & PID_NEW_PG) /* Check marker */
- && p->pid == pgid) /* inferior is non-cygwin app */
- with_debugger_nat = true;
+ && p->pid == pgid)
+ with_debugger_nat = true; /* inferior is non-cygwin app */
}
}
if ((with_debugger || with_debugger_nat) && need_discard_input)