Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: "André Pönitz" <andre.poenitz@mathematik.tu-chemnitz.de>
Cc: Tom Tromey <tromey@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [RFC] New GDB/MI command "-info-gdb-mi-command"
Date: Wed, 13 Nov 2013 02:47:00 -0000	[thread overview]
Message-ID: <20131113021514.GG3481@adacore.com> (raw)
In-Reply-To: <20131112205229.GA7068@klara.mpi.htwm.de>

> I am not sure I agree with the judgement of benefits here. The basic 
> yes/no information is already there:
> 
>     (gdb) -unsupported-command
>     ^error,msg="Undefined MI command: unsupported-command"
>     (gdb) -symbol-list-lines
>     ^error,msg="-symbol-list-lines: Usage: SOURCE_FILENAME"
> 
> It's not nice, but "works".

I disagree with your assessment of "works". I can think of a number
of scenarios where this would be problematic:

The first and most obvious to me is the case where the debugger is
run with a non-English LANG. If you base your detection on parsing
the error msg, then i18n ruins your plan. And if you base your detection
on the presence of the error alone, then commands that take no argument
may return an error, which by no means indicates that the command does not
exist.

> In addition, a yes-or-no is not even what might be needed.

Well, the IDE team at AdaCore needs that information in order to
support the variety of GDB versions out there, and I also agreed
with them that this was a sensible request.

> Look e.g. at the "python" advertisement in -list-features output
> ^done,features=["frozen-varobjs","pending-breakpoints","thread-info",
> "data-read-memory-bytes","breakpoint-notifications","ada-task-info","python"]
> 
> It does not indicate whether it is properly installed (datadir...) nor
> whether the version of Python is compatible with the script I want to
> execute. So in practice, checking -list-features is just extra effort
> giving only a subset of the information I would need for an "ok to use"
> decision, and it's quicker and more reliable to just execute the command
> and handle errors.
> 
> It's hard to imagine that this will ever cover enough of GDB features
> and questions a frontend needs to have answered.

If we were discussing about the specific issues regarding the use of
Python in your example, I would say that this is outside the scope of
this new command.

If you are trying to make a general point, then can you please tell
us how you think we can improve it? If not, you are free to find it
useless and to prefer to just use your execution test. But I definitely
think it's cleaner to query the debugger with a well documented interface,
rather than relying on detecting certain kinds of errors.

-- 
Joel


  reply	other threads:[~2013-11-13  2:15 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 [this message]
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
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=20131113021514.GG3481@adacore.com \
    --to=brobecker@adacore.com \
    --cc=andre.poenitz@mathematik.tu-chemnitz.de \
    --cc=gdb-patches@sourceware.org \
    --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