toolchain/share/doc/gdb/GDB_002fMI-Support-Commands...

178 lines
10 KiB
HTML

<html lang="en">
<head>
<title>GDB/MI Support Commands - Debugging with GDB</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Debugging with GDB">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="GDB_002fMI.html#GDB_002fMI" title="GDB/MI">
<link rel="prev" href="GDB_002fMI-Ada-Exceptions-Commands.html#GDB_002fMI-Ada-Exceptions-Commands" title="GDB/MI Ada Exceptions Commands">
<link rel="next" href="GDB_002fMI-Miscellaneous-Commands.html#GDB_002fMI-Miscellaneous-Commands" title="GDB/MI Miscellaneous Commands">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
Copyright (C) 1988-2019 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being ``Free Software'' and ``Free Software Needs
Free Documentation'', with the Front-Cover Texts being ``A GNU Manual,''
and with the Back-Cover Texts as in (a) below.
(a) The FSF's Back-Cover Text is: ``You are free to copy and modify
this GNU Manual. Buying copies from GNU Press supports the FSF in
developing GNU and promoting software freedom.''
-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<a name="GDB%2fMI-Support-Commands"></a>
<a name="GDB_002fMI-Support-Commands"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="GDB_002fMI-Miscellaneous-Commands.html#GDB_002fMI-Miscellaneous-Commands">GDB/MI Miscellaneous Commands</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="GDB_002fMI-Ada-Exceptions-Commands.html#GDB_002fMI-Ada-Exceptions-Commands">GDB/MI Ada Exceptions Commands</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="GDB_002fMI.html#GDB_002fMI">GDB/MI</a>
<hr>
</div>
<h3 class="section">27.23 <span class="sc">gdb/mi</span> Support Commands</h3>
<p>Since new commands and features get regularly added to <span class="sc">gdb/mi</span>,
some commands are available to help front-ends query the debugger
about support for these capabilities. Similarly, it is also possible
to query <span class="sc">gdb</span> about target support of certain features.
<h4 class="subheading">The <code>-info-gdb-mi-command</code> Command</h4>
<p><a name="index-g_t_0040code_007b_002dinfo_002dgdb_002dmi_002dcommand_007d-3081"></a><a name="index-g_t_002dinfo_002dgdb_002dmi_002dcommand-3082"></a>
<h5 class="subsubheading">Synopsis</h5>
<pre class="smallexample"> -info-gdb-mi-command <var>cmd_name</var>
</pre>
<p>Query support for the <span class="sc">gdb/mi</span> command named <var>cmd_name</var>.
<p>Note that the dash (<code>-</code>) starting all <span class="sc">gdb/mi</span> commands
is technically not part of the command name (see <a href="GDB_002fMI-Input-Syntax.html#GDB_002fMI-Input-Syntax">GDB/MI Input Syntax</a>), and thus should be omitted in <var>cmd_name</var>. However,
for ease of use, this command also accepts the form with the leading
dash.
<h5 class="subsubheading"><span class="sc">gdb</span> Command</h5>
<p>There is no corresponding <span class="sc">gdb</span> command.
<h5 class="subsubheading">Result</h5>
<p>The result is a tuple. There is currently only one field:
<dl>
<dt>&lsquo;<samp><span class="samp">exists</span></samp>&rsquo;<dd>This field is equal to <code>"true"</code> if the <span class="sc">gdb/mi</span> command exists,
<code>"false"</code> otherwise.
</dl>
<h5 class="subsubheading">Example</h5>
<p>Here is an example where the <span class="sc">gdb/mi</span> command does not exist:
<pre class="smallexample"> -info-gdb-mi-command unsupported-command
^done,command={exists="false"}
</pre>
<p class="noindent">And here is an example where the <span class="sc">gdb/mi</span> command is known
to the debugger:
<pre class="smallexample"> -info-gdb-mi-command symbol-list-lines
^done,command={exists="true"}
</pre>
<h4 class="subheading">The <code>-list-features</code> Command</h4>
<p><a name="index-g_t_002dlist_002dfeatures-3083"></a><a name="index-supported-_0040sc_007bgdb_002fmi_007d-features_002c-list-3084"></a>
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.
<p>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.
<p>Example output:
<pre class="smallexample"> (gdb) -list-features
^done,result=["feature1","feature2"]
</pre>
<p>The current list of features is:
<dl>
<dt>&lsquo;<samp><span class="samp">frozen-varobjs</span></samp>&rsquo;<a name="index-frozen_002dvarobjs-3085"></a><dd>Indicates support for the <code>-var-set-frozen</code> command, as well
as possible presense of the <code>frozen</code> field in the output
of <code>-varobj-create</code>.
<br><dt>&lsquo;<samp><span class="samp">pending-breakpoints</span></samp>&rsquo;<a name="index-pending_002dbreakpoints-3086"></a><dd>Indicates support for the <samp><span class="option">-f</span></samp> option to the <code>-break-insert</code>
command.
<br><dt>&lsquo;<samp><span class="samp">python</span></samp>&rsquo;<a name="index-python-3087"></a><dd>Indicates Python scripting support, Python-based
pretty-printing commands, and possible presence of the
&lsquo;<samp><span class="samp">display_hint</span></samp>&rsquo; field in the output of <code>-var-list-children</code>
<br><dt>&lsquo;<samp><span class="samp">thread-info</span></samp>&rsquo;<a name="index-thread_002dinfo-3088"></a><dd>Indicates support for the <code>-thread-info</code> command.
<br><dt>&lsquo;<samp><span class="samp">data-read-memory-bytes</span></samp>&rsquo;<a name="index-data_002dread_002dmemory_002dbytes-3089"></a><dd>Indicates support for the <code>-data-read-memory-bytes</code> and the
<code>-data-write-memory-bytes</code> commands.
<br><dt>&lsquo;<samp><span class="samp">breakpoint-notifications</span></samp>&rsquo;<a name="index-breakpoint_002dnotifications-3090"></a><dd>Indicates that changes to breakpoints and breakpoints created via the
CLI will be announced via async records.
<br><dt>&lsquo;<samp><span class="samp">ada-task-info</span></samp>&rsquo;<a name="index-ada_002dtask_002dinfo-3091"></a><dd>Indicates support for the <code>-ada-task-info</code> command.
<br><dt>&lsquo;<samp><span class="samp">language-option</span></samp>&rsquo;<a name="index-language_002doption-3092"></a><dd>Indicates that all <span class="sc">gdb/mi</span> commands accept the <samp><span class="option">--language</span></samp>
option (see <a href="Context-management.html#Context-management">Context management</a>).
<br><dt>&lsquo;<samp><span class="samp">info-gdb-mi-command</span></samp>&rsquo;<a name="index-info_002dgdb_002dmi_002dcommand-3093"></a><dd>Indicates support for the <code>-info-gdb-mi-command</code> command.
<br><dt>&lsquo;<samp><span class="samp">undefined-command-error-code</span></samp>&rsquo;<a name="index-undefined_002dcommand_002derror_002dcode-3094"></a><dd>Indicates support for the "undefined-command" error code in error result
records, produced when trying to execute an undefined <span class="sc">gdb/mi</span> command
(see <a href="GDB_002fMI-Result-Records.html#GDB_002fMI-Result-Records">GDB/MI Result Records</a>).
<br><dt>&lsquo;<samp><span class="samp">exec-run-start-option</span></samp>&rsquo;<a name="index-exec_002drun_002dstart_002doption-3095"></a><dd>Indicates that the <code>-exec-run</code> command supports the <samp><span class="option">--start</span></samp>
option (see <a href="GDB_002fMI-Program-Execution.html#GDB_002fMI-Program-Execution">GDB/MI Program Execution</a>).
<br><dt>&lsquo;<samp><span class="samp">data-disassemble-a-option</span></samp>&rsquo;<a name="index-data_002ddisassemble_002da_002doption-3096"></a><dd>Indicates that the <code>-data-disassemble</code> command supports the <samp><span class="option">-a</span></samp>
option (see <a href="GDB_002fMI-Data-Manipulation.html#GDB_002fMI-Data-Manipulation">GDB/MI Data Manipulation</a>).
</dl>
<h4 class="subheading">The <code>-list-target-features</code> Command</h4>
<p><a name="index-g_t_002dlist_002dtarget_002dfeatures-3097"></a>
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 <code>-list-features</code> command, the
features depend on which target GDB is using at the moment. Whenever
a target can change, due to commands such as <code>-target-select</code>,
<code>-target-attach</code> or <code>-exec-run</code>, the list of target features
may change, and the frontend should obtain it again.
Example output:
<pre class="smallexample"> (gdb) -list-target-features
^done,result=["async"]
</pre>
<p>The current list of features is:
<dl>
<dt>&lsquo;<samp><span class="samp">async</span></samp>&rsquo;<dd>Indicates that the target is capable of asynchronous command
execution, which means that <span class="sc">gdb</span> will accept further commands
while the target is running.
<br><dt>&lsquo;<samp><span class="samp">reverse</span></samp>&rsquo;<dd>Indicates that the target is capable of reverse execution.
See <a href="Reverse-Execution.html#Reverse-Execution">Reverse Execution</a>, for more information.
</dl>
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
</body></html>