From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22851 invoked by alias); 12 Jul 2011 04:24:33 -0000 Received: (qmail 22840 invoked by uid 22791); 12 Jul 2011 04:24:31 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-ey0-f169.google.com (HELO mail-ey0-f169.google.com) (209.85.215.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 12 Jul 2011 04:24:17 +0000 Received: by eyd9 with SMTP id 9so1728984eyd.0 for ; Mon, 11 Jul 2011 21:24:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.213.27.143 with SMTP id i15mr1801550ebc.38.1310444655803; Mon, 11 Jul 2011 21:24:15 -0700 (PDT) Received: by 10.213.4.207 with HTTP; Mon, 11 Jul 2011 21:24:15 -0700 (PDT) In-Reply-To: References: Date: Tue, 12 Jul 2011 07:15:00 -0000 Message-ID: Subject: Re: PATCH From: Abhijit Halder To: Tom Tromey Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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-07/txt/msg00296.txt.bz2 How if we just put a condition check whether the entered string after pipe (|) is numeric. For e.g. (gdb) thread apply all bt | grep foobar Here the entered string after | is grep foobar which is not numeric. But here (gdb) print var | 0x50 is numeric. We may safely use this above notion as in case of any numeric file name can be encapsulated within quote. Soon I will submit the updated patch. Please provide feedback on this. On Tue, Jul 12, 2011 at 5:01 AM, Abhijit Halder wrote: > Yes I missed it. Let me modify the implementation to achieve the goal. > > On Tue, Jul 12, 2011 at 1:17 AM, Tom Tromey wrote: >>>>>>> "Abhijit" =3D=3D Abhijit Halder writes: >> >> Abhijit> There is no way to pass the output of a gdb command to a shell >> Abhijit> command. For example, something similar is not permitted: "(gdb) >> Abhijit> thread apply all bt | vim -". This kind of feature is quite hel= pful in >> Abhijit> a scenario where a program under debugger has 100s of threads r= unning >> Abhijit> and one wants to search a particular pattern in stack-traces. I= have >> Abhijit> implemented a feature which will allow one to pass the output o= f any >> Abhijit> gdb command to any shell command. >> >> It would be nice to be able to do something like this. >> >> Abhijit> 2011-07-09 Abhijit Halder >> Abhijit> =A0 =A0 * top.c (execute_command_to_pipe): New function. >> Abhijit> =A0 =A0 =A0(execute_command): Update. >> >> I don't think this implementation is the right approach. >> It does the wrong thing with some existing valid commands, e.g. "print x= |5". >> >> Tom >> >