This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] An implementation of pipe to make I/O communication between gdb and shell.
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Cc: Abhijit Halder <abhijit dot k dot halder at gmail dot com>, Sergio Durigan Junior <sergiodj at redhat dot com>, Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Date: Thu, 4 Aug 2011 10:29:37 +0100
- Subject: Re: [PATCH] An implementation of pipe to make I/O communication between gdb and shell.
- References: <CAOhZP9zU2K01zFDkChtutGT6yJjUeWYeGRNAAgPgM5rKwrgysg@mail.gmail.com> <m3vcuecrrf.fsf@redhat.com> <CAOhZP9yENHtgW4RSMMdnyvfPJ=yovDo_c5fG3KMC4-oa6NJBrw@mail.gmail.com>
On Thursday 04 August 2011 08:51:14, Abhijit Halder wrote:
> + fstream = gdb_modify_io (gdb_stdio, pstream);
> + execute_command (pipe->gdb_cmd, from_tty);
> + pstream = gdb_modify_io (gdb_stdio, fstream);
Looks like this leaves gdb_stdio in an inconsistent
state if execute_command throws an error.
Do you really need the new gdb_modify_io function?
Can't ui_out_redirect (and stdio_file_new perhaps) do the job?
> + pipe->handle = popen (pipe->shell_cmd, pipe->mode);
I'm not sure that'll build on all supported hosts.
I think on Windows that may require use of _popen instead.
"struct pipe_t" sounds like a recipe for system namespace
colision (and _t is reserved for posix, though we
have some precedent for abusing it), and is easily confused
with the ser*.c pipe machinery. Can you find an
alternative name for the struct please?
Perhaps struct pipe_cmd_state.
--
Pedro Alves