Commit 2232498c authored by Corinna Vinschen's avatar Corinna Vinschen

Cygwin: Don't change pgid to ctty pgid under debugger

_pinfo::set_ctty sets myself's pgid to the ctty pgid if the process has
been started from a non-Cygwin process.  This isn't the right thing to
do when started from GDB.  GDB starts the application via standard
Windows means, not via Cygwin fork/exec, so it's treated as being
a non-Cygwin parent.

But we want the app running in it's own process group.  So skip this
step when running under a debugger
Signed-off-by: default avatarCorinna Vinschen <>
parent a13145a3
......@@ -554,7 +554,11 @@ _pinfo::set_ctty (fhandler_termios *fh, int flags)
syscall_printf ("attaching %s sid %d, pid %d, pgid %d, tty->pgid %d, tty->sid %d",
__ctty (), sid, pid, pgid, tc.getpgid (), tc.getsid ());
if (!cygwin_finished_initializing && !myself->cygstarted
&& pgid == pid && tc.getpgid () && tc.getsid ())
&& pgid == pid && tc.getpgid () && tc.getsid ()
/* Even GDB starts app via CreateProcess which changes cygstarted.
This results in setting the wrong pgid here, so just skip this
under debugger. */
&& !being_debugged ())
pgid = tc.getpgid ();
/* May actually need to do this:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment