From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29001 invoked by alias); 16 Aug 2013 15:13:15 -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 28991 invoked by uid 89); 16 Aug 2013 15:13:14 -0000 X-Spam-SWARE-Status: No, score=-4.1 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_NO,SPF_SOFTFAIL autolearn=no version=3.3.2 Received: from mtaout21.012.net.il (HELO mtaout21.012.net.il) (80.179.55.169) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 16 Aug 2013 15:13:14 +0000 Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0MRM00F00PXMPR00@a-mtaout21.012.net.il> for gdb-patches@sourceware.org; Fri, 16 Aug 2013 18:13:11 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MRM00FEXQ9YIRA0@a-mtaout21.012.net.il>; Fri, 16 Aug 2013 18:13:11 +0300 (IDT) Date: Fri, 16 Aug 2013 15:13:00 -0000 From: Eli Zaretskii Subject: Re: [PATCH] Unbuffer stdout and stderr on windows In-reply-to: <520E3F99.6090403@redhat.com> To: Pedro Alves Cc: gdb-patches@sourceware.org, brobecker@adacore.com, yao@codesourcery.com Reply-to: Eli Zaretskii Message-id: <83ioz5mzx3.fsf@gnu.org> 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> <20130815175940.GD6955@ednor.casa.cgf.cx> <520E1109.7000304@redhat.com> <83y581n5ag.fsf@gnu.org> <520E296C.8090906@redhat.com> <83siy9n44r.fsf@gnu.org> <520E339D.3020209@redhat.com> <83pptdn194.fsf@gnu.org> <520E3F99.6090403@redhat.com> X-SW-Source: 2013-08/txt/msg00439.txt.bz2 > Date: Fri, 16 Aug 2013 16:04:57 +0100 > From: Pedro Alves > CC: gdb-patches@sourceware.org, brobecker@adacore.com, yao@codesourcery.com > > Ack. I can't say I really agree with this rationale. The problem > exists, and hiding it under the rug won't make it go away. Actually > forcing it to happen more frequently should make it easier to > iron out all the kinks. IIUC, this is just a layer that > splits input into whole lines before passing it up to higher > levels, thus emulating line buffering. I'm failing to see why > that is heuristic, rather than something that works 100% of the > time, given that that sounds just like fgets. Because Emacs decodes text as soon as it receives it, to show it to users. It could delay a bit, but not too much, because users will complain. > So that actually supports my theory, and, my earlier suggestion > that if fully unbuffered is undesirable, then instead make sure to > always flush stdout before switching output to stderr, and vice > versa, so the order is preserved. I think this is a good solution, if indeed it solves the original problem.