Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Pedro Alves <palves@redhat.com>
Cc: "Tom Tromey" <tromey@redhat.com>,
	"André Pönitz" <andre.poenitz@mathematik.tu-chemnitz.de>,
	gdb-patches@sourceware.org
Subject: Re: [RFC] New GDB/MI command "-info-gdb-mi-command"
Date: Fri, 15 Nov 2013 14:38:00 -0000	[thread overview]
Message-ID: <20131115123905.GW3481@adacore.com> (raw)
In-Reply-To: <52861143.3030408@redhat.com>

> > Regarding invalid switches, we may have to extend the current proposal
> > to allow the command to specific what in the usage caused problem?
> 
> Not sure about that.  Sounds more complicated than it's worth it.
> 
> > In my proposal, it was easy to extend by adding a "feature=[...]"
> > list to the output. Or maybe that's overkill? Or use list-features
> > for that instead?
> 
> As list-features already exists, and works just as well, that might
> indeed be overkill.  Or put another way, is there a use case that
> list-features doesn't cover, or something about "feature=[]"
> that'd make ours and frontend writers' lives easier?  Just like with
> list-features, we'd always have to manually take care of listing the
> new command feature in "features=[]", so on our end it doesn't seem
> to buy anything.
> IOW, thinking in terms of KISS seems to suggest sticking with
> list-features.

OK, I think will work well enough in practice, and, really, worrying
about a few more bytes at a time was a bit of an overreaction :).

> > I'd like us to decide to something I can go and implement. Either way,
> > I think we can start by concentrating with the initial goal, which is
> > to determine whether a command exists or not.
> 
> Yeah.  I have no problem with your proposal.  There's actually one
> case where it works, and '^error,code="unknown-command"' does not,
> which is when a command works and has effects without options.  In such
> cases, you can't probe for the command's existence without causing
> the (side) effects.

I think the intent was not to provide a probing mechanism, but
rather to provide an approach where the FE just fires the command
when it needs to, and then fallback on a CLI-based approach if
detecting an 'unknown-command' error.

But, on the other hand, I am thinking that some FEs might still
want to probe ahead of time, for instance if they do not wish to
provide a fallback mechanism (thus disabling the relevant parts
of the GUI ahead of time); or even if it is easier programatically
for them to probe, instead of having to handle this specific error.

> > People seem to have reacted
> > more positively to the idea of try-and-fallback approach, shall we go
> > with Pedro's idea (without the "invalid switch"/"usage" part)?
> 
> If I had infinite time, I'd go for all of the above.  Command to
> probe existence of commands, and make ^error indicate both
> unknown command, and bad usage.  :-)

I don't have infinite amount of time, but the first 2 (new GDB/MI
command and new ^error for unknown commands) are fairly small tasks,
so I'm happy sending patches for both. That way, we get the best
of both worlds, without must cost, I think, in terms of extra
maintenance, since both patches would be pretty small, and localized.

For invalid usage, I could add that to my list, but that'll have
to be next year... (/me wishes I would say that on Dec 31st...)

-- 
Joel


  reply	other threads:[~2013-11-15 12:39 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-10 17:16 [RFC] Add ada-exception-catchpoints to -list-features command output Joel Brobecker
2013-11-10 22:16 ` Eli Zaretskii
2013-11-12 11:25   ` Joel Brobecker
2013-11-12 16:39     ` Eli Zaretskii
2013-11-13  3:02       ` Joel Brobecker
2013-11-11 15:22 ` Tom Tromey
2013-11-12  9:18   ` Joel Brobecker
2013-11-12 12:11   ` [RFC] New GDB/MI command "-info-gdb-mi-command" Joel Brobecker
2013-11-12 17:04     ` Eli Zaretskii
2013-11-12 17:48       ` Joel Brobecker
2013-11-12 18:34         ` Eli Zaretskii
2013-11-13  3:19           ` Joel Brobecker
2013-11-12 21:17     ` André Pönitz
2013-11-13  2:47       ` Joel Brobecker
2013-11-14  0:36         ` André Pönitz
2013-11-14  9:48           ` Joel Brobecker
2013-11-14 18:31             ` André Pönitz
2013-11-14 19:03         ` Pedro Alves
2013-11-14 19:37           ` Pedro Alves
2013-11-14 20:30             ` Tom Tromey
2013-11-15  5:35               ` Joel Brobecker
2013-11-15 12:39                 ` Pedro Alves
2013-11-15 14:38                   ` Joel Brobecker [this message]
2013-11-15 14:40                     ` Pedro Alves
2013-11-18 17:12                       ` [RFA GDB/MI] Help determine if GDB/MI command exists or not Joel Brobecker
2013-11-18 17:13                         ` [RFA 1/2] New GDB/MI command "-info-gdb-mi-command" Joel Brobecker
2013-11-18 17:29                           ` Eli Zaretskii
2013-11-19  4:35                             ` Joel Brobecker
2013-11-19 16:11                               ` Eli Zaretskii
2013-12-02  3:26                               ` Joel Brobecker
2013-12-02  3:51                                 ` Eli Zaretskii
2013-12-02  4:41                                   ` Joel Brobecker
2013-12-02 14:53                               ` Pedro Alves
2013-12-03  4:06                                 ` pushed: " Joel Brobecker
2013-11-18 17:21                         ` [RFA 2/2] Add "undefined-command" error code at end of ^error result Joel Brobecker
2013-11-18 17:29                           ` Eli Zaretskii
2013-11-19  6:02                             ` Joel Brobecker
2013-11-19 16:16                               ` Eli Zaretskii
2013-11-19 11:19                           ` Pedro Alves
2013-11-20  3:46                             ` Joel Brobecker
2013-12-03  4:08                               ` pushed: " Joel Brobecker
2013-11-19 15:05                         ` [RFA GDB/MI] Help determine if GDB/MI command exists or not Pedro Alves

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=20131115123905.GW3481@adacore.com \
    --to=brobecker@adacore.com \
    --cc=andre.poenitz@mathematik.tu-chemnitz.de \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=tromey@redhat.com \
    /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