From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25666 invoked by alias); 23 Jul 2013 06:35:31 -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 25640 invoked by uid 89); 23 Jul 2013 06:35:30 -0000 X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_50,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RDNS_NONE autolearn=no version=3.3.1 Received: from Unknown (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 23 Jul 2013 06:35:29 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1V1WBt-00039u-FX from Yao_Qi@mentor.com ; Mon, 22 Jul 2013 23:35:21 -0700 Received: from SVR-ORW-FEM-02.mgc.mentorg.com ([147.34.96.206]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 22 Jul 2013 23:35:21 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-02.mgc.mentorg.com (147.34.96.168) with Microsoft SMTP Server id 14.2.247.3; Mon, 22 Jul 2013 23:35:20 -0700 Message-ID: <51EE23F8.1070905@codesourcery.com> Date: Tue, 23 Jul 2013 06:35:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Eli Zaretskii CC: Subject: Re: [PATCH] Unbuffer stdout and stderr on windows References: <1374462417-7961-1-git-send-email-yao@codesourcery.com> <838v0yy556.fsf@gnu.org> In-Reply-To: <838v0yy556.fsf@gnu.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-SW-Source: 2013-07/txt/msg00523.txt.bz2 On 07/22/2013 11:40 PM, Eli Zaretskii wrote: > This is wrong, stdout should be line-buffered by default. > stdout is line-buffered if it can be detected to connect to an interactive device, otherwise it is fully buffered. Cygwin emulates pty with pipes, and native win32 apps blindly assume all pipes are non-interactive. > Also, this punishes batch mode with stdout redirected to a file: its > stdout buffering (and perhaps also that of stderr, although that's > less important) will now always be line-buffered, i.e. less efficient. Yeah, this patch hurts the performance, but gets the outputs in the correct order, so that testsuite can be run to get a reasonable test result. > > Is it possible to detect the "Cygwin ssh session", whatever that > means, and only do this then? I don't think it's right to change Unfortunately, I am unable to find a heuristics to tell "GDB is in cygwin session". There are some differences on env variables between cygwin and Windows cmd.exe console, but I am afraid that they are not reliable. > behavior of a native w32 GDB just because it misbehaves when mixed This patch is to change the buffered output to unbuffered, so the behaviour of GDB is not changed, IMO. > with Cygwin. Mixing native and Cygwin programs is asking for trouble > to begin with, so punishing good citizens on behalf of that corner > case is not TRT, IMO. We test mingw native gdb in cygwin, because it is easy to set up, so that mingw32 native gdb can be tested more widely. In the last resort, we may add an option "--cygwin-tty", which I don't really like. -- Yao (齐尧)