Next: , Previous: GDB/MI Ada Exceptions Commands, Up: GDB/MI

27.23 gdb/mi Support Commands

Since new commands and features get regularly added to gdb/mi, some commands are available to help front-ends query the debugger about support for these capabilities. Similarly, it is also possible to query gdb about target support of certain features.

The -info-gdb-mi-command Command

      -info-gdb-mi-command cmd_name

Query support for the gdb/mi command named cmd_name.

Note that the dash (-) starting all gdb/mi commands is technically not part of the command name (see GDB/MI Input Syntax), and thus should be omitted in cmd_name. However, for ease of use, this command also accepts the form with the leading dash.

gdb Command

There is no corresponding gdb command.


The result is a tuple. There is currently only one field:

This field is equal to "true" if the gdb/mi command exists, "false" otherwise.

Here is an example where the gdb/mi command does not exist:

     -info-gdb-mi-command unsupported-command

And here is an example where the gdb/mi command is known to the debugger:

     -info-gdb-mi-command symbol-list-lines

The -list-features Command

Returns a list of particular features of the MI protocol that this version of gdb implements. A feature can be a command, or a new field in an output of some command, or even an important bugfix. While a frontend can sometimes detect presence of a feature at runtime, it is easier to perform detection at debugger startup.

The command returns a list of strings, with each string naming an available feature. Each returned string is just a name, it does not have any internal structure. The list of possible feature names is given below.

Example output:

     (gdb) -list-features

The current list of features is:

Indicates support for the -var-set-frozen command, as well as possible presense of the frozen field in the output of -varobj-create.
Indicates support for the -f option to the -break-insert command.
Indicates Python scripting support, Python-based pretty-printing commands, and possible presence of the ‘display_hint’ field in the output of -var-list-children
Indicates support for the -thread-info command.
Indicates support for the -data-read-memory-bytes and the -data-write-memory-bytes commands.
Indicates that changes to breakpoints and breakpoints created via the CLI will be announced via async records.
Indicates support for the -ada-task-info command.
Indicates that all gdb/mi commands accept the --language option (see Context management).
Indicates support for the -info-gdb-mi-command command.
Indicates support for the "undefined-command" error code in error result records, produced when trying to execute an undefined gdb/mi command (see GDB/MI Result Records).
Indicates that the -exec-run command supports the --start option (see GDB/MI Program Execution).

The -list-target-features Command

Returns a list of particular features that are supported by the target. Those features affect the permitted MI commands, but unlike the features reported by the -list-features command, the features depend on which target GDB is using at the moment. Whenever a target can change, due to commands such as -target-select, -target-attach or -exec-run, the list of target features may change, and the frontend should obtain it again. Example output:

     (gdb) -list-target-features

The current list of features is:

Indicates that the target is capable of asynchronous command execution, which means that gdb will accept further commands while the target is running.
Indicates that the target is capable of reverse execution. See Reverse Execution, for more information.