This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH]Fix that GDB will get hang on Windows when using pipe to get stdout and stderr from stub
- From: Sergio Durigan Junior <sergiodj at redhat dot com>
- To: "Terry Guo" <terry dot guo at arm dot com>
- Cc: "Eli Zaretskii" <eliz at gnu dot org>, <gdb-patches at sourceware dot org>
- Date: Mon, 16 Jul 2012 22:28:22 -0300
- 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>
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 <sys/time.h>
> #ifdef USE_WIN32API
> #include <winsock2.h>
> @@ -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