From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Mike Frysinger <vapier@gentoo.org>,
Tom Tromey <tromey@redhat.com>,
Abhijit Halder <abhijit.k.halder@gmail.com>
Subject: gdb output pipelining to shell (was: Re: PATCH)
Date: Thu, 21 Jul 2011 11:08:00 -0000 [thread overview]
Message-ID: <201107211122.15756.pedro@codesourcery.com> (raw)
In-Reply-To: <CAJaTeToAh4z=6sU3=z13hbMRi6n6tVM=wubqWHTsNbuK+Rw4iA@mail.gmail.com>
On Tuesday 12 July 2011 21:30:00, Mike Frysinger wrote:
> On Tue, Jul 12, 2011 at 15:25, Tom Tromey wrote:
> >>>>>> "Abhijit" == 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. The big problem with any generic approach is
> > that GDB syntax is free-form: each command defines its own syntax. So,
> > 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. rather than being a suffix
> that gets mucked up in syntax, add a pass through. but that too can
> get ugly.
>
> pipe <command to pipe into> <normal command> <command args>
> (gdb) pipe "vim -" thread apply all bt
Another option would be to still have a normal order pipe
command, and have the user specify the splitting character,
kind of like a grandchild of sed's s/// vs s,,, etc, and
cat EOF pattern. So, you'd have:
pipe SPLITTER_TOKEN
the usual | would work:
(gdb) pipe | bt | vim -
if necessary due to conflict, use a different token:
(gdb) pipe , p 1 | 2 , vim -
or:
(gdb) pipe PIPE p 1 | 2 PIPE vim -
etc.
WDYT?
I think I like this better than comming up with some
syntax that we need to make sure works not just with C,
but all supported languages. (and hope no future supported
language adds a conflict).
We can tweak the syntax a bit to support
options to the pipe command. E.g, define that
the pipe command always ends with a lone '-' before
the gdb command chain, and -t for pipe token, then:
No -t switch, assume `|' pipe token:
(gdb) pipe - bt | vim -
Specify alternate pipe token:
(gdb) pipe -t PIPE - p 1 | 2 PIPE vim -
Pass some other option to `pipe':
(gdb) pipe --some-option - bt | vim -
--
Pedro Alves
prev parent reply other threads:[~2011-07-21 10:22 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-09 13:09 PATCH Abhijit Halder
2011-07-09 19:06 ` PATCH oza Pawandeep
2011-07-11 12:13 ` PATCH Abhijit Halder
2011-07-11 13:42 ` PATCH Abhijit Halder
2011-07-10 7:47 ` PATCH Mike Frysinger
2011-07-11 21:10 ` PATCH Tom Tromey
2011-07-12 0:51 ` PATCH Abhijit Halder
2011-07-12 7:15 ` PATCH Abhijit Halder
2011-07-12 8:34 ` PATCH Mike Frysinger
2011-07-12 9:01 ` PATCH Abhijit Halder
2011-07-12 17:31 ` PATCH Mike Frysinger
2011-07-12 17:49 ` PATCH Matt Rice
2011-07-12 19:25 ` PATCH Mike Frysinger
2011-07-12 19:49 ` PATCH Tom Tromey
2011-07-12 20:43 ` PATCH Mike Frysinger
2011-07-13 8:45 ` PATCH Abhijit Halder
2011-07-15 14:15 ` PATCH Abhijit Halder
2011-07-15 20:49 ` PATCH Tom Tromey
2011-07-20 19:25 ` PATCH Sergio Durigan Junior
2011-07-21 11:08 ` Pedro Alves [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201107211122.15756.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=abhijit.k.halder@gmail.com \
--cc=gdb-patches@sourceware.org \
--cc=tromey@redhat.com \
--cc=vapier@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox