GDB_002fMI-Output-Syntax.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  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 5.1, http://www.gnu.org/software/texinfo/ -->
  14. <head>
  15. <title>Debugging with GDB: GDB/MI Output Syntax</title>
  16. <meta name="description" content="Debugging with GDB: GDB/MI Output Syntax">
  17. <meta name="keywords" content="Debugging with GDB: GDB/MI Output Syntax">
  18. <meta name="resource-type" content="document">
  19. <meta name="distribution" content="global">
  20. <meta name="Generator" content="makeinfo">
  21. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  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-Command-Syntax.html#GDB_002fMI-Command-Syntax" rel="up" title="GDB/MI Command Syntax">
  26. <link href="GDB_002fMI-Compatibility-with-CLI.html#GDB_002fMI-Compatibility-with-CLI" rel="next" title="GDB/MI Compatibility with CLI">
  27. <link href="GDB_002fMI-Input-Syntax.html#GDB_002fMI-Input-Syntax" rel="previous" title="GDB/MI Input Syntax">
  28. <style type="text/css">
  29. <!--
  30. a.summary-letter {text-decoration: none}
  31. blockquote.smallquotation {font-size: smaller}
  32. div.display {margin-left: 3.2em}
  33. div.example {margin-left: 3.2em}
  34. div.indentedblock {margin-left: 3.2em}
  35. div.lisp {margin-left: 3.2em}
  36. div.smalldisplay {margin-left: 3.2em}
  37. div.smallexample {margin-left: 3.2em}
  38. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  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.nocodebreak {white-space:nowrap}
  50. span.nolinebreak {white-space:nowrap}
  51. span.roman {font-family:serif; font-weight:normal}
  52. span.sansserif {font-family:sans-serif; font-weight:normal}
  53. ul.no-bullet {list-style: none}
  54. -->
  55. </style>
  56. </head>
  57. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  58. <a name="GDB_002fMI-Output-Syntax"></a>
  59. <div class="header">
  60. <p>
  61. Previous: <a href="GDB_002fMI-Input-Syntax.html#GDB_002fMI-Input-Syntax" accesskey="p" rel="previous">GDB/MI Input Syntax</a>, Up: <a href="GDB_002fMI-Command-Syntax.html#GDB_002fMI-Command-Syntax" accesskey="u" rel="up">GDB/MI Command Syntax</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>
  62. </div>
  63. <hr>
  64. <a name="GDB_002fMI-Output-Syntax-1"></a>
  65. <h4 class="subsection">27.2.2 <small>GDB/MI</small> Output Syntax</h4>
  66. <a name="index-output-syntax-of-GDB_002fMI"></a>
  67. <a name="index-GDB_002fMI_002c-output-syntax"></a>
  68. <p>The output from <small>GDB/MI</small> consists of zero or more out-of-band records
  69. followed, optionally, by a single result record. This result record
  70. is for the most recent command. The sequence of output records is
  71. terminated by &lsquo;<samp>(gdb)</samp>&rsquo;.
  72. </p>
  73. <p>If an input command was prefixed with a <code><var>token</var></code> then the
  74. corresponding output for that command will also be prefixed by that same
  75. <var>token</var>.
  76. </p>
  77. <dl compact="compact">
  78. <dt><code><var>output</var> &rarr;</code></dt>
  79. <dd><p><code>( <var>out-of-band-record</var> )* [ <var>result-record</var> ] &quot;(gdb)&quot; <var>nl</var></code>
  80. </p>
  81. </dd>
  82. <dt><code><var>result-record</var> &rarr;</code></dt>
  83. <dd><p><code> [ <var>token</var> ] &quot;^&quot; <var>result-class</var> ( &quot;,&quot; <var>result</var> )* <var>nl</var></code>
  84. </p>
  85. </dd>
  86. <dt><code><var>out-of-band-record</var> &rarr;</code></dt>
  87. <dd><p><code><var>async-record</var> | <var>stream-record</var></code>
  88. </p>
  89. </dd>
  90. <dt><code><var>async-record</var> &rarr;</code></dt>
  91. <dd><p><code><var>exec-async-output</var> | <var>status-async-output</var> | <var>notify-async-output</var></code>
  92. </p>
  93. </dd>
  94. <dt><code><var>exec-async-output</var> &rarr;</code></dt>
  95. <dd><p><code>[ <var>token</var> ] &quot;*&quot; <var>async-output nl</var></code>
  96. </p>
  97. </dd>
  98. <dt><code><var>status-async-output</var> &rarr;</code></dt>
  99. <dd><p><code>[ <var>token</var> ] &quot;+&quot; <var>async-output nl</var></code>
  100. </p>
  101. </dd>
  102. <dt><code><var>notify-async-output</var> &rarr;</code></dt>
  103. <dd><p><code>[ <var>token</var> ] &quot;=&quot; <var>async-output nl</var></code>
  104. </p>
  105. </dd>
  106. <dt><code><var>async-output</var> &rarr;</code></dt>
  107. <dd><p><code><var>async-class</var> ( &quot;,&quot; <var>result</var> )*</code>
  108. </p>
  109. </dd>
  110. <dt><code><var>result-class</var> &rarr;</code></dt>
  111. <dd><p><code>&quot;done&quot; | &quot;running&quot; | &quot;connected&quot; | &quot;error&quot; | &quot;exit&quot;</code>
  112. </p>
  113. </dd>
  114. <dt><code><var>async-class</var> &rarr;</code></dt>
  115. <dd><p><code>&quot;stopped&quot; | <var>others</var></code> (where <var>others</var> will be added
  116. depending on the needs&mdash;this is still in development).
  117. </p>
  118. </dd>
  119. <dt><code><var>result</var> &rarr;</code></dt>
  120. <dd><p><code> <var>variable</var> &quot;=&quot; <var>value</var></code>
  121. </p>
  122. </dd>
  123. <dt><code><var>variable</var> &rarr;</code></dt>
  124. <dd><p><code> <var>string</var> </code>
  125. </p>
  126. </dd>
  127. <dt><code><var>value</var> &rarr;</code></dt>
  128. <dd><p><code> <var>const</var> | <var>tuple</var> | <var>list</var> </code>
  129. </p>
  130. </dd>
  131. <dt><code><var>const</var> &rarr;</code></dt>
  132. <dd><p><code><var>c-string</var></code>
  133. </p>
  134. </dd>
  135. <dt><code><var>tuple</var> &rarr;</code></dt>
  136. <dd><p><code> &quot;{}&quot; | &quot;{&quot; <var>result</var> ( &quot;,&quot; <var>result</var> )* &quot;}&quot; </code>
  137. </p>
  138. </dd>
  139. <dt><code><var>list</var> &rarr;</code></dt>
  140. <dd><p><code> &quot;[]&quot; | &quot;[&quot; <var>value</var> ( &quot;,&quot; <var>value</var> )* &quot;]&quot; | &quot;[&quot;
  141. <var>result</var> ( &quot;,&quot; <var>result</var> )* &quot;]&quot; </code>
  142. </p>
  143. </dd>
  144. <dt><code><var>stream-record</var> &rarr;</code></dt>
  145. <dd><p><code><var>console-stream-output</var> | <var>target-stream-output</var> | <var>log-stream-output</var></code>
  146. </p>
  147. </dd>
  148. <dt><code><var>console-stream-output</var> &rarr;</code></dt>
  149. <dd><p><code>&quot;~&quot; <var>c-string nl</var></code>
  150. </p>
  151. </dd>
  152. <dt><code><var>target-stream-output</var> &rarr;</code></dt>
  153. <dd><p><code>&quot;@&quot; <var>c-string nl</var></code>
  154. </p>
  155. </dd>
  156. <dt><code><var>log-stream-output</var> &rarr;</code></dt>
  157. <dd><p><code>&quot;&amp;&quot; <var>c-string nl</var></code>
  158. </p>
  159. </dd>
  160. <dt><code><var>nl</var> &rarr;</code></dt>
  161. <dd><p><code>CR | CR-LF</code>
  162. </p>
  163. </dd>
  164. <dt><code><var>token</var> &rarr;</code></dt>
  165. <dd><p><em>any sequence of digits</em>.
  166. </p></dd>
  167. </dl>
  168. <p>Notes:
  169. </p>
  170. <ul>
  171. <li> All output sequences end in a single line containing a period.
  172. </li><li> The <code><var>token</var></code> is from the corresponding request. Note that
  173. for all async output, while the token is allowed by the grammar and
  174. may be output by future versions of <small>GDB</small> for select async
  175. output messages, it is generally omitted. Frontends should treat
  176. all async output as reporting general changes in the state of the
  177. target and there should be no need to associate async output to any
  178. prior command.
  179. </li><li> <a name="index-status-output-in-GDB_002fMI"></a>
  180. <var>status-async-output</var> contains on-going status information about the
  181. progress of a slow operation. It can be discarded. All status output is
  182. prefixed by &lsquo;<samp>+</samp>&rsquo;.
  183. </li><li> <a name="index-async-output-in-GDB_002fMI"></a>
  184. <var>exec-async-output</var> contains asynchronous state change on the target
  185. (stopped, started, disappeared). All async output is prefixed by
  186. &lsquo;<samp>*</samp>&rsquo;.
  187. </li><li> <a name="index-notify-output-in-GDB_002fMI"></a>
  188. <var>notify-async-output</var> contains supplementary information that the
  189. client should handle (e.g., a new breakpoint information). All notify
  190. output is prefixed by &lsquo;<samp>=</samp>&rsquo;.
  191. </li><li> <a name="index-console-output-in-GDB_002fMI"></a>
  192. <var>console-stream-output</var> is output that should be displayed as is in the
  193. console. It is the textual response to a CLI command. All the console
  194. output is prefixed by &lsquo;<samp>~</samp>&rsquo;.
  195. </li><li> <a name="index-target-output-in-GDB_002fMI"></a>
  196. <var>target-stream-output</var> is the output produced by the target program.
  197. All the target output is prefixed by &lsquo;<samp>@</samp>&rsquo;.
  198. </li><li> <a name="index-log-output-in-GDB_002fMI"></a>
  199. <var>log-stream-output</var> is output text coming from <small>GDB</small>&rsquo;s internals, for
  200. instance messages that should be displayed as part of an error log. All
  201. the log output is prefixed by &lsquo;<samp>&amp;</samp>&rsquo;.
  202. </li><li> <a name="index-list-output-in-GDB_002fMI"></a>
  203. New <small>GDB/MI</small> commands should only output <var>lists</var> containing
  204. <var>values</var>.
  205. </li></ul>
  206. <p>See <a href="GDB_002fMI-Stream-Records.html#GDB_002fMI-Stream-Records"><small>GDB/MI</small> Stream Records</a>, for more
  207. details about the various output records.
  208. </p>
  209. <hr>
  210. <div class="header">
  211. <p>
  212. Previous: <a href="GDB_002fMI-Input-Syntax.html#GDB_002fMI-Input-Syntax" accesskey="p" rel="previous">GDB/MI Input Syntax</a>, Up: <a href="GDB_002fMI-Command-Syntax.html#GDB_002fMI-Command-Syntax" accesskey="u" rel="up">GDB/MI Command Syntax</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>
  213. </div>
  214. </body>
  215. </html>