From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17650 invoked by alias); 26 Aug 2011 12:18:33 -0000 Received: (qmail 17637 invoked by uid 22791); 26 Aug 2011 12:18:30 -0000 X-SWARE-Spam-Status: No, hits=-0.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_WEB,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout23.012.net.il (HELO mtaout23.012.net.il) (80.179.55.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 26 Aug 2011 12:18:16 +0000 Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0LQJ00900BCFS200@a-mtaout23.012.net.il> for gdb-patches@sourceware.org; Fri, 26 Aug 2011 15:18:02 +0300 (IDT) Received: from HOME-C4E4A596F7 ([84.228.21.112]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LQJ009VNBHZR330@a-mtaout23.012.net.il>; Fri, 26 Aug 2011 15:18:02 +0300 (IDT) Date: Fri, 26 Aug 2011 12:18:00 -0000 From: Eli Zaretskii Subject: Re: [PATCH][TEST-CASE][DOC] Implementation of pipe to pass GDB's command output to the shell. In-reply-to: To: Abhijit Halder Cc: gdb-patches@sourceware.org, sergiodj@redhat.com, jan.kratochvil@redhat.com, tromey@redhat.com, pedro@codesourcery.com Reply-to: Eli Zaretskii Message-id: <83pqjsfjsy.fsf@gnu.org> References: 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/msg00488.txt.bz2 > Date: Fri, 26 Aug 2011 17:13:28 +0530 > From: Abhijit Halder > Cc: Eli Zaretskii , Sergio Durigan Junior , > Jan Kratochvil , Tom Tromey , > Pedro Alves > > 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"