From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17191 invoked by alias); 5 Aug 2011 15:05:58 -0000 Received: (qmail 17177 invoked by uid 22791); 5 Aug 2011 15:05:57 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-ew0-f41.google.com (HELO mail-ew0-f41.google.com) (209.85.215.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 05 Aug 2011 15:05:41 +0000 Received: by ewy9 with SMTP id 9so1729132ewy.0 for ; Fri, 05 Aug 2011 08:05:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.140.23 with SMTP id g23mr709743bku.40.1312556740116; Fri, 05 Aug 2011 08:05:40 -0700 (PDT) Received: by 10.204.15.23 with HTTP; Fri, 5 Aug 2011 08:05:40 -0700 (PDT) In-Reply-To: References: <201108041029.37721.pedro@codesourcery.com> Date: Fri, 05 Aug 2011 15:05:00 -0000 Message-ID: Subject: Re: [PATCH] An implementation of pipe to make I/O communication between gdb and shell. From: Abhijit Halder To: Tom Tromey Cc: Pedro Alves , gdb-patches@sourceware.org, Sergio Durigan Junior , Jan Kratochvil Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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/msg00112.txt.bz2 Has pexecute deprecated by any chance? There is a comment in the code advising not to use this function in new code. Further, pexecute does not provide similar functionality. It just executes a program and returns the status of the program, not provide the text output from the program it executes. Is it a good idea to write a function (say, gdb_popen) as below: FILE * gdb_popen (const char *cmd, const char *mode) { #ifdef _WIN32 return _popen (cmd, mode); #else return popen (cmd, mode); } On Thu, Aug 4, 2011 at 7:51 PM, Tom Tromey wrote: >>>>>> "Pedro" =3D=3D Pedro Alves writes: > > I haven't really read this thread yet, but I wanted to chime in... > >>> + =A0 =A0 =A0pipe->handle =3D popen (pipe->shell_cmd, pipe->mode); > > Pedro> I'm not sure that'll build on all supported hosts. > Pedro> I think on Windows that may require use of _popen instead. > > libiberty has the already-portable 'pexecute' code for this kind of > thing. > > Tom >