From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19722 invoked by alias); 30 Aug 2011 18:07:38 -0000 Received: (qmail 19713 invoked by uid 22791); 30 Aug 2011 18:07:37 -0000 X-SWARE-Spam-Status: No, hits=-1.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout22.012.net.il (HELO mtaout22.012.net.il) (80.179.55.172) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 30 Aug 2011 18:07:19 +0000 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0LQR008005OFA500@a-mtaout22.012.net.il> for gdb-patches@sourceware.org; Tue, 30 Aug 2011 21:06:45 +0300 (IDT) Received: from HOME-C4E4A596F7 ([84.229.83.44]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LQR008CN6B5A140@a-mtaout22.012.net.il>; Tue, 30 Aug 2011 21:06:43 +0300 (IDT) Date: Tue, 30 Aug 2011 18:07: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: pedro@codesourcery.com, gdb-patches@sourceware.org, sergiodj@redhat.com, jan.kratochvil@redhat.com, tromey@redhat.com Reply-to: Eli Zaretskii Message-id: <83y5yaepu4.fsf@gnu.org> References: <201108301527.22683.pedro@codesourcery.com> 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/msg00622.txt.bz2 > Date: Tue, 30 Aug 2011 22:08:22 +0530 > From: Abhijit Halder > Cc: Eli Zaretskii , gdb-patches@sourceware.org, sergiodj@redhat.com, > jan.kratochvil@redhat.com, tromey@redhat.com > > + * gdb.texinfo (pipe command): New node. You didn't write a new node, you just added text to the existing node. So you should state the name of that node in the parentheses. > +If you want to process the output of a @value{GDBN} command using some shell > +command or some script, that can be done by using the command @code{pipe}. You > +don't even need to get a shell for that. The same could be achieved by > +enabling logging and redirecting the output of @value{GDBN} command to some > +file and then processing the file content by invoking a shell using > +@code{shell} command. But this incurs higher costs as the explicit invokation > +of shell involves execution of its startup scripts and locating the file > +containing @value{GDBN}'s command output involves directory lookup; even though > +OS may optimize these processes by its cache mechanism. I would drop this part, and leave only the first sentence. We don't need to justify commands in the manual. > +@table @code > +@item pipe @var{dlim} @var{gdbcmd} @var{dlim} @var{shellcmd} You need a "@kindex pipe" here, to index this command as we do with all other commands. > +@var{dlim} is a string of arbitrary length, containing no whitespace and no > +leading '-', acts as a separator between a @value{GDBN} command @var{gdbcmd} ^^^ @samp{-} > +In the above example @samp{@var{
}} acts as a delimiter. The output of Just @samp{
}, without @var. > +@samp{print dd_tbl} is passed to the shell command @samp{sed 's/@}/\n/g' | @ > +grep ".test_dd" | tr ',' '\n'} for processing. I would suggest to add that the example does not use `|' as a delimiter to allow the shell command to use it in its usual shell semantics. > +In the given example the output of @value{GDBN} command is huge and not well > +formated. The use of shell commands like ``sed'', ``tr'' and ``grep'' ease Please use @command{sed}, @command{tr}, etc. Thanks.