From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24302 invoked by alias); 17 Jul 2012 01:28:59 -0000 Received: (qmail 24294 invoked by uid 22791); 17 Jul 2012 01:28:58 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 17 Jul 2012 01:28:37 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6H1SQVZ009305 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 16 Jul 2012 21:28:27 -0400 Received: from psique (ovpn-113-52.phx2.redhat.com [10.3.113.52]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q6H1SNQf014385; Mon, 16 Jul 2012 21:28:24 -0400 From: Sergio Durigan Junior To: "Terry Guo" Cc: "Eli Zaretskii" , Subject: Re: [PATCH]Fix that GDB will get hang on Windows when using pipe to get stdout and stderr from stub References: <000001cd5338$ded61b20$9c825160$%guo@arm.com> <83hatw8zn1.fsf@gnu.org> <000301cd59bd$ce1c8900$6a559b00$%guo@arm.com> <000101cd5f22$2371cdc0$6a556940$%guo@arm.com> <83k3yab0x6.fsf@gnu.org> <000301cd5fcf$838d31b0$8aa79510$%guo@arm.com> <83ehohblor.fsf@gnu.org> <000001cd6317$2d714cd0$8853e670$@guo@arm.com> X-URL: http://www.redhat.com Date: Tue, 17 Jul 2012 01:28:00 -0000 In-Reply-To: <000001cd6317$2d714cd0$8853e670$@guo@arm.com> (Terry Guo's message of "Mon, 16 Jul 2012 13:52:23 +0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2012-07/txt/msg00227.txt.bz2 On Monday, July 16 2012, Terry Guo wrote: >> >> Thanks. These are all no-brainers, so I think the patch is still good >> to go in. > > Sorry to bother you again. I realized I haven't gdb write permission. Could > you please help me to commit it at your convenient time? The attachment is > the patch against the latest gdb trunk. Hello Terry, I only read the thread now, so sorry for coming with comments after Eli's approval. Anyway, it's just a small nit. > diff --git a/gdb/ser-base.c b/gdb/ser-base.c > index 2f12dfc..152b1aa 100644 > --- a/gdb/ser-base.c > +++ b/gdb/ser-base.c > @@ -25,6 +25,7 @@ > > #include "gdb_select.h" > #include "gdb_string.h" > +#include "gdb_assert.h" > #include > #ifdef USE_WIN32API > #include > @@ -242,6 +243,64 @@ ser_base_wait_for (struct serial *scb, int timeout) > } > } > > +/* Read any error output we might have. */ > + > +static void > +ser_base_read_error_fd (struct serial *scb, int close_fd) > +{ > + if (scb->error_fd != -1) > + { > + ssize_t s; > + char buf[GDB_MI_MSG_WIDTH + 1]; > + > + for (;;) > + { > + char *current; I notice you are not following the convention of converting 8 spaces to a TAB character here and everywhere else. Can you please fix it? After that, I can commit the patch for (if you don't have the permission yet). -- Sergio