diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2016-09-26 15:45:28 +0100 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2018-09-23 16:15:19 +0100 |
commit | a44294f5ed9fe09fdfc9427f6f83677843590524 (patch) | |
tree | 1357139f02916e275f2c30add22d42c292eec043 | |
parent | 0c0a40e0abb9f1a584330a1911ad06b3686e5361 (diff) | |
download | gdb-a44294f5ed9fe09fdfc9427f6f83677843590524.zip gdb-a44294f5ed9fe09fdfc9427f6f83677843590524.tar.gz gdb-a44294f5ed9fe09fdfc9427f6f83677843590524.tar.bz2 |
Remove a spurious target_terminal::ours() from windows_nat_target::wait()
This causes the inferior to stop with SIGTTIN if it tries to read from the
terminal after it has been continued.
See https://cygwin.com/ml/cygwin/2016-09/msg00285.html for reproduction.
Since MinGW doesn't have a tcsetpgrp(), I don't think this problem would be
observed there, but Cygwin does so target_terminal::ours() will call it.
Calling target_terminal::ours() here seems to be is no longer appropriate
after the "Merge async and sync code paths" changes (as the inferior is now
in a separate process group even in sync mode(?), which is always used on
Windows targets)
This call was added in commit c44537cf (and see
https://sourceware.org/ml/gdb-patches/2007-02/msg00167.html for what it
fixed, which is not regressed by this change)
When windows_nat_target::wait() is entered, the inferior is running (either
it's been just been started or attached to, or windows_continue() was
called), so grabbing the controlling terminal away from it here seems to be
wrong, since infrun.c takes care of calling target_terminal::ours() when the
inferior stops.
gdb/ChangeLog:
2018-08-02 Jon Turney <jon.turney@dronecode.org.uk>
* windows-nat.c (windows_nat_target::wait): Remove a spurious
target_terminal::ours().
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/windows-nat.c | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8abb2ec..9aa3297 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2018-08-02 Jon Turney <jon.turney@dronecode.org.uk> + + * windows-nat.c (windows_nat_target::wait): Remove a spurious + target_terminal::ours(). + 2018-09-23 Simon Marchi <simon.marchi@ericsson.com> * aarch64-linux-tdep.c (aarch64_linux_supply_sve_regset): Change type diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index da66349..0047a26 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -1705,8 +1705,6 @@ windows_nat_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus, { int pid = -1; - target_terminal::ours (); - /* We loop when we get a non-standard exception rather than return with a SPURIOUS because resume can try and step or modify things, which needs a current_thread->h. But some of these exceptions mark |