From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11680 invoked by alias); 2 Aug 2011 15:45:11 -0000 Received: (qmail 11667 invoked by uid 22791); 2 Aug 2011 15:45:09 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 02 Aug 2011 15:44:54 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p72Fis2F013073 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 2 Aug 2011 11:44:54 -0400 Received: from host1.jankratochvil.net (ovpn-116-16.ams2.redhat.com [10.36.116.16]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p72Fiqw9000952 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 2 Aug 2011 11:44:53 -0400 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p72FipXI020736; Tue, 2 Aug 2011 17:44:51 +0200 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p72Fioup020729; Tue, 2 Aug 2011 17:44:50 +0200 Date: Tue, 02 Aug 2011 15:45:00 -0000 From: Jan Kratochvil To: Abhijit Halder Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] An implementation of pipe to make I/O communication between gdb and shell. Message-ID: <20110802154450.GA19759@host1.jankratochvil.net> References: <20110802065411.GA23915@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) 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-08/txt/msg00029.txt.bz2 On Tue, 02 Aug 2011 10:52:27 +0200, Abhijit Halder wrote: > On Tue, Aug 2, 2011 at 12:24 PM, Jan Kratochvil 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 <<>>\n (gdb) pipe echo \<\<\\>\>\\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