This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] An implementation of pipe to make I/O communication between gdb and shell.
- From: Pedro Alves <pedro at codesourcery dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: Abhijit Halder <abhijit dot k dot halder at gmail dot com>, gdb-patches at sourceware dot org, Sergio Durigan Junior <sergiodj at redhat dot com>, Tom Tromey <tromey at redhat dot com>
- Date: Fri, 5 Aug 2011 09:52:16 +0100
- Subject: Re: [PATCH] An implementation of pipe to make I/O communication between gdb and shell.
- References: <CAOhZP9zU2K01zFDkChtutGT6yJjUeWYeGRNAAgPgM5rKwrgysg@mail.gmail.com> <CAOhZP9zOKz7AR87Qu2rEhdsXy61GKxW11drPO9X9u=NkO6Fuyw@mail.gmail.com> <20110805082947.GA5020@host1.jankratochvil.net>
On Friday 05 August 2011 09:29:47, Jan Kratochvil wrote:
> Why there should be such explicitly limited delimiter choice? Couldn't the
> pipe command default to '|' and otherwise take an arbitrary first word?
> (The word should never start with '-' to have the options extension possibility
> in the future.) That is to permit:
> (gdb) pipe info threads | less
> (gdb) pipe : print 1 | 2 : less
> (gdb) pipe FOO print 1 | 2 FOO less
> etc.
That way you can't tell if FOO is a token or a random gdb
command, unless you forbit tokens that are command names.
I had suggested:
"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 -
"
We can get by without -t too, but we'd need
the `-', I think:
(gdb) pipe - bt | vim -
(gdb) pipe FOO - bt FOO vim -
But at this point, if we always need to spell out
`-', we might as well decide that you always
end the pipe command with the splitting token, that
is, the default of `|' doesn't really buy much:
(gdb) pipe - bt | vim -
(gdb) pipe FOO - bt FOO vim -
(gdb) pipe BAR - bt BAR vim -
vs
(gdb) pipe | bt | vim -
(gdb) pipe FOO bt FOO vim -
(gdb) pipe BAR bt BAR vim -
which brings us back to the current proposed
syntax, except for the split token not being limited to
some set of fixed characters.
--
Pedro Alves