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.

GDB_002fMI-Output-Syntax.html 10KB

3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  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 Output Syntax (Debugging with GDB)</title>
  17. <meta name="description" content="GDB/MI Output Syntax (Debugging with GDB)">
  18. <meta name="keywords" content="GDB/MI Output Syntax (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-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="prev" title="GDB/MI Input Syntax">
  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-Output-Syntax"></a>
  58. <div class="header">
  59. <p>
  60. Previous: <a href="GDB_002fMI-Input-Syntax.html#GDB_002fMI-Input-Syntax" accesskey="p" rel="prev">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>
  61. </div>
  62. <hr>
  63. <a name="GDB_002fMI-Output-Syntax-1"></a>
  64. <h4 class="subsection">27.2.2 <small>GDB/MI</small> Output Syntax</h4>
  65. <a name="index-output-syntax-of-GDB_002fMI"></a>
  66. <a name="index-GDB_002fMI_002c-output-syntax"></a>
  67. <p>The output from <small>GDB/MI</small> consists of zero or more out-of-band records
  68. followed, optionally, by a single result record. This result record
  69. is for the most recent command. The sequence of output records is
  70. terminated by &lsquo;<samp>(gdb)</samp>&rsquo;.
  71. </p>
  72. <p>If an input command was prefixed with a <code><var>token</var></code> then the
  73. corresponding output for that command will also be prefixed by that same
  74. <var>token</var>.
  75. </p>
  76. <dl compact="compact">
  77. <dt><code><var>output</var> &rarr;</code></dt>
  78. <dd><p><code>( <var>out-of-band-record</var> )* [ <var>result-record</var> ] &quot;(gdb)&quot; <var>nl</var></code>
  79. </p>
  80. </dd>
  81. <dt><code><var>result-record</var> &rarr;</code></dt>
  82. <dd><p><code> [ <var>token</var> ] &quot;^&quot; <var>result-class</var> ( &quot;,&quot; <var>result</var> )* <var>nl</var></code>
  83. </p>
  84. </dd>
  85. <dt><code><var>out-of-band-record</var> &rarr;</code></dt>
  86. <dd><p><code><var>async-record</var> | <var>stream-record</var></code>
  87. </p>
  88. </dd>
  89. <dt><code><var>async-record</var> &rarr;</code></dt>
  90. <dd><p><code><var>exec-async-output</var> | <var>status-async-output</var> | <var>notify-async-output</var></code>
  91. </p>
  92. </dd>
  93. <dt><code><var>exec-async-output</var> &rarr;</code></dt>
  94. <dd><p><code>[ <var>token</var> ] &quot;*&quot; <var>async-output nl</var></code>
  95. </p>
  96. </dd>
  97. <dt><code><var>status-async-output</var> &rarr;</code></dt>
  98. <dd><p><code>[ <var>token</var> ] &quot;+&quot; <var>async-output nl</var></code>
  99. </p>
  100. </dd>
  101. <dt><code><var>notify-async-output</var> &rarr;</code></dt>
  102. <dd><p><code>[ <var>token</var> ] &quot;=&quot; <var>async-output nl</var></code>
  103. </p>
  104. </dd>
  105. <dt><code><var>async-output</var> &rarr;</code></dt>
  106. <dd><p><code><var>async-class</var> ( &quot;,&quot; <var>result</var> )*</code>
  107. </p>
  108. </dd>
  109. <dt><code><var>result-class</var> &rarr;</code></dt>
  110. <dd><p><code>&quot;done&quot; | &quot;running&quot; | &quot;connected&quot; | &quot;error&quot; | &quot;exit&quot;</code>
  111. </p>
  112. </dd>
  113. <dt><code><var>async-class</var> &rarr;</code></dt>
  114. <dd><p><code>&quot;stopped&quot; | <var>others</var></code> (where <var>others</var> will be added
  115. depending on the needs&mdash;this is still in development).
  116. </p>
  117. </dd>
  118. <dt><code><var>result</var> &rarr;</code></dt>
  119. <dd><p><code> <var>variable</var> &quot;=&quot; <var>value</var></code>
  120. </p>
  121. </dd>
  122. <dt><code><var>variable</var> &rarr;</code></dt>
  123. <dd><p><code> <var>string</var> </code>
  124. </p>
  125. </dd>
  126. <dt><code><var>value</var> &rarr;</code></dt>
  127. <dd><p><code> <var>const</var> | <var>tuple</var> | <var>list</var> </code>
  128. </p>
  129. </dd>
  130. <dt><code><var>const</var> &rarr;</code></dt>
  131. <dd><p><code><var>c-string</var></code>
  132. </p>
  133. </dd>
  134. <dt><code><var>tuple</var> &rarr;</code></dt>
  135. <dd><p><code> &quot;{}&quot; | &quot;{&quot; <var>result</var> ( &quot;,&quot; <var>result</var> )* &quot;}&quot; </code>
  136. </p>
  137. </dd>
  138. <dt><code><var>list</var> &rarr;</code></dt>
  139. <dd><p><code> &quot;[]&quot; | &quot;[&quot; <var>value</var> ( &quot;,&quot; <var>value</var> )* &quot;]&quot; | &quot;[&quot;
  140. <var>result</var> ( &quot;,&quot; <var>result</var> )* &quot;]&quot; </code>
  141. </p>
  142. </dd>
  143. <dt><code><var>stream-record</var> &rarr;</code></dt>
  144. <dd><p><code><var>console-stream-output</var> | <var>target-stream-output</var> | <var>log-stream-output</var></code>
  145. </p>
  146. </dd>
  147. <dt><code><var>console-stream-output</var> &rarr;</code></dt>
  148. <dd><p><code>&quot;~&quot; <var>c-string nl</var></code>
  149. </p>
  150. </dd>
  151. <dt><code><var>target-stream-output</var> &rarr;</code></dt>
  152. <dd><p><code>&quot;@&quot; <var>c-string nl</var></code>
  153. </p>
  154. </dd>
  155. <dt><code><var>log-stream-output</var> &rarr;</code></dt>
  156. <dd><p><code>&quot;&amp;&quot; <var>c-string nl</var></code>
  157. </p>
  158. </dd>
  159. <dt><code><var>nl</var> &rarr;</code></dt>
  160. <dd><p><code>CR | CR-LF</code>
  161. </p>
  162. </dd>
  163. <dt><code><var>token</var> &rarr;</code></dt>
  164. <dd><p><em>any sequence of digits</em>.
  165. </p></dd>
  166. </dl>
  167. <p>Notes:
  168. </p>
  169. <ul>
  170. <li> All output sequences end in a single line containing a period.
  171. </li><li> The <code><var>token</var></code> is from the corresponding request. Note that
  172. for all async output, while the token is allowed by the grammar and
  173. may be output by future versions of <small>GDB</small> for select async
  174. output messages, it is generally omitted. Frontends should treat
  175. all async output as reporting general changes in the state of the
  176. target and there should be no need to associate async output to any
  177. prior command.
  178. </li><li> <a name="index-status-output-in-GDB_002fMI"></a>
  179. <var>status-async-output</var> contains on-going status information about the
  180. progress of a slow operation. It can be discarded. All status output is
  181. prefixed by &lsquo;<samp>+</samp>&rsquo;.
  182. </li><li> <a name="index-async-output-in-GDB_002fMI"></a>
  183. <var>exec-async-output</var> contains asynchronous state change on the target
  184. (stopped, started, disappeared). All async output is prefixed by
  185. &lsquo;<samp>*</samp>&rsquo;.
  186. </li><li> <a name="index-notify-output-in-GDB_002fMI"></a>
  187. <var>notify-async-output</var> contains supplementary information that the
  188. client should handle (e.g., a new breakpoint information). All notify
  189. output is prefixed by &lsquo;<samp>=</samp>&rsquo;.
  190. </li><li> <a name="index-console-output-in-GDB_002fMI"></a>
  191. <var>console-stream-output</var> is output that should be displayed as is in the
  192. console. It is the textual response to a CLI command. All the console
  193. output is prefixed by &lsquo;<samp>~</samp>&rsquo;.
  194. </li><li> <a name="index-target-output-in-GDB_002fMI"></a>
  195. <var>target-stream-output</var> is the output produced by the target program.
  196. All the target output is prefixed by &lsquo;<samp>@</samp>&rsquo;.
  197. </li><li> <a name="index-log-output-in-GDB_002fMI"></a>
  198. <var>log-stream-output</var> is output text coming from <small>GDB</small>&rsquo;s internals, for
  199. instance messages that should be displayed as part of an error log. All
  200. the log output is prefixed by &lsquo;<samp>&amp;</samp>&rsquo;.
  201. </li><li> <a name="index-list-output-in-GDB_002fMI"></a>
  202. New <small>GDB/MI</small> commands should only output <var>lists</var> containing
  203. <var>values</var>.
  204. </li></ul>
  205. <p>See <a href="GDB_002fMI-Stream-Records.html#GDB_002fMI-Stream-Records"><small>GDB/MI</small> Stream Records</a>, for more
  206. details about the various output records.
  207. </p>
  208. <hr>
  209. <div class="header">
  210. <p>
  211. Previous: <a href="GDB_002fMI-Input-Syntax.html#GDB_002fMI-Input-Syntax" accesskey="p" rel="prev">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>
  212. </div>
  213. </body>
  214. </html>