Re: [PATCH] An implementation of pipe to make I/O communication between gdb and shell. [MinGW question]

Jan Kratochvil
2011-08-14T17:02:11Z

On Sun, 14 Aug 2011 16:08:32 +0200, Eli Zaretskii wrote:
> Where's the issue about which you need MinGW advice?

http://sourceware.org/ml/gdb-patches/2011-08/msg00278.html
On Sat, 13 Aug 2011 22:50:54 +0200, Jan Kratochvil wrote:
# On Tue, 09 Aug 2011 12:42:25 +0200, Abhijit Halder wrote:
# > + = pex_run (pipe->pex,
# > + PEX_SEARCH | PEX_LAST | PEX_STDERR_TO_STDOUT,
#
# Why PEX_STDERR_TO_STDOUT? I am not so much against it but I do not see
# a reason for it.
#
#
# > + argv[0], argv,
#
# It does not work in one of the intended modes:
# (gdb) pipe | print 1 | cat >/dev/null
# cat: >/dev/null: No such file or directory
#
# You do not have to parse ARGV yourself, one can just run "/bin/sh", "-c",
# COMMAND, NULL (sure no PEX_SEARCH needed then).

> What exactly might not work?

Abhijit Halder has suggested the suggested
const char *argv[] = { "sh", "-c", "cat >/dev/null", NULL };
pex_run (pipe->pex, PEX_LAST, "/bin/sh", argv, NULL, NULL, &status);
works on UNIX but it will probably not work on MinGW as there is no "/bin/sh",
is it?

The current implementation:
const char *argv[] = { "cat", ">/dev/null", NULL };
pex_run (pipe->pex, PEX_SEARCH | PEX_LAST, "cat", argv, NULL, NULL, &status);
produces that - therefore not working on UNIX:
cat: >/dev/null: No such file or directory

Thanks,
Jan