From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22338 invoked by alias); 12 Apr 2007 16:29:36 -0000 Received: (qmail 22330 invoked by uid 22791); 12 Apr 2007 16:29:36 -0000 X-Spam-Check-By: sourceware.org Received: from nile.gnat.com (HELO nile.gnat.com) (205.232.38.5) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 12 Apr 2007 17:29:28 +0100 Received: from localhost (localhost [127.0.0.1]) by filtered-nile.gnat.com (Postfix) with ESMTP id CEE9F48CF9E for ; Thu, 12 Apr 2007 12:29:26 -0400 (EDT) Received: from nile.gnat.com ([127.0.0.1]) by localhost (nile.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 01717-01-6 for ; Thu, 12 Apr 2007 12:29:26 -0400 (EDT) Received: from joel.gnat.com (dhcp-guest.act-europe.fr [212.157.227.127]) by nile.gnat.com (Postfix) with ESMTP id 17E2448CF7D for ; Thu, 12 Apr 2007 12:29:26 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id C3FE1E7B4C; Thu, 12 Apr 2007 18:31:13 +0200 (CEST) Date: Thu, 12 Apr 2007 16:29:00 -0000 From: Joel Brobecker To: gdb@sourceware.org Subject: Re: [mingw32] stdin redirection Message-ID: <20070412163113.GK3886@adacore.com> References: <20070411134219.GA33609@adacore.com> <20070411144451.GA21140@caradoc.them.org> <20070411145104.GE58502@adacore.com> <20070411151234.GA22185@caradoc.them.org> <20070412145818.GG3886@adacore.com> <20070412151221.GA856@caradoc.them.org> <20070412155253.GH3886@adacore.com> <20070412160356.GA15004@caradoc.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070412160356.GA15004@caradoc.them.org> User-Agent: Mutt/1.4.2.2i Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-04/txt/msg00079.txt.bz2 > If it helps, I believe that when I was testing that code I had an ssh > session open from a Linux desktop to my Cygwin system using Cygwin > sshd, and was running GDB in there. That definitely triggers the pipe > case. That's what I'm doing too. Here are the results of some experiments. This is with GDB 6.6 but I believe everything should be relevant. Here are the results of the testing: Unmodified debugger: 1. Interactive mode: fd_is_pipe returns 1 Works. 2. File handle ("gdb < cmds"): fd_is_pipe return 0 Hangs 3. Pipe handle ("cat cmds | gdb"): fd_is_pipe return 1 Works, except that I suspect that the EOF is detected as an exception condition: (gdb) Exception condition detected on fd 0 error detected on stdin Modified debugger (always return 0 in fd_is_pipe): Works in all 3 cases. I tried: % (echo "pwd"; sleep 10; echo "pwd") | ./gdb That worked as well. This confirms your own experience that any failure is not immediately obvious... > Of course the console will be a little wonky because of buffering. Based on one of your recommendation, I modified our sources a while ago to fix the flushing so that the output would not be garbled. I offered to post a patch, but noone reacted. I'm reiterating the offer today... -- Joel