From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11130 invoked by alias); 5 Aug 2011 09:09:51 -0000 Received: (qmail 11121 invoked by uid 22791); 5 Aug 2011 09:09:50 -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; Fri, 05 Aug 2011 09:09:29 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p7599LuG027707 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 5 Aug 2011 05:09:21 -0400 Received: from host1.jankratochvil.net (ovpn-116-26.ams2.redhat.com [10.36.116.26]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p7599Imw028964 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 5 Aug 2011 05:09:20 -0400 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p7599I04007451; Fri, 5 Aug 2011 11:09:18 +0200 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p7599HUs007447; Fri, 5 Aug 2011 11:09:17 +0200 Date: Fri, 05 Aug 2011 09:09:00 -0000 From: Jan Kratochvil To: Pedro Alves Cc: Abhijit Halder , gdb-patches@sourceware.org, Sergio Durigan Junior , Tom Tromey Subject: Re: [PATCH] An implementation of pipe to make I/O communication between gdb and shell. Message-ID: <20110805090917.GA7180@host1.jankratochvil.net> References: <20110805082947.GA5020@host1.jankratochvil.net> <201108050952.17466.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201108050952.17466.pedro@codesourcery.com> 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/msg00096.txt.bz2 On Fri, 05 Aug 2011 10:52:16 +0200, Pedro Alves wrote: > On Friday 05 August 2011 09:29:47, Jan Kratochvil wrote: > > (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. Oops, I noticed only after sending it... > 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 One point is it should be `--' instead of `-' to be GNU getopt-like compliant. I am still not fond of any mandatory character there if in 99% of uses cases one can just default to `|'. `pipe' is there for convenience, one can already get reach the same functionality with some defined canned command sequence with `set logging'. > which brings us back to the current proposed > syntax, except for the split token not being limited to > some set of fixed characters. To make the most common use case with `|' the most simple to type: (gdb) pipe print 1 | less one could consider the first argument a delimiter if it is a single-character and ispunct(). (gdb) pipe print 1 | less (gdb) pipe : print 1 | 2 : less If one really needs to enter ispunct() single-character command one still can: (gdb) pipe | + plus-args if + is a valid GDB command. Thanks, Jan