From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21760 invoked by alias); 5 Dec 2007 22:56:04 -0000 Received: (qmail 21749 invoked by uid 22791); 5 Dec 2007 22:56:04 -0000 X-Spam-Check-By: sourceware.org Received: from nf-out-0910.google.com (HELO nf-out-0910.google.com) (64.233.182.186) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 05 Dec 2007 22:55:56 +0000 Received: by nf-out-0910.google.com with SMTP id b11so3382015nfh for ; Wed, 05 Dec 2007 14:55:54 -0800 (PST) Received: by 10.78.172.20 with SMTP id u20mr1444956hue.1196895353642; Wed, 05 Dec 2007 14:55:53 -0800 (PST) Received: from ?88.210.66.24? ( [88.210.66.24]) by mx.google.com with ESMTPS id i7sm247609nfh.2007.12.05.14.55.51 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 05 Dec 2007 14:55:53 -0800 (PST) Message-ID: <47572C79.5060103@portugalmail.pt> Date: Wed, 05 Dec 2007 22:56:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-BR; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.0 MIME-Version: 1.0 To: Pierre Muller CC: gdb-patches@sourceware.org Subject: Re: [RFC] gdb/testsuite/gdb.base/fileio.exp patch for cygwin References: <000101c83593$89c0fcd0$9d42f670$@u-strasbg.fr> <4755E78F.7000301@portugalmail.pt> <001501c8371a$0a58faa0$1f0aefe0$@u-strasbg.fr> In-Reply-To: <001501c8371a$0a58faa0$1f0aefe0$@u-strasbg.fr> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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/msg00096.txt.bz2 Pierre Muller wrote: > 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. Blurfh. I first tried doing a make check with the patch I attached on my previous message, and with a hacked fileio.c to see what gdb and the inferior stdin/out/err streams were. The result is something like: (output a bit different from the previous patch to make it clearer what is what) make check RUNTESTFLAGS="--target_board=cygwin fileio.exp" (...) spawn /cygdrive/d/cegccsf/cegcc/cegcc/src/build-gdb_server_cygwin_submit/gdb/testsuite/../../gdb/gdb -nw -nx gdb: isatty (0) = 1, ttyname (0) = /dev/tty1 gdb: isatty (1) = 1, ttyname (1) = /dev/tty1 gdb: isatty (2) = 1, ttyname (2) = /dev/tty1 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) run Starting program: /cygdrive/d/cegccsf/cegcc/cegcc/src/build-gdb_server_cygwin_submit/gdb/testsuite/gdb.base/fileio.exe Breakpoint 1, main () at ../../../gdb-server_submit/src/gdb/testsuite/gdb.base/fileio.c:546 546 for (i = 0; i < 3; i++) (gdb) break stop Breakpoint 2: file ../../../gdb-server_submit/src/gdb/testsuite/gdb.base/fileio.c, line 71. (gdb) continue Continuing. inf: isatty (0) = 0, ttyname (0) = (null) inf: isatty (1) = 0, ttyname (1) = (null) inf: isatty (2) = 0, ttyname (2) = (null) Seeing this, I tried the example standalone/non-dejagnu test I posted, but with CYGWIN=tty, which produces the exact same results dejagnu sees. I then removed 'tty' from CYGWIN, but failed to restart every cygwin process, which made me fail to see what you saw. Which shows: >gdb ./main.exe gdb: isatty (0) = 1, ttyname (0) = /dev/console gdb: isatty (1) = 1, ttyname (1) = /dev/console gdb: isatty (2) = 1, ttyname (2) = /dev/console 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 inf: isatty (0) = 1, ttyname (0) = /dev/console inf: isatty (1) = 1, ttyname (1) = /dev/console inf: isatty (2) = 1, ttyname (2) = /dev/console Program exited normally. (gdb) Which is the behaviour I was expecting: "I don't know enough of the Cygwin tty support, but I would expect that if gdb had a (Windows) console attached (bash started from cmd.exe, not the xterm or rxvt), the inferior would inherit it, and the runtime would arrange for the isatty to be true, but that doesn't seem to hold." Sorry for the confusion. So, the excelent description Corinna posted applies to the dejagnu case here. -- Pedro Alves