From: "Alain Magloire" <alain@qnx.com>
To: jmolenda@apple.com (Jason Molenda)
Cc: gdb@sources.redhat.com
Subject: Re: MI level command
Date: Mon, 12 Jul 2004 17:51:00 -0000 [thread overview]
Message-ID: <200407121738.NAA27485@smtp.ott.qnx.com> (raw)
In-Reply-To: <83333EB4-D1E9-11D8-B84C-000A9569836A@apple.com> from "Jason Molenda" at Jul 09, 2004 01:49:46 PM
>
>
> On Jul 8, 2004, at 4:33 PM, Alain Magloire wrote:
>
> > So would a patch implementing
> >
> > -gdb-mi-level
> > ^done,level=1
> >
> > be a good thing ?
>
>
> It would probably help some, but I don't see it as solving the problem.
> The MI version # changes very rarely,
Well it already did ... 3 times level 0, 1, 2
> and individual MI commands can
> change quite a bit within a single MI version. On the good side, the
> changes to MI commands' output are mostly additional information that
> can be ignored if not recognized (and, hopefully, worked around if
> absent).
>
How about bug fixes and misbehaved like Bob Rossi was mentionning.
How are you recognize this in the front end ?
> My bigger concern is the way MI commands are invoked -- many of the
> commands are (IMHO) poorly written, either written as if a human was
> typing them in or using numeric constants positionally to indicate
> different behaviors. Sometimes the entropy is reversed, e.g. Nick
> Roberts' addition of the "--all-values", "--no-values", and
> "--simple-values" arguments to -stack-list-locals was a change in the
> right direction. But consider -var-list-children. Long ago at Apple
> we'd extended this command so that the arguments to -var-list-children
> was "VAROBJ-HANDLE SHOW-VALUE" where SHOW-VALUE was an integer with
> magical meanings, akin to what -stack-list-locals did (we had a '2'
> that did created varobj's and the like).
>
Yes, I agree, there are inconsistencies in the commands, some understand "--"
as as separator some others do not. Some understand ""(double quotes) as way
to group a phrase some other do not. Some understand the escape char slash (\)
some ... do not. Some commands insist when passing spaces part of the argument that
you use quotes ... well some other if you do will return an error etc ...
... Not that I'm complaining 8-)
> So anyway, Nick makes a similar change, but with the order of arguments
> being "SHOW-VALUE VAROBJ-HANDLE". Ouch. He also added the --no-values
> and --all-values command line arguments at the same time.
>
> I don't mean to rag on Nick of course, but this illustrates the limited
> extensibility of MI commands that work like this. And I certainly
> don't mean to imply that Apple hasn't made similar misjudgements in our
> own MI commands -- just yesterday I was looking at an MI command that
> takes a thread number, a source filename, and a line number (so the
> user can move the PC around in a function), and the command looks like
> "-thread-set-pc THREADNO SOURCE:LINE". And now is the time in our
> program when we parse.
>
> I much prefer the -data-disassemble command where each piece of
> information is passed with a separate command argument flag (except for
> its "mixed mode" boolean integer as the optional last argument on the
> line, sigh).
>
>
> Oh, I got a little off topic.
>
Not at all, you are bang on.
> BTW one convenient thing we have in the Apple gdb is a
> -mi-verify-command MI command, so the GUI can see if a given command is
> available or not. It's very helpful, and the implementation is a snap,
> of course.
>
See Bob Rossi's followup on this.
Technically with a correct "MI Level" and "GDB Version" a front-end should
be able to know what is available and what is not.
Still it could be a usefull tool in the front-ends in our quest to tame MI.
> enum mi_cmd_result
> mi_cmd_mi_verify_command (char *command, char **argv, int argc)
> {
> char *command_name = argv[0];
> struct mi_cmd *cmd;
>
> if (argc != 1)
> error ("mi_cmd_mi_verify_command: Usage: MI_COMMAND_NAME.");
>
> cmd = mi_lookup (command_name);
>
> ui_out_field_string (uiout, "name", command_name);
> if (cmd != NULL)
> {
> ui_out_field_string (uiout, "defined", "true");
> ui_out_field_string (uiout, "implemented",
> ((cmd->cli.cmd != NULL) ||
> (cmd->argv_func != NULL) ||
> (cmd->args_func != NULL)) ? "true" : "false");
> }
> else
> {
> ui_out_field_string (uiout, "defined", "false");
> }
>
> return MI_CMD_DONE;
> }
>
>
next prev parent reply other threads:[~2004-07-12 17:38 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-08 23:33 Alain Magloire
2004-07-09 20:49 ` Jason Molenda
2004-07-10 17:18 ` Arnaud Charlet
2004-07-10 22:51 ` Bob Rossi
2004-07-12 17:51 ` Alain Magloire [this message]
2004-08-24 22:04 ` Andrew Cagney
2004-08-24 23:54 ` Bob Rossi
2004-08-25 13:23 ` Alain Magloire
2004-07-11 22:49 Nick Roberts
2004-07-12 21:14 ` Jason Molenda
[not found] <20040709012815.GA4464@white>
2004-07-12 17:38 ` Alain Magloire
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=200407121738.NAA27485@smtp.ott.qnx.com \
--to=alain@qnx.com \
--cc=gdb@sources.redhat.com \
--cc=jmolenda@apple.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