This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 0/4] Implement | (pipe) command.
Hello Abhijit,
Yes, the fact that the command line interface of GDB has
no 'formal grammar' is sometimes making things difficult.
In this case, I thought it was not particularly important
to support | characters in the gdb command, but I might be wrong.
If we want to handle this case, then I would prefer
to have an optional argument: e.g. pipe [-dX] ... would indicate
to use the character X as delimiter between the GDB command
and the shell command.
This syntax is lightweight, and still allows by default to
re-run the previous command with
|| some_shell_command
In any case, I agree that either such case should be properly
handled e.g. with [-dX] or at least the limitation should
be documented in the user manual.
Thanks for the feedback,
Philippe
On Tue, 2019-04-23 at 02:14 +0530, Abhijit Halder wrote:
> Hi Philippe,
>
> If I see it correctly, the syntax of the command is
> pipe <gdb command> | <shell command>
> If the gdb command contains '|' the above syntax will be a problem.
> I suggest below syntax
> pipe <delimiter> <gdb command> <delimiter> <shell command>
> Here the advantage is the delimiter can be anything and conveniently be chosen by the user.
>
> I made a similar attempt few years back.
> https://sourceware.org/ml/gdb-patches/2012-01/msg00098.html
>
> This you can take this as a reference.
>
> Thanks,
> Abhijit Halder
>
>
>
> On Sun, Apr 21, 2019 at 2:52 AM Philippe Waroquiers <philippe.waroquiers@skynet.be> wrote:
> > This patch series adds the pipe command, that allows to send the output
> > of a GDB command to a shell command.
> >
> > The first patch allows a command to repeat a previous command.
> > Currently only used by the pipe command added in this series, but
> > the idea is that the slash command will also use this feature to
> > repeat a previous command.
> >
> >
> >