This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH][TEST-CASE][DOC] Implementation of pipe to pass GDB's command output to the shell.
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Abhijit Halder <abhijit dot k dot halder at gmail dot com>
- Cc: gdb-patches at sourceware dot org, sergiodj at redhat dot com, jan dot kratochvil at redhat dot com, tromey at redhat dot com, pedro at codesourcery dot com
- Date: Fri, 26 Aug 2011 15:18:05 +0300
- Subject: Re: [PATCH][TEST-CASE][DOC] Implementation of pipe to pass GDB's command output to the shell.
- References: <CAOhZP9wvFrF3z8SHSjot7grMtrkGcwFzXh8Te=qaA=1P4eYuFw@mail.gmail.com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Fri, 26 Aug 2011 17:13:28 +0530
> From: Abhijit Halder <abhijit.k.halder@gmail.com>
> Cc: Eli Zaretskii <eliz@gnu.org>, Sergio Durigan Junior <sergiodj@redhat.com>,
> Jan Kratochvil <jan.kratochvil@redhat.com>, Tom Tromey <tromey@redhat.com>,
> Pedro Alves <pedro@codesourcery.com>
>
> I am creating this new thread as the earlier threads went very long.
> This patch contains code change, test-cases and documentation as well.
Thanks.
> +@node Output Redirection
> +@chapter Redirecting @value{GDBN}'s Command Output to the Shell
I'd rather not make this a new chapter. I think a subsection of the
Input/Output node is a much better place.
> +@value{GDBN}'s command output can be redirected to the shell using @code{pipe}
^^^^^^^^^^^^
"to a shell command", I think.
> Even if the environment variable
> +@code{SHELL} is set, the default shell (@file{/bin/sh} on Unix systems,
> +@file{COMMAND.COM} on MS-DOS, etc.) is used.
This might be seen by some as a
> The @code{pipe} command expects
> +in its argument a delimiter string (without having any whitespace), followed by
> +a @value{GDBN} command, followed by the same delimiter string and finally a
> +shell command. The delimiter should not contain any leading `-'.
> +
> +@smallexample
> +(@value{GDBP}) @b{pipe | thread apply all bt | cat >./analyze_threads.log}
> +@end smallexample
Please explain which part is the "delimiter" here. Since you are
using the "normal" shell pipe character `|', the above explanation
about the delimiter string will raise a few brows. A word about why
you need something beyond the usual `|' would also be nice.
In addition, I think we should explain which parts of the command are
passed to the shell verbatim and which parts are processed by GDB. If
the last part ("cat >./analyze_threads.log") is passed to the shell,
then it must use the shell syntax (e.g., backslashes on MS-DOS/Windows).
Finally, can we have a more useful example than just redirecting the
output to a file? Such redirection can be achieved without this
command at all.
Please also remove the @b markup, it is not used anywhere in the
examples we have in the manual.
> +* New command "pipe" has been added to make GDB command output available to the
> + shell for processing.
"available to shell commands"