From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29804 invoked by alias); 15 Aug 2013 17:59:47 -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 29785 invoked by uid 89); 15 Aug 2013 17:59:47 -0000 X-Spam-SWARE-Status: No, score=-50.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE autolearn=ham version=3.3.2 Received: from mho-02-ewr.mailhop.org (HELO mho-02-ewr.mailhop.org) (204.13.248.72) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 15 Aug 2013 17:59:46 +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 1VA1pm-000Mqj-58; Thu, 15 Aug 2013 17:59:42 +0000 Received: from localhost (ednor.casa.cgf.cx [192.168.187.5]) by cgf.cx (Postfix) with ESMTP id 5FA5B60117; Thu, 15 Aug 2013 13:59:40 -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: U2FsdGVkX18PKvWCZtnu0Xo2FwhO43/s Date: Thu, 15 Aug 2013 17:59:00 -0000 From: Christopher Faylor To: palves@redhat.com, gdb-patches@sourceware.org, brobecker@adacore.com, yao@codesourcery.com, Eli Zaretskii Subject: Re: [PATCH] Unbuffer stdout and stderr on windows Message-ID: <20130815175940.GD6955@ednor.casa.cgf.cx> Mail-Followup-To: palves@redhat.com, gdb-patches@sourceware.org, brobecker@adacore.com, yao@codesourcery.com, Eli Zaretskii References: <51EE23F8.1070905@codesourcery.com> <83wqohw4ee.fsf@gnu.org> <20130729192559.GA5348@ednor.casa.cgf.cx> <83d2q1xiyv.fsf@gnu.org> <51F6C7B2.3020400@redhat.com> <20130731034045.GA5565@ednor.casa.cgf.cx> <20130812211105.GA11128@adacore.com> <8361v9piop.fsf@gnu.org> <20130815173618.GA6955@ednor.casa.cgf.cx> <83eh9uonlg.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83eh9uonlg.fsf@gnu.org> User-Agent: Mutt/1.5.20 (2009-06-14) X-SW-Source: 2013-08/txt/msg00404.txt.bz2 On Thu, Aug 15, 2013 at 08:44:43PM +0300, Eli Zaretskii wrote: >On Thu, 15 Aug 2013 13:36:18 -0400, Christopher Faylor wrote: >>I thought that "unbuffered" normally means something like "every output >>operation gets immediately sent as a block" rather than "flush after >>every character". > >AFAIK, unbuffered always meant the latter. > >>If the mingw "unbuffered" mode means that everything is o n e c h a r a >>c t e r a t a t i m e > >It does mean that. Doesn't it work like that in Cygwin? Cygwin uses newlib which, AFAICT, writes a block at a time without storing the block in a buffer first. So: fwrite (foo, 27, 1, stdout); writes 27 bytes to stdout in one shot, without buffering. I only got this from looking at the code so I could be wrong. >>The other alternative would be to use line buffering for gdb. I don't >>see why cygwin pipes (whether they are "ptys" or actual pipes) are a >>special case here. stdout is usually line buffered isn't it? Why not >>just force that behavior for gdb? > >That's what I suggested, but Yao says that using line buffering still >fails some tests. Sorry, I missed that you'd already suggested that. cgf