From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 92848 invoked by alias); 7 Aug 2018 02:45:54 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 92682 invoked by uid 89); 7 Aug 2018 02:45:39 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS,SPF_PASS,TIME_LIMIT_EXCEEDED autolearn=unavailable version=3.3.2 spammy=ours, HTo:D*org.uk, controlling, reproduction X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 07 Aug 2018 02:45:21 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id w772j4ML007763 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 6 Aug 2018 22:45:09 -0400 Received: by simark.ca (Postfix, from userid 112) id 45A491EF36; Mon, 6 Aug 2018 22:45:04 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 264BD1E183; Mon, 6 Aug 2018 22:45:03 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 07 Aug 2018 02:45:00 -0000 From: Simon Marchi To: Jon Turney Cc: gdb-patches@sourceware.org, Pedro Alves Subject: Re: [PATCH] Remove a spurious target_terminal::ours() from windows_nat_target::wait() In-Reply-To: <20180802165357.176928-1-jon.turney@dronecode.org.uk> References: <20180802165357.176928-1-jon.turney@dronecode.org.uk> Message-ID: <061c2d850044c7e9915c4665ffd32c7f@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.6 X-IsSubscribed: yes X-SW-Source: 2018-08/txt/msg00110.txt.bz2 On 2018-08-02 12:53, Jon Turney wrote: > 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 > > * windows-nat.c (windows_nat_target::wait): Remove a spurious > target_terminal::ours(). This seems good to me, but I'd rather check with Pedro, since he knows this stuff much better. Simon