Next: GDB/MI Miscellaneous Commands, Previous: GDB/MI Ada Exceptions Commands, Up: GDB/MI
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.
-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.
There is no corresponding gdb command.
The result is a tuple. There is currently only one field:
"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
^done,command={exists="false"}
And here is an example where the gdb/mi command is known to the debugger:
-info-gdb-mi-command symbol-list-lines
^done,command={exists="true"}
-list-features CommandReturns 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
^done,result=["feature1","feature2"]
The current list of features is:
-var-set-frozen command, as well
as possible presense of the frozen field in the output
of -varobj-create.
-break-insert
command.
-var-list-children
-thread-info command.
-data-read-memory-bytes and the
-data-write-memory-bytes commands.
-ada-task-info command.
-info-gdb-mi-command command.
-exec-run command supports the --start
option (see GDB/MI Program Execution).
-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
^done,result=["async"]
The current list of features is: