From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29181 invoked by alias); 31 Jul 2013 03:40:59 -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 29155 invoked by uid 89); 31 Jul 2013 03:40:58 -0000 X-Spam-SWARE-Status: No, score=-49.2 required=5.0 tests=AWL,BAYES_50,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE,RDNS_NONE autolearn=no version=3.3.1 Received: from Unknown (HELO mho-02-ewr.mailhop.org) (204.13.248.72) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 31 Jul 2013 03:40:58 +0000 Received: from pool-173-48-46-190.bstnma.fios.verizon.net ([173.48.46.190] helo=cgf.cx) by mho-02-ewr.mailhop.org with esmtpa (Exim 4.72) (envelope-from ) id 1V4NHL-000Fnv-Ii; Wed, 31 Jul 2013 03:40:47 +0000 Received: from localhost (ednor.casa.cgf.cx [192.168.187.5]) by cgf.cx (Postfix) with ESMTP id EDEA96013C; Tue, 30 Jul 2013 23:40:45 -0400 (EDT) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1824JjY98zdn2J2C23DSrkn Date: Wed, 31 Jul 2013 03:40:00 -0000 From: Christopher Faylor To: Pedro Alves , gdb-patches@sourceware.org, yao@codesourcery.com, Eli Zaretskii Subject: Re: [PATCH] Unbuffer stdout and stderr on windows Message-ID: <20130731034045.GA5565@ednor.casa.cgf.cx> Mail-Followup-To: Pedro Alves , gdb-patches@sourceware.org, yao@codesourcery.com, Eli Zaretskii References: <1374462417-7961-1-git-send-email-yao@codesourcery.com> <838v0yy556.fsf@gnu.org> <51EE23F8.1070905@codesourcery.com> <83wqohw4ee.fsf@gnu.org> <20130729192559.GA5348@ednor.casa.cgf.cx> <83d2q1xiyv.fsf@gnu.org> <51F6C7B2.3020400@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <51F6C7B2.3020400@redhat.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-SW-Source: 2013-07/txt/msg00806.txt.bz2 On Mon, Jul 29, 2013 at 08:51:14PM +0100, Pedro Alves wrote: >On 07/29/2013 08:30 PM, Eli Zaretskii wrote: >>> Date: Mon, 29 Jul 2013 15:25:59 -0400 >>> From: Christopher Faylor >>> >>> Note that this is only a problem for non-Cygwin versions of gdb. It >>> sounds like someone is using mingw-built versions of gdb in a cygwin >>> pty session. >> >> Yes. Specifically, an attempt to run a MinGW GDB through the test >> suite using Cygwin expect. > >IMO, the ultimate solution is to run the testsuite with a small >netcat-like wrapper program that creates a console, redirects >the child's stdin/stdout/stderr to the console, and bridges data >between the cygwin pipes and the console. > > cygwin (io=tty/pipe) <-> [ pipe <-> console ] <-> gdb (io=console) > >The testsuite would then spawn "wrapper.exe gdb.exe ..." instead of >"gdb.exe". > >GDB would then see a regular console for stdin/stdout/stderr, and >work out of the box. PR15791 points at winpty, an open source >tool that from the description does that (and more). It'd be nice >if that path would be investigated. We had a somewhat heated debate in the cygwin list about using the techniques in winpty and eventually abandoned the idea because the way things like winpty create consoles is not foolproof. Since it relies on polling, it is theoretically possible to lose data. I'll bet that, in practice you'd never see any data loss, though. And, from that observation, you can see which side of the argument I was on. :-) cgf