From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24551 invoked by alias); 13 Jul 2011 07:09:37 -0000 Received: (qmail 24543 invoked by uid 22791); 13 Jul 2011 07:09:36 -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-ew0-f41.google.com (HELO mail-ew0-f41.google.com) (209.85.215.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 13 Jul 2011 07:09:20 +0000 Received: by ewy9 with SMTP id 9so2208451ewy.0 for ; Wed, 13 Jul 2011 00:09:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.213.107.15 with SMTP id z15mr282655ebo.114.1310540959494; Wed, 13 Jul 2011 00:09:19 -0700 (PDT) Received: by 10.213.4.207 with HTTP; Wed, 13 Jul 2011 00:09:19 -0700 (PDT) In-Reply-To: References: Date: Wed, 13 Jul 2011 08:45: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 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/msg00339.txt.bz2 Just a quick thought. How if we can do something like this: (gdb) gdb_command_with_arguments | "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 string= 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. =A0So, >> 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 >