From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25759 invoked by alias); 7 Jan 2012 18:19:53 -0000 Received: (qmail 25751 invoked by uid 22791); 7 Jan 2012 18:19:52 -0000 X-SWARE-Spam-Status: No, hits=-6.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 07 Jan 2012 18:19:28 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q07IJRtu007090 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 7 Jan 2012 13:19:27 -0500 Received: from psique ([10.3.112.15]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q07IJN8Y018260; Sat, 7 Jan 2012 13:19:25 -0500 From: Sergio Durigan Junior To: Abhijit Halder Cc: "gdb-patches\@sourceware.org ml" Subject: Re: [PATCH] Implementation of pipe to pass GDB's command output to the shell. References: Date: Sat, 07 Jan 2012 18:19:00 -0000 In-Reply-To: (Abhijit Halder's message of "Fri, 6 Jan 2012 23:41:10 +0530") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2012-01/txt/msg00256.txt.bz2 Hey Abhijit, Thanks for keep trying to push this upstream. Only a few comments. Abhijit Halder writes: > +#if defined (__MINGW32__) > +# define DEFAULT_SHELL "cmd.exe" > +# define OPTION_TO_SHELL "/c" > +#else > +# define DEFAULT_SHELL "/bin/sh" > +# define OPTION_TO_SHELL "-c" > +#endif As far as I have researched, all bash-compatible shells accept `-c' as a parameter, and all of them interpret this parameter in the same way (i.e., "execute this command"). However, and I am not sure this is something we should worry about or not, there might be other shells around which do not support `-c', or expect something else. I don't know if a check is worthwhile in this case. > +/* Structure to encapsulate all entities associated with pipe. */ > + > +struct pipe_obj > +{ > + /* The delimiter to separate out gdb-command and shell-command. This can be > + any arbitrary string without containing any whitespace. There should not > + be any leading '-' in the delimiter. */ > + char *dlim; I believe this can be declared as const, right? Same thing for `gdb_cmd' below. Unfortunately, `shell_cmd' cannot be declared const for now because is is using `skip_spaces', which does not accept a `const char *' as argument. Otherwise, the patch looks good to me.