From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3088 invoked by alias); 14 Aug 2011 19:42:20 -0000 Received: (qmail 3075 invoked by uid 22791); 14 Aug 2011 19:42:19 -0000 X-SWARE-Spam-Status: No, hits=-0.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout22.012.net.il (HELO mtaout22.012.net.il) (80.179.55.172) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 14 Aug 2011 19:42:04 +0000 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0LPX00D00O1NO600@a-mtaout22.012.net.il> for gdb-patches@sourceware.org; Sun, 14 Aug 2011 22:41:59 +0300 (IDT) Received: from HOME-C4E4A596F7 ([77.124.97.107]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LPX00A61O1XUW61@a-mtaout22.012.net.il>; Sun, 14 Aug 2011 22:41:59 +0300 (IDT) Date: Sun, 14 Aug 2011 19:42:00 -0000 From: Eli Zaretskii Subject: Re: [PATCH] An implementation of pipe to make I/O communication between gdb and shell. [MinGW question] In-reply-to: <20110814170136.GA26819@host1.jankratochvil.net> To: Jan Kratochvil Cc: abhijit.k.halder@gmail.com, sergiodj@redhat.com, tromey@redhat.com, pedro@codesourcery.com, gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <83sjp3vkze.fsf@gnu.org> References: <20110813205053.GB22058@host1.jankratochvil.net> <20110814121407.GA29236@host1.jankratochvil.net> <83y5ywulun.fsf@gnu.org> <20110814170136.GA26819@host1.jankratochvil.net> 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: 2011-08/txt/msg00293.txt.bz2 > Date: Sun, 14 Aug 2011 19:01:36 +0200 > From: Jan Kratochvil > Cc: abhijit.k.halder@gmail.com, sergiodj@redhat.com, tromey@redhat.com, > pedro@codesourcery.com, gdb-patches@sourceware.org > > > 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 file name of the shell, the "-c" switch, and the null device should all be system-dependent. For MinGW, they should be, respectively, "cmd.exe", "/c", and "nul". > 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 How hard is it to parse the redirection characters?