From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4336 invoked by alias); 5 Aug 2011 08:52:38 -0000 Received: (qmail 4323 invoked by uid 22791); 5 Aug 2011 08:52:37 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 05 Aug 2011 08:52:23 +0000 Received: (qmail 12411 invoked from network); 5 Aug 2011 08:52:22 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 5 Aug 2011 08:52:22 -0000 From: Pedro Alves To: Jan Kratochvil Subject: Re: [PATCH] An implementation of pipe to make I/O communication between gdb and shell. Date: Fri, 05 Aug 2011 08:52:00 -0000 User-Agent: KMail/1.13.6 (Linux/2.6.38-8-generic; KDE/4.6.2; x86_64; ; ) Cc: Abhijit Halder , gdb-patches@sourceware.org, Sergio Durigan Junior , Tom Tromey References: <20110805082947.GA5020@host1.jankratochvil.net> In-Reply-To: <20110805082947.GA5020@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201108050952.17466.pedro@codesourcery.com> 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/msg00095.txt.bz2 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