From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31375 invoked by alias); 17 Feb 2007 07:50:28 -0000 Received: (qmail 31357 invoked by uid 22791); 17 Feb 2007 07:50:27 -0000 X-Spam-Check-By: sourceware.org Received: from zigzag.lvk.cs.msu.su (HELO zigzag.lvk.cs.msu.su) (158.250.17.23) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 17 Feb 2007 07:50:22 +0000 Received: from Debian-exim by zigzag.lvk.cs.msu.su with spam-scanned (Exim 4.50) id 1HIKKl-0007iN-4r for gdb-patches@sources.redhat.com; Sat, 17 Feb 2007 10:50:20 +0300 Received: from localhost ([127.0.0.1] helo=ip6-localhost) by zigzag.lvk.cs.msu.su with esmtp (Exim 4.50) id 1HIKKY-0007ht-ID; Sat, 17 Feb 2007 10:50:02 +0300 From: Vladimir Prus Subject: Re: "target remote | " stderr To: Mark Kettenis , gdb-patches@sources.redhat.com Date: Sat, 17 Feb 2007 07:50:00 -0000 References: <200701261653.53834.vladimir@codesourcery.com> <20070126140028.GA29456@nevyn.them.org> <20070131144101.GA23780@nevyn.them.org> <200702111809.l1BI9cM8023458@brahms.sibelius.xs4all.nl> User-Agent: KNode/0.10.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit Message-Id: 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-02/txt/msg00214.txt.bz2 Mark Kettenis wrote: >> From: Vladimir Prus >> Date: Sun, 11 Feb 2007 19:55:03 +0300 >> >> Daniel Jacobowitz wrote: >> >> > On Wed, Jan 31, 2007 at 05:34:21PM +0300, Vladimir Prus wrote: >> >> Implementing for MinGW required modifying libiberty so that >> >> it can catch stderr to a pipe. Here's a patch for gdb that >> >> relies on the libiberty patch. Does this sound OK >> >> provided libiberty patch is approved? >> > >> > Do we automatically get a non-blocking pipe on mingw, or do we have to >> > set it ourselves? >> >> We have to set it ourself, unfortunately. I had one test case working >> fine, but got gdb hanging on some other. >> >> The attached patch works around the blocking issues, and more extensively >> tested. OK? > > Please keep Windows-specific code out of ser-base.c. Is read() on > MinGW fully blocking? Or will it return whatever is available and > only block if nothing is available. Documentation for ReadFile suggests that it will block until the requested number of bytes is available. > Then you could use gdb_select() > to check whether input is available on the pipe. How the possibility of using gdb_select() depends on read() being fully blocking or not? I think I miss some connection here. > Otherwise, you should think about introducing an asbtraction layer for > reading from error_fd. Is it indeed worthwhile to introduce abstraction layer to hide 5 lines of code? - Volodya