Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

199 rindas
10KB

  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>Notification Packets (Debugging with GDB)</title>
  17. <meta name="description" content="Notification Packets (Debugging with GDB)">
  18. <meta name="keywords" content="Notification Packets (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="Remote-Protocol.html#Remote-Protocol" rel="up" title="Remote Protocol">
  26. <link href="Remote-Non_002dStop.html#Remote-Non_002dStop" rel="next" title="Remote Non-Stop">
  27. <link href="Interrupts.html#Interrupts" rel="prev" title="Interrupts">
  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="Notification-Packets"></a>
  58. <div class="header">
  59. <p>
  60. Next: <a href="Remote-Non_002dStop.html#Remote-Non_002dStop" accesskey="n" rel="next">Remote Non-Stop</a>, Previous: <a href="Interrupts.html#Interrupts" accesskey="p" rel="prev">Interrupts</a>, Up: <a href="Remote-Protocol.html#Remote-Protocol" accesskey="u" rel="up">Remote Protocol</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="Notification-Packets-1"></a>
  64. <h3 class="section">E.9 Notification Packets</h3>
  65. <a name="index-notification-packets"></a>
  66. <a name="index-packets_002c-notification"></a>
  67. <p>The <small>GDB</small> remote serial protocol includes <em>notifications</em>,
  68. packets that require no acknowledgment. Both the GDB and the stub
  69. may send notifications (although the only notifications defined at
  70. present are sent by the stub). Notifications carry information
  71. without incurring the round-trip latency of an acknowledgment, and so
  72. are useful for low-impact communications where occasional packet loss
  73. is not a problem.
  74. </p>
  75. <p>A notification packet has the form &lsquo;<samp>% <var>data</var> #
  76. <var>checksum</var></samp>&rsquo;, where <var>data</var> is the content of the notification,
  77. and <var>checksum</var> is a checksum of <var>data</var>, computed and formatted
  78. as for ordinary <small>GDB</small> packets. A notification&rsquo;s <var>data</var>
  79. never contains &lsquo;<samp>$</samp>&rsquo;, &lsquo;<samp>%</samp>&rsquo; or &lsquo;<samp>#</samp>&rsquo; characters. Upon
  80. receiving a notification, the recipient sends no &lsquo;<samp>+</samp>&rsquo; or &lsquo;<samp>-</samp>&rsquo;
  81. to acknowledge the notification&rsquo;s receipt or to report its corruption.
  82. </p>
  83. <p>Every notification&rsquo;s <var>data</var> begins with a name, which contains no
  84. colon characters, followed by a colon character.
  85. </p>
  86. <p>Recipients should silently ignore corrupted notifications and
  87. notifications they do not understand. Recipients should restart
  88. timeout periods on receipt of a well-formed notification, whether or
  89. not they understand it.
  90. </p>
  91. <p>Senders should only send the notifications described here when this
  92. protocol description specifies that they are permitted. In the
  93. future, we may extend the protocol to permit existing notifications in
  94. new contexts; this rule helps older senders avoid confusing newer
  95. recipients.
  96. </p>
  97. <p>(Older versions of <small>GDB</small> ignore bytes received until they see
  98. the &lsquo;<samp>$</samp>&rsquo; byte that begins an ordinary packet, so new stubs may
  99. transmit notifications without fear of confusing older clients. There
  100. are no notifications defined for <small>GDB</small> to send at the moment, but we
  101. assume that most older stubs would ignore them, as well.)
  102. </p>
  103. <p>Each notification is comprised of three parts:
  104. </p><dl compact="compact">
  105. <dt>&lsquo;<samp><var>name</var>:<var>event</var></samp>&rsquo;</dt>
  106. <dd><p>The notification packet is sent by the side that initiates the
  107. exchange (currently, only the stub does that), with <var>event</var>
  108. carrying the specific information about the notification, and
  109. <var>name</var> specifying the name of the notification.
  110. </p></dd>
  111. <dt>&lsquo;<samp><var>ack</var></samp>&rsquo;</dt>
  112. <dd><p>The acknowledge sent by the other side, usually <small>GDB</small>, to
  113. acknowledge the exchange and request the event.
  114. </p></dd>
  115. </dl>
  116. <p>The purpose of an asynchronous notification mechanism is to report to
  117. <small>GDB</small> that something interesting happened in the remote stub.
  118. </p>
  119. <p>The remote stub may send notification <var>name</var>:<var>event</var>
  120. at any time, but <small>GDB</small> acknowledges the notification when
  121. appropriate. The notification event is pending before <small>GDB</small>
  122. acknowledges. Only one notification at a time may be pending; if
  123. additional events occur before <small>GDB</small> has acknowledged the
  124. previous notification, they must be queued by the stub for later
  125. synchronous transmission in response to <var>ack</var> packets from
  126. <small>GDB</small>. Because the notification mechanism is unreliable,
  127. the stub is permitted to resend a notification if it believes
  128. <small>GDB</small> may not have received it.
  129. </p>
  130. <p>Specifically, notifications may appear when <small>GDB</small> is not
  131. otherwise reading input from the stub, or when <small>GDB</small> is
  132. expecting to read a normal synchronous response or a
  133. &lsquo;<samp>+</samp>&rsquo;/&lsquo;<samp>-</samp>&rsquo; acknowledgment to a packet it has sent.
  134. Notification packets are distinct from any other communication from
  135. the stub so there is no ambiguity.
  136. </p>
  137. <p>After receiving a notification, <small>GDB</small> shall acknowledge it by
  138. sending a <var>ack</var> packet as a regular, synchronous request to the
  139. stub. Such acknowledgment is not required to happen immediately, as
  140. <small>GDB</small> is permitted to send other, unrelated packets to the
  141. stub first, which the stub should process normally.
  142. </p>
  143. <p>Upon receiving a <var>ack</var> packet, if the stub has other queued
  144. events to report to <small>GDB</small>, it shall respond by sending a
  145. normal <var>event</var>. <small>GDB</small> shall then send another <var>ack</var>
  146. packet to solicit further responses; again, it is permitted to send
  147. other, unrelated packets as well which the stub should process
  148. normally.
  149. </p>
  150. <p>If the stub receives a <var>ack</var> packet and there are no additional
  151. <var>event</var> to report, the stub shall return an &lsquo;<samp>OK</samp>&rsquo; response.
  152. At this point, <small>GDB</small> has finished processing a notification
  153. and the stub has completed sending any queued events. <small>GDB</small>
  154. won&rsquo;t accept any new notifications until the final &lsquo;<samp>OK</samp>&rsquo; is
  155. received . If further notification events occur, the stub shall send
  156. a new notification, <small>GDB</small> shall accept the notification, and
  157. the process shall be repeated.
  158. </p>
  159. <p>The process of asynchronous notification can be illustrated by the
  160. following example:
  161. </p><div class="smallexample">
  162. <pre class="smallexample">&lt;- <code>%Stop:T0505:98e7ffbf;04:4ce6ffbf;08:b1b6e54c;thread:p7526.7526;core:0;</code>
  163. <code>...</code>
  164. -&gt; <code>vStopped</code>
  165. &lt;- <code>T0505:68f37db7;04:40f37db7;08:63850408;thread:p7526.7528;core:0;</code>
  166. -&gt; <code>vStopped</code>
  167. &lt;- <code>T0505:68e3fdb6;04:40e3fdb6;08:63850408;thread:p7526.7529;core:0;</code>
  168. -&gt; <code>vStopped</code>
  169. &lt;- <code>OK</code>
  170. </pre></div>
  171. <p>The following notifications are defined:
  172. </p><table>
  173. <tr><td width="12%">Notification</td><td width="12%">Ack</td><td width="38%">Event</td><td width="38%">Description</td></tr>
  174. <tr><td width="12%">Stop</td><td width="12%">vStopped</td><td width="38%"><var>reply</var>. The <var>reply</var> has the form of a stop reply, as
  175. described in <a href="Stop-Reply-Packets.html#Stop-Reply-Packets">Stop Reply Packets</a>. Refer to <a href="Remote-Non_002dStop.html#Remote-Non_002dStop">Remote Non-Stop</a>,
  176. for information on how these notifications are acknowledged by
  177. <small>GDB</small>.</td><td width="38%">Report an asynchronous stop event in non-stop mode.</td></tr>
  178. </table>
  179. <hr>
  180. <div class="header">
  181. <p>
  182. Next: <a href="Remote-Non_002dStop.html#Remote-Non_002dStop" accesskey="n" rel="next">Remote Non-Stop</a>, Previous: <a href="Interrupts.html#Interrupts" accesskey="p" rel="prev">Interrupts</a>, Up: <a href="Remote-Protocol.html#Remote-Protocol" accesskey="u" rel="up">Remote Protocol</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>
  183. </div>
  184. </body>
  185. </html>