From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19172 invoked by alias); 15 Jul 2011 06:35:10 -0000 Received: (qmail 19162 invoked by uid 22791); 15 Jul 2011 06:35:08 -0000 X-SWARE-Spam-Status: No, hits=-2.2 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; Fri, 15 Jul 2011 06:34:50 +0000 Received: by eyd9 with SMTP id 9so599217eyd.0 for ; Thu, 14 Jul 2011 23:34:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.213.98.202 with SMTP id r10mr1110246ebn.86.1310711689265; Thu, 14 Jul 2011 23:34:49 -0700 (PDT) Received: by 10.213.3.70 with HTTP; Thu, 14 Jul 2011 23:34:49 -0700 (PDT) In-Reply-To: References: Date: Fri, 15 Jul 2011 14:15:00 -0000 Message-ID: Subject: Re: PATCH From: Abhijit Halder To: Mike Frysinger Cc: Tom Tromey , gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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-07/txt/msg00382.txt.bz2 Hi, I have made the changes to handle following cases. Should I re-submit the new patch in the same thread, or I change the subject line (as it does not reveal much the problem definition) and re-submit the patch in a new thread? On Wed, Jul 13, 2011 at 12:39 PM, Abhijit Halder wrote: > Just a quick thought. How if we can do something like this: > > (gdb) gdb_command_with_arguments | =A0"shell_command_with_argument" > > Since pipe (|) as c operator will never expect any rvalue within > string, we are safe. We just have to ensure that odd number of > double-quote (") not present before (left-side of) the pipe to > safe-guard a case like below. > > (gdb) p "Hi | Bye" > > Further, the shell command may itself contain double-quote. We have to > allow nested double-quote. > > (gdb) thread apply all bt | " grep "foobar" " > > > On Wed, Jul 13, 2011 at 2:00 AM, Mike Frysinger wrote: >> On Tue, Jul 12, 2011 at 15:25, Tom Tromey wrote: >>>>>>>> "Abhijit" =3D=3D Abhijit Halder writes: >>> Abhijit> How if we just put a condition check whether the entered strin= g after >>> Abhijit> pipe (|) is numeric. [...] >>> >>> I was too terse yesterday. =A0The big problem with any generic approach= is >>> that GDB syntax is free-form: each command defines its own syntax. =A0S= o, >>> for any syntax you think up, there is a decent chance that it already >>> means something to some command, or could. >>> >>> This doesn't mean it is impossible, just difficult. >> >> i was also pondering reversing the order. =A0rather than being a suffix >> that gets mucked up in syntax, add a pass through. =A0but that too can >> get ugly. >> >> pipe >> (gdb) pipe "vim -" thread apply all bt >> >>> We already have "set logging". =A0This isn't as convenient to use, but = it >>> could certainly be extended to allow pipes. >> >> when i thought of a secondary command, i think half the power of what >> Abhijit proposes is having it in a single command. =A0especially when >> shell scripting is all about slightly tweaking the command and looking >> at the result. =A0that way you dont keep flipping between the two -- one >> to update the command to pipe into, and two to update the stuff you're >> piping out. >> -mike >> >