[RFA 1/2] New GDB/MI command "-info-gdb-mi-command"

Joel Brobecker brobecker@adacore.com
Tue Nov 19 04:35:00 GMT 2013


> > I now think that it was indeed the correct choice.  Not only does it
> > facilitate implementation (but only marginally), it also is consistent
> > with the current output.  For instance, notice how GDB names the command
> > in the following error message:
> > 
> >     -unsupported
> >     ^error,msg="Undefined MI command: unsupported"
> >                                       ^^^^^^^^^^^
> >                                     (no leading dash)
> 
> Your example shows _output_ from MI.  By contrast, we are talking
> about _input_.  When I send commands to MI, I cannot omit the leading
> dash, so it can be very natural to consider it part of the command.
> 
> We don't have to advertise that we support the dash, 
> 
> > Also, looking at the grammar, the leading dash isn't listed
> > as part of what they call the "operation"
> 
> IMO, this line of reasoning makes little sense to users.  Grammars are
> for programs, not for people.

To me, documentation is not an issue.  I confess that I remain
unconvinced in this case, especially since this is a command meant
for programs rather than humans, so the risk of using it improperly
is low, given the clear documentation.  However, I don't have a strong
opinion, and supporting both forms is pretty easy, so unless someone
strongly objects to allowing the second form, I've just gone ahead and
added it.

Updated patch attached. And for review convenience, I am also attaching
a diff of the changes I made on top of path #1 (to get to the updated
patch).

gdb/ChangeLog:

        * mi/mi-cmds.h (mi_cmd_info_gdb_mi_command): Declare.
        * mi/mi-cmd-info.c (mi_cmd_info_gdb_mi_command): New function.
        * mi/mi-cmds.c (mi_cmds): Add -info-gdb-mi-command command.
        * mi/mi-main.c (mi_cmd_list_features): Add "info-gdb-mi-command"
        field to output of "-list-features".

        * NEWS: Add entry for new -info-gdb-mi-command.

gdb/doc/ChangeLog:

        * gdb.texinfo (GDB/MI Miscellaneous Commands): Document
        the new -info-gdb-mi-command GDB/MI command.  Document
        the meaning of "-info-gdb-mi-command" in the output of
        -list-features.

gdb/testsuite/ChangeLog:

        * gdb.mi/mi-i-cmd.exp: New file.

Re-tested on x86_64-linux.  OK to commit?

Thank you,
-- 
Joel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-New-GDB-MI-command-info-gdb-mi-command.patch
Type: text/x-diff
Size: 10541 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20131119/82e46518/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: info-gdb-mi-command-updates.diff
Type: text/x-diff
Size: 2833 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20131119/82e46518/attachment-0001.bin>


More information about the Gdb-patches mailing list