This is the mail archive of the
mailing list for the GDB project.
Re: / (slash) command : fast way to temporarily change setting(s) to run a command
- From: Pedro Alves <palves at redhat dot com>
- To: Kevin Buettner <kevinb at redhat dot com>, gdb at sourceware dot org
- Cc: John Baldwin <jhb at FreeBSD dot org>, Philippe Waroquiers <philippe dot waroquiers at skynet dot be>
- Date: Fri, 3 May 2019 09:23:33 +0100
- Subject: Re: / (slash) command : fast way to temporarily change setting(s) to run a command
- References: <email@example.com> <firstname.lastname@example.org> <0b0be35e-eecc-159d-5c39-ad58366be3cc@FreeBSD.org> <email@example.com>
On 5/3/19 4:10 AM, Kevin Buettner wrote:
> On Fri, 19 Apr 2019 09:52:43 -0700
> John Baldwin <jhb@FreeBSD.org> 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:
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.