Debugging with GDB: GDB/MI Support Commands |
---|
Next: GDB/MI Miscellaneous Commands, Previous: GDB/MI Ada Exceptions Commands, Up: GDB/MI [Contents][Index]
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:
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 ^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:
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).
-list-target-features
CommandReturns 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:
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.
Next: GDB/MI Miscellaneous Commands, Previous: GDB/MI Ada Exceptions Commands, Up: GDB/MI [Contents][Index]