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: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Abhijit Halder <abhijit dot k dot halder at gmail dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 2 Aug 2011 17:44:50 +0200
- Subject: Re: [PATCH] An implementation of pipe to make I/O communication between gdb and shell.
- References: <CAOhZP9zU2K01zFDkChtutGT6yJjUeWYeGRNAAgPgM5rKwrgysg@mail.gmail.com> <CAOhZP9y6kB=v_qtMYnBWJOUYFE4vNEUghnYjardbBgv=CMJ4RQ@mail.gmail.com> <20110802065411.GA23915@host1.jankratochvil.net> <CAOhZP9x7B+GNEkq7BB0L1psHzonmPdya14hvThDRpWwDNQAfdA@mail.gmail.com>
On Tue, 02 Aug 2011 10:52:27 +0200, Abhijit Halder wrote:
> On Tue, Aug 2, 2011 at 12:24 PM, Jan Kratochvil <jan.kratochvil@redhat.com> wrote:
> Yes. I made this option (-r) available just to make the code
> futuristic.
It is nice to have the syntax ready for future extensions but one does not
have to code the extensions when they still have no use.
> >> Â- Â Âend of gdb option list
> >> dlim (delimiter) is a single ASCII character from the set below:
> >> {|/\'"`#@!$%^} (We actually can remove this restriction).
> >
> > I would prefer first to agree on the proper syntax. ÂI do not find
> >
> > (gdb) pipe | print 1 | less
> >
> > to be something a new user will ever try whether it does not work.
I missed the very first thread named "PATCH" which already discussed this part
so I am fine now with the "pipe" command.
> > If there is pipe `|' GDB could support also redirections '>', '>>', '2>&1',
> > '&>', '|&' besides '|' etc.
> >
> The same can still be very much possible with pipe command in place. For e.g.
> (gdb) pipe | thread apply all bt | grep "foobar" 2>&1 | tee myLog.txt
I was referring to for example
(gdb) pipe print variable >somefile
GDB also prints its errors to gdb_stderr, therefore you may need:
(gdb) pipe print nonexistingvariable |& tee file
if you want to redirect also the error message of the GDB "print" command.
But it all means a single delimiter would not be enough. Still one can
backslash the syntax:
(gdb) pipe print 1 \| 2 | tee file-will-contain-3
(gdb) echo <<<hello>>>\n
(gdb) pipe echo \<\<\<hello\>\>\>\\n >file
Sure maybe "pipe" is no longer the right name and "redirect" or so matches the
functionality better.
This is just a proposal. I see I jumped late to the thread. Still I would
prefer some final syntax agreement.
Thanks,
Jan