You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

277 lines
12KB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1988-2020 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation; with the
  7. Invariant Sections being "Free Software" and "Free Software Needs
  8. Free Documentation", with the Front-Cover Texts being "A GNU Manual,"
  9. and with the Back-Cover Texts as in (a) below.
  10. (a) The FSF's Back-Cover Text is: "You are free to copy and modify
  11. this GNU Manual. Buying copies from GNU Press supports the FSF in
  12. developing GNU and promoting software freedom." -->
  13. <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
  14. <head>
  15. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  16. <title>GDB/MI Support Commands (Debugging with GDB)</title>
  17. <meta name="description" content="GDB/MI Support Commands (Debugging with GDB)">
  18. <meta name="keywords" content="GDB/MI Support Commands (Debugging with GDB)">
  19. <meta name="resource-type" content="document">
  20. <meta name="distribution" content="global">
  21. <meta name="Generator" content="makeinfo">
  22. <link href="index.html#Top" rel="start" title="Top">
  23. <link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
  24. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  25. <link href="GDB_002fMI.html#GDB_002fMI" rel="up" title="GDB/MI">
  26. <link href="GDB_002fMI-Miscellaneous-Commands.html#GDB_002fMI-Miscellaneous-Commands" rel="next" title="GDB/MI Miscellaneous Commands">
  27. <link href="GDB_002fMI-Ada-Exceptions-Commands.html#GDB_002fMI-Ada-Exceptions-Commands" rel="prev" title="GDB/MI Ada Exceptions Commands">
  28. <style type="text/css">
  29. <!--
  30. a.summary-letter {text-decoration: none}
  31. blockquote.indentedblock {margin-right: 0em}
  32. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  33. blockquote.smallquotation {font-size: smaller}
  34. div.display {margin-left: 3.2em}
  35. div.example {margin-left: 3.2em}
  36. div.lisp {margin-left: 3.2em}
  37. div.smalldisplay {margin-left: 3.2em}
  38. div.smallexample {margin-left: 3.2em}
  39. div.smalllisp {margin-left: 3.2em}
  40. kbd {font-style: oblique}
  41. pre.display {font-family: inherit}
  42. pre.format {font-family: inherit}
  43. pre.menu-comment {font-family: serif}
  44. pre.menu-preformatted {font-family: serif}
  45. pre.smalldisplay {font-family: inherit; font-size: smaller}
  46. pre.smallexample {font-size: smaller}
  47. pre.smallformat {font-family: inherit; font-size: smaller}
  48. pre.smalllisp {font-size: smaller}
  49. span.nolinebreak {white-space: nowrap}
  50. span.roman {font-family: initial; font-weight: normal}
  51. span.sansserif {font-family: sans-serif; font-weight: normal}
  52. ul.no-bullet {list-style: none}
  53. -->
  54. </style>
  55. </head>
  56. <body lang="en">
  57. <a name="GDB_002fMI-Support-Commands"></a>
  58. <div class="header">
  59. <p>
  60. Next: <a href="GDB_002fMI-Miscellaneous-Commands.html#GDB_002fMI-Miscellaneous-Commands" accesskey="n" rel="next">GDB/MI Miscellaneous Commands</a>, Previous: <a href="GDB_002fMI-Ada-Exceptions-Commands.html#GDB_002fMI-Ada-Exceptions-Commands" accesskey="p" rel="prev">GDB/MI Ada Exceptions Commands</a>, Up: <a href="GDB_002fMI.html#GDB_002fMI" accesskey="u" rel="up">GDB/MI</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
  61. </div>
  62. <hr>
  63. <a name="GDB_002fMI-Support-Commands-1"></a>
  64. <h3 class="section">27.23 <small>GDB/MI</small> Support Commands</h3>
  65. <p>Since new commands and features get regularly added to <small>GDB/MI</small>,
  66. some commands are available to help front-ends query the debugger
  67. about support for these capabilities. Similarly, it is also possible
  68. to query <small>GDB</small> about target support of certain features.
  69. </p>
  70. <a name="The-_002dinfo_002dgdb_002dmi_002dcommand-Command"></a>
  71. <h4 class="subheading">The <code>-info-gdb-mi-command</code> Command</h4>
  72. <a name="index-_002dinfo_002dgdb_002dmi_002dcommand"></a>
  73. <a name="index-_002dinfo_002dgdb_002dmi_002dcommand-1"></a>
  74. <a name="Synopsis-103"></a>
  75. <h4 class="subsubheading">Synopsis</h4>
  76. <div class="smallexample">
  77. <pre class="smallexample"> -info-gdb-mi-command <var>cmd_name</var>
  78. </pre></div>
  79. <p>Query support for the <small>GDB/MI</small> command named <var>cmd_name</var>.
  80. </p>
  81. <p>Note that the dash (<code>-</code>) starting all <small>GDB/MI</small> commands
  82. 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,
  83. for ease of use, this command also accepts the form with the leading
  84. dash.
  85. </p>
  86. <a name="GDB-Command-85"></a>
  87. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  88. <p>There is no corresponding <small>GDB</small> command.
  89. </p>
  90. <a name="Result-8"></a>
  91. <h4 class="subsubheading">Result</h4>
  92. <p>The result is a tuple. There is currently only one field:
  93. </p>
  94. <dl compact="compact">
  95. <dt>&lsquo;<samp>exists</samp>&rsquo;</dt>
  96. <dd><p>This field is equal to <code>&quot;true&quot;</code> if the <small>GDB/MI</small> command exists,
  97. <code>&quot;false&quot;</code> otherwise.
  98. </p>
  99. </dd>
  100. </dl>
  101. <a name="Example-85"></a>
  102. <h4 class="subsubheading">Example</h4>
  103. <p>Here is an example where the <small>GDB/MI</small> command does not exist:
  104. </p>
  105. <div class="smallexample">
  106. <pre class="smallexample">-info-gdb-mi-command unsupported-command
  107. ^done,command={exists=&quot;false&quot;}
  108. </pre></div>
  109. <p>And here is an example where the <small>GDB/MI</small> command is known
  110. to the debugger:
  111. </p>
  112. <div class="smallexample">
  113. <pre class="smallexample">-info-gdb-mi-command symbol-list-lines
  114. ^done,command={exists=&quot;true&quot;}
  115. </pre></div>
  116. <a name="The-_002dlist_002dfeatures-Command"></a>
  117. <h4 class="subheading">The <code>-list-features</code> Command</h4>
  118. <a name="index-_002dlist_002dfeatures"></a>
  119. <a name="index-supported-GDB_002fMI-features_002c-list"></a>
  120. <p>Returns a list of particular features of the MI protocol that
  121. this version of gdb implements. A feature can be a command,
  122. or a new field in an output of some command, or even an
  123. important bugfix. While a frontend can sometimes detect presence
  124. of a feature at runtime, it is easier to perform detection at debugger
  125. startup.
  126. </p>
  127. <p>The command returns a list of strings, with each string naming an
  128. available feature. Each returned string is just a name, it does not
  129. have any internal structure. The list of possible feature names
  130. is given below.
  131. </p>
  132. <p>Example output:
  133. </p>
  134. <div class="smallexample">
  135. <pre class="smallexample">(gdb) -list-features
  136. ^done,result=[&quot;feature1&quot;,&quot;feature2&quot;]
  137. </pre></div>
  138. <p>The current list of features is:
  139. </p>
  140. <dl compact="compact">
  141. <dt>&lsquo;<samp>frozen-varobjs</samp>&rsquo;
  142. <a name="index-frozen_002dvarobjs"></a>
  143. </dt>
  144. <dd><p>Indicates support for the <code>-var-set-frozen</code> command, as well
  145. as possible presence of the <code>frozen</code> field in the output
  146. of <code>-varobj-create</code>.
  147. </p></dd>
  148. <dt>&lsquo;<samp>pending-breakpoints</samp>&rsquo;
  149. <a name="index-pending_002dbreakpoints"></a>
  150. </dt>
  151. <dd><p>Indicates support for the <samp>-f</samp> option to the <code>-break-insert</code>
  152. command.
  153. </p></dd>
  154. <dt>&lsquo;<samp>python</samp>&rsquo;
  155. <a name="index-python"></a>
  156. </dt>
  157. <dd><p>Indicates Python scripting support, Python-based
  158. pretty-printing commands, and possible presence of the
  159. &lsquo;<samp>display_hint</samp>&rsquo; field in the output of <code>-var-list-children</code>
  160. </p></dd>
  161. <dt>&lsquo;<samp>thread-info</samp>&rsquo;
  162. <a name="index-thread_002dinfo"></a>
  163. </dt>
  164. <dd><p>Indicates support for the <code>-thread-info</code> command.
  165. </p></dd>
  166. <dt>&lsquo;<samp>data-read-memory-bytes</samp>&rsquo;
  167. <a name="index-data_002dread_002dmemory_002dbytes"></a>
  168. </dt>
  169. <dd><p>Indicates support for the <code>-data-read-memory-bytes</code> and the
  170. <code>-data-write-memory-bytes</code> commands.
  171. </p></dd>
  172. <dt>&lsquo;<samp>breakpoint-notifications</samp>&rsquo;
  173. <a name="index-breakpoint_002dnotifications"></a>
  174. </dt>
  175. <dd><p>Indicates that changes to breakpoints and breakpoints created via the
  176. CLI will be announced via async records.
  177. </p></dd>
  178. <dt>&lsquo;<samp>ada-task-info</samp>&rsquo;
  179. <a name="index-ada_002dtask_002dinfo"></a>
  180. </dt>
  181. <dd><p>Indicates support for the <code>-ada-task-info</code> command.
  182. </p></dd>
  183. <dt>&lsquo;<samp>language-option</samp>&rsquo;
  184. <a name="index-language_002doption"></a>
  185. </dt>
  186. <dd><p>Indicates that all <small>GDB/MI</small> commands accept the <samp>--language</samp>
  187. option (see <a href="Context-management.html#Context-management">Context management</a>).
  188. </p></dd>
  189. <dt>&lsquo;<samp>info-gdb-mi-command</samp>&rsquo;
  190. <a name="index-info_002dgdb_002dmi_002dcommand"></a>
  191. </dt>
  192. <dd><p>Indicates support for the <code>-info-gdb-mi-command</code> command.
  193. </p></dd>
  194. <dt>&lsquo;<samp>undefined-command-error-code</samp>&rsquo;
  195. <a name="index-undefined_002dcommand_002derror_002dcode"></a>
  196. </dt>
  197. <dd><p>Indicates support for the &quot;undefined-command&quot; error code in error result
  198. records, produced when trying to execute an undefined <small>GDB/MI</small> command
  199. (see <a href="GDB_002fMI-Result-Records.html#GDB_002fMI-Result-Records">GDB/MI Result Records</a>).
  200. </p></dd>
  201. <dt>&lsquo;<samp>exec-run-start-option</samp>&rsquo;
  202. <a name="index-exec_002drun_002dstart_002doption"></a>
  203. </dt>
  204. <dd><p>Indicates that the <code>-exec-run</code> command supports the <samp>--start</samp>
  205. option (see <a href="GDB_002fMI-Program-Execution.html#GDB_002fMI-Program-Execution">GDB/MI Program Execution</a>).
  206. </p></dd>
  207. <dt>&lsquo;<samp>data-disassemble-a-option</samp>&rsquo;
  208. <a name="index-data_002ddisassemble_002da_002doption"></a>
  209. </dt>
  210. <dd><p>Indicates that the <code>-data-disassemble</code> command supports the <samp>-a</samp>
  211. option (see <a href="GDB_002fMI-Data-Manipulation.html#GDB_002fMI-Data-Manipulation">GDB/MI Data Manipulation</a>).
  212. </p></dd>
  213. </dl>
  214. <a name="The-_002dlist_002dtarget_002dfeatures-Command"></a>
  215. <h4 class="subheading">The <code>-list-target-features</code> Command</h4>
  216. <a name="index-_002dlist_002dtarget_002dfeatures"></a>
  217. <p>Returns a list of particular features that are supported by the
  218. target. Those features affect the permitted MI commands, but
  219. unlike the features reported by the <code>-list-features</code> command, the
  220. features depend on which target GDB is using at the moment. Whenever
  221. a target can change, due to commands such as <code>-target-select</code>,
  222. <code>-target-attach</code> or <code>-exec-run</code>, the list of target features
  223. may change, and the frontend should obtain it again.
  224. Example output:
  225. </p>
  226. <div class="smallexample">
  227. <pre class="smallexample">(gdb) -list-target-features
  228. ^done,result=[&quot;async&quot;]
  229. </pre></div>
  230. <p>The current list of features is:
  231. </p>
  232. <dl compact="compact">
  233. <dt>&lsquo;<samp>async</samp>&rsquo;</dt>
  234. <dd><p>Indicates that the target is capable of asynchronous command
  235. execution, which means that <small>GDB</small> will accept further commands
  236. while the target is running.
  237. </p>
  238. </dd>
  239. <dt>&lsquo;<samp>reverse</samp>&rsquo;</dt>
  240. <dd><p>Indicates that the target is capable of reverse execution.
  241. See <a href="Reverse-Execution.html#Reverse-Execution">Reverse Execution</a>, for more information.
  242. </p>
  243. </dd>
  244. </dl>
  245. <hr>
  246. <div class="header">
  247. <p>
  248. Next: <a href="GDB_002fMI-Miscellaneous-Commands.html#GDB_002fMI-Miscellaneous-Commands" accesskey="n" rel="next">GDB/MI Miscellaneous Commands</a>, Previous: <a href="GDB_002fMI-Ada-Exceptions-Commands.html#GDB_002fMI-Ada-Exceptions-Commands" accesskey="p" rel="prev">GDB/MI Ada Exceptions Commands</a>, Up: <a href="GDB_002fMI.html#GDB_002fMI" accesskey="u" rel="up">GDB/MI</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
  249. </div>
  250. </body>
  251. </html>