Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Sergio Durigan Junior <sergiodj@redhat.com>
To: Abhijit Halder <abhijit.k.halder@gmail.com>
Cc: "gdb-patches\@sourceware.org ml" <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Implementation of pipe to pass GDB's command output to the shell.
Date: Sat, 07 Jan 2012 18:19:00 -0000	[thread overview]
Message-ID: <m3d3avgytx.fsf@redhat.com> (raw)
In-Reply-To: <CAOhZP9ztj5wEyxH6qs-vMAdwtv=qgnH789+hm0CfrcdWfMDY7w@mail.gmail.com>	(Abhijit Halder's message of "Fri, 6 Jan 2012 23:41:10 +0530")

Hey Abhijit,

Thanks for keep trying to push this upstream.  Only a few comments.

Abhijit Halder <abhijit.k.halder@gmail.com> 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.


  reply	other threads:[~2012-01-07 18:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-03 17:04 Abhijit Halder
2012-01-06 18:11 ` Abhijit Halder
2012-01-07 18:19   ` Sergio Durigan Junior [this message]
2012-01-08  6:57     ` Abhijit Halder
2012-01-08  7:17       ` Sergio Durigan Junior
2012-01-08  7:27         ` Abhijit Halder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3d3avgytx.fsf@redhat.com \
    --to=sergiodj@redhat.com \
    --cc=abhijit.k.halder@gmail.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox