From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 53211 invoked by alias); 3 May 2019 08:23:39 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 53201 invoked by uid 89); 3 May 2019 08:23:38 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=HX-Gm-Message-State:APjAAAU, H*M:6765, him X-HELO: mail-wr1-f67.google.com Received: from mail-wr1-f67.google.com (HELO mail-wr1-f67.google.com) (209.85.221.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 03 May 2019 08:23:37 +0000 Received: by mail-wr1-f67.google.com with SMTP id c5so6660051wrs.11 for ; Fri, 03 May 2019 01:23:37 -0700 (PDT) Return-Path: Received: from ?IPv6:2001:8a0:f913:f700:4c97:6d52:2cea:997b? ([2001:8a0:f913:f700:4c97:6d52:2cea:997b]) by smtp.gmail.com with ESMTPSA id o6sm2990634wrh.55.2019.05.03.01.23.34 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Fri, 03 May 2019 01:23:34 -0700 (PDT) Subject: Re: / (slash) command : fast way to temporarily change setting(s) to run a command To: Kevin Buettner , gdb@sourceware.org References: <1555313564.1473.2.camel@skynet.be> <20190417011403.6072c4b3@f29-4.lan> <0b0be35e-eecc-159d-5c39-ad58366be3cc@FreeBSD.org> <20190502201055.04bd9766@f29-4.lan> Cc: John Baldwin , Philippe Waroquiers From: Pedro Alves Message-ID: Date: Fri, 03 May 2019 08:23:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20190502201055.04bd9766@f29-4.lan> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-05/txt/msg00006.txt.bz2 On 5/3/19 4:10 AM, Kevin Buettner wrote: > On Fri, 19 Apr 2019 09:52:43 -0700 > John Baldwin wrote: > >> On 4/17/19 1:14 AM, Kevin Buettner wrote: >>> My first reaction to this proposal was that '/' is already used in >>> some commands to modify their behavior. E.g. "print", "display", and >>> "x" all use /FMT to change the way that data is formatted. >>> >>> That said, '/' seems to be used in only a handful of commands. It >>> may be that its use is confined to the ones already mentioned. >>> >>> I see that the "interrupt" command allows the use of -a to modify >>> its behavior. Most commands have no modifiers at all. >>> >>> I don't have a serious objection to Philippe's proposal, but I do >>> think that we ought to consider whether use of '/' in this context >>> might be confusing to the user. Might some other character or command >>> name be less confusing? I don't know the answer to this, but I do >>> think it's something which should be pondered before making this >>> proposal a part of GDB's CLI. >> >> I find using / to make sense actually. A leading / applies "global" >> settings to the following command, so you have a general syntax that >> is something like: >> >> [/global settings] [command] [/command-specific settings] [arguments] >> >> Where moving from left to right consistently "narrows" the scope. >> This is not unlike the syntax used in certain command line programs >> that reuse getopt-like interfaces for subcommand options while also >> supporting "global" options. git is an example of this (you have >> global options before the verb and then command-specific options >> after the verb both of which use the same getopt syntax) as well as >> svn, etc. > > I like this rationale for the global / command. > > I'd like to wait a bit longer before reviewing Philippe's patch, however. > I know that one of my colleagues has some thoughts on the interface > and I'd like to give him a little extra time to express them here... That was me. :-) See here: https://sourceware.org/ml/gdb-patches/2019-05/msg00002.html I'll follow up when I have a chance. Yesterday I fixed the regressions that Philippe pointed at (fixes already in the branch) -- I wanted to see if it was possible to get to a clean slate for better experimenting / better ground for discussion. Thanks, Pedro Alves