From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12591 invoked by alias); 5 Dec 2007 08:37:35 -0000 Received: (qmail 12583 invoked by uid 22791); 5 Dec 2007 08:37:35 -0000 X-Spam-Check-By: sourceware.org Received: from ics.u-strasbg.fr (HELO ics.u-strasbg.fr) (130.79.112.250) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 05 Dec 2007 08:37:18 +0000 Received: from ICSMULLER (laocoon.u-strasbg.fr [130.79.112.72]) by ics.u-strasbg.fr (Postfix) with ESMTP id 7B63518701E; Wed, 5 Dec 2007 09:41:37 +0100 (CET) From: "Pierre Muller" To: "'Pedro Alves'" Cc: References: <000101c83593$89c0fcd0$9d42f670$@u-strasbg.fr> <4755E78F.7000301@portugalmail.pt> In-Reply-To: <4755E78F.7000301@portugalmail.pt> Subject: RE: [RFC] gdb/testsuite/gdb.base/fileio.exp patch for cygwin Date: Wed, 05 Dec 2007 09:22:00 -0000 Message-ID: <001501c8371a$0a58faa0$1f0aefe0$@u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Content-Language: en-us 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 X-SW-Source: 2007-12/txt/msg00077.txt.bz2 I am sorry, Pedro, but I am completely unable to reproduce your output. I always get '1' as a result for all the tests I tried running your application. I tried to compile the source as gcc -g -o main.exe main.c and in that case I got '1' for the three descriptors in all case: 1) run directly inside Cygwin bash 2) run directly from cd.exe prompt (with a cygwin1.dll in the path) 3) run inside current HEAD gdb 4) run inside Cygwin special gdb distributed by Cygwin setup program 5) run using gdb 6.3 for mingw32 If I add -mno-cygwin, I get '64' as a result instead of '1' for all three descriptors, but then again running the executable directly or within any of the gdb mentioned above gives always '64'. > -----Original Message----- > From: gdb-patches-owner@sourceware.org [mailto:gdb-patches- > owner@sourceware.org] On Behalf Of Pedro Alves > Sent: Wednesday, December 05, 2007 12:50 AM > To: Pierre Muller > Cc: gdb-patches@sourceware.org > Subject: Re: [RFC] gdb/testsuite/gdb.base/fileio.exp patch for cygwin > > Pierre Muller wrote: > > I tried to expose some cygwin testsuite problems related to the fact > > that dejagnu does not seem to be able to fool the cygwin system, to > > get it to believe that the output is not redirected. > > > > http://sourceware.org/ml/gdb/2007-11/msg00273.html > > > > The main effect is that, Cygwin knowing that the output is > > redirected to a non-tty, it will start to use file buffering that > will > > interact badly with the expectation of the gdb testsuite. > > > > I don't think that dejagnu is to blame here, and > I believe the individual testfiles are the wrong place > to fix this. You can easily reproduce the symptoms > in any run. Try this with the attached patch: > > #include > #include > > int main () > { > printf ("isatty 0 = %d\n", isatty (0)); > printf ("isatty 1 = %d\n", isatty (1)); > printf ("isatty 2 = %d\n", isatty (2)); > return 0; > } How did you compile that source exactly? > -------------------- > > Cygwin host: > > >./main.exe > isatty 0 = 1 > isatty 1 = 1 > isatty 2 = 1 Is this a cmd.exe prompt? > >gdb main.exe > isatty (0) = 1 > isatty (1) = 1 > isatty (2) = 1 > ttyname (0) = /dev/tty2 > ttyname (1) = /dev/tty2 > ttyname (2) = /dev/tty2 From where is this coming from? > GNU gdb 6.7.50.20071201-cvs > Copyright (C) 2007 Free Software Foundation, Inc. > License GPLv3+: GNU GPL version 3 or later > > This is free software: you are free to change and redistribute it. > There is NO WARRANTY, to the extent permitted by law. Type "show > copying" > and "show warranty" for details. > This GDB was configured as "i686-pc-cygwin"... > (gdb) r > Starting program: /home/pedro/isatty/main.exe > isatty 0 = 0 > isatty 1 = 0 > isatty 2 = 0 As said above, I never get this... Pierre