Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: John Baldwin <jhb@FreeBSD.org>
To: Kevin Buettner <kevinb@redhat.com>, gdb@sourceware.org
Cc: Philippe Waroquiers <philippe.waroquiers@skynet.be>
Subject: Re: / (slash) command : fast way to temporarily change setting(s) to run a command
Date: Fri, 19 Apr 2019 16:52:00 -0000	[thread overview]
Message-ID: <0b0be35e-eecc-159d-5c39-ad58366be3cc@FreeBSD.org> (raw)
In-Reply-To: <20190417011403.6072c4b3@f29-4.lan>

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.

-- 
John Baldwin


  parent reply	other threads:[~2019-04-19 16:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1555313564.1473.2.camel@skynet.be>
2019-04-16  3:06 ` Simon Marchi
2019-04-16  6:48   ` Philippe Waroquiers
2019-04-16 12:20     ` Simon Marchi
2019-04-16 21:22       ` Philippe Waroquiers
2019-04-17  8:14 ` Kevin Buettner
2019-04-17 20:59   ` Philippe Waroquiers
2019-04-19 16:52   ` John Baldwin [this message]
2019-05-03  3:10     ` Kevin Buettner
2019-05-03  8:23       ` Pedro Alves
2019-05-03  9:10         ` Philippe Waroquiers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0b0be35e-eecc-159d-5c39-ad58366be3cc@FreeBSD.org \
    --to=jhb@freebsd.org \
    --cc=gdb@sourceware.org \
    --cc=kevinb@redhat.com \
    --cc=philippe.waroquiers@skynet.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox