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.

Remote-Non_002dStop.html 7.5KB

3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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>Remote Non-Stop (Debugging with GDB)</title>
  17. <meta name="description" content="Remote Non-Stop (Debugging with GDB)">
  18. <meta name="keywords" content="Remote Non-Stop (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="Packet-Acknowledgment.html#Packet-Acknowledgment" rel="next" title="Packet Acknowledgment">
  27. <link href="Notification-Packets.html#Notification-Packets" rel="prev" title="Notification Packets">
  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="Remote-Non_002dStop"></a>
  58. <div class="header">
  59. <p>
  60. Next: <a href="Packet-Acknowledgment.html#Packet-Acknowledgment" accesskey="n" rel="next">Packet Acknowledgment</a>, Previous: <a href="Notification-Packets.html#Notification-Packets" accesskey="p" rel="prev">Notification Packets</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="Remote-Protocol-Support-for-Non_002dStop-Mode"></a>
  64. <h3 class="section">E.10 Remote Protocol Support for Non-Stop Mode</h3>
  65. <p><small>GDB</small>&rsquo;s remote protocol supports non-stop debugging of
  66. multi-threaded programs, as described in <a href="Non_002dStop-Mode.html#Non_002dStop-Mode">Non-Stop Mode</a>. If the stub
  67. supports non-stop mode, it should report that to <small>GDB</small> by including
  68. &lsquo;<samp>QNonStop+</samp>&rsquo; in its &lsquo;<samp>qSupported</samp>&rsquo; response (see <a href="General-Query-Packets.html#qSupported">qSupported</a>).
  69. </p>
  70. <p><small>GDB</small> typically sends a &lsquo;<samp>QNonStop</samp>&rsquo; packet only when
  71. establishing a new connection with the stub. Entering non-stop mode
  72. does not alter the state of any currently-running threads, but targets
  73. must stop all threads in any already-attached processes when entering
  74. all-stop mode. <small>GDB</small> uses the &lsquo;<samp>?</samp>&rsquo; packet as necessary to
  75. probe the target state after a mode change.
  76. </p>
  77. <p>In non-stop mode, when an attached process encounters an event that
  78. would otherwise be reported with a stop reply, it uses the
  79. asynchronous notification mechanism (see <a href="Notification-Packets.html#Notification-Packets">Notification Packets</a>) to
  80. inform <small>GDB</small>. In contrast to all-stop mode, where all threads
  81. in all processes are stopped when a stop reply is sent, in non-stop
  82. mode only the thread reporting the stop event is stopped. That is,
  83. when reporting a &lsquo;<samp>S</samp>&rsquo; or &lsquo;<samp>T</samp>&rsquo; response to indicate completion
  84. of a step operation, hitting a breakpoint, or a fault, only the
  85. affected thread is stopped; any other still-running threads continue
  86. to run. When reporting a &lsquo;<samp>W</samp>&rsquo; or &lsquo;<samp>X</samp>&rsquo; response, all running
  87. threads belonging to other attached processes continue to run.
  88. </p>
  89. <p>In non-stop mode, the target shall respond to the &lsquo;<samp>?</samp>&rsquo; packet as
  90. follows. First, any incomplete stop reply notification/&lsquo;<samp>vStopped</samp>&rsquo;
  91. sequence in progress is abandoned. The target must begin a new
  92. sequence reporting stop events for all stopped threads, whether or not
  93. it has previously reported those events to <small>GDB</small>. The first
  94. stop reply is sent as a synchronous reply to the &lsquo;<samp>?</samp>&rsquo; packet, and
  95. subsequent stop replies are sent as responses to &lsquo;<samp>vStopped</samp>&rsquo; packets
  96. using the mechanism described above. The target must not send
  97. asynchronous stop reply notifications until the sequence is complete.
  98. If all threads are running when the target receives the &lsquo;<samp>?</samp>&rsquo; packet,
  99. or if the target is not attached to any process, it shall respond
  100. &lsquo;<samp>OK</samp>&rsquo;.
  101. </p>
  102. <p>If the stub supports non-stop mode, it should also support the
  103. &lsquo;<samp>swbreak</samp>&rsquo; stop reason if software breakpoints are supported, and
  104. the &lsquo;<samp>hwbreak</samp>&rsquo; stop reason if hardware breakpoints are supported
  105. (see <a href="Stop-Reply-Packets.html#swbreak-stop-reason">swbreak stop reason</a>). This is because given the asynchronous
  106. nature of non-stop mode, between the time a thread hits a breakpoint
  107. and the time the event is finally processed by <small>GDB</small>, the
  108. breakpoint may have already been removed from the target. Due to
  109. this, <small>GDB</small> needs to be able to tell whether a trap stop was
  110. caused by a delayed breakpoint event, which should be ignored, as
  111. opposed to a random trap signal, which should be reported to the user.
  112. Note the &lsquo;<samp>swbreak</samp>&rsquo; feature implies that the target is responsible
  113. for adjusting the PC when a software breakpoint triggers, if
  114. necessary, such as on the x86 architecture.
  115. </p>
  116. <hr>
  117. <div class="header">
  118. <p>
  119. Next: <a href="Packet-Acknowledgment.html#Packet-Acknowledgment" accesskey="n" rel="next">Packet Acknowledgment</a>, Previous: <a href="Notification-Packets.html#Notification-Packets" accesskey="p" rel="prev">Notification Packets</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>
  120. </div>
  121. </body>
  122. </html>