No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

Non_002dStop-Mode.html 7.7KB

hace 3 años
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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>Non-Stop Mode (Debugging with GDB)</title>
  17. <meta name="description" content="Non-Stop Mode (Debugging with GDB)">
  18. <meta name="keywords" content="Non-Stop Mode (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="Thread-Stops.html#Thread-Stops" rel="up" title="Thread Stops">
  26. <link href="Background-Execution.html#Background-Execution" rel="next" title="Background Execution">
  27. <link href="All_002dStop-Mode.html#All_002dStop-Mode" rel="prev" title="All-Stop Mode">
  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="Non_002dStop-Mode"></a>
  58. <div class="header">
  59. <p>
  60. Next: <a href="Background-Execution.html#Background-Execution" accesskey="n" rel="next">Background Execution</a>, Previous: <a href="All_002dStop-Mode.html#All_002dStop-Mode" accesskey="p" rel="prev">All-Stop Mode</a>, Up: <a href="Thread-Stops.html#Thread-Stops" accesskey="u" rel="up">Thread Stops</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="Non_002dStop-Mode-1"></a>
  64. <h4 class="subsection">5.5.2 Non-Stop Mode</h4>
  65. <a name="index-non_002dstop-mode"></a>
  66. <p>For some multi-threaded targets, <small>GDB</small> supports an optional
  67. mode of operation in which you can examine stopped program threads in
  68. the debugger while other threads continue to execute freely. This
  69. minimizes intrusion when debugging live systems, such as programs
  70. where some threads have real-time constraints or must continue to
  71. respond to external events. This is referred to as <em>non-stop</em> mode.
  72. </p>
  73. <p>In non-stop mode, when a thread stops to report a debugging event,
  74. <em>only</em> that thread is stopped; <small>GDB</small> does not stop other
  75. threads as well, in contrast to the all-stop mode behavior. Additionally,
  76. execution commands such as <code>continue</code> and <code>step</code> apply by default
  77. only to the current thread in non-stop mode, rather than all threads as
  78. in all-stop mode. This allows you to control threads explicitly in
  79. ways that are not possible in all-stop mode &mdash; for example, stepping
  80. one thread while allowing others to run freely, stepping
  81. one thread while holding all others stopped, or stepping several threads
  82. independently and simultaneously.
  83. </p>
  84. <p>To enter non-stop mode, use this sequence of commands before you run
  85. or attach to your program:
  86. </p>
  87. <div class="smallexample">
  88. <pre class="smallexample"># If using the CLI, pagination breaks non-stop.
  89. set pagination off
  90. # Finally, turn it on!
  91. set non-stop on
  92. </pre></div>
  93. <p>You can use these commands to manipulate the non-stop mode setting:
  94. </p>
  95. <dl compact="compact">
  96. <dd><a name="index-set-non_002dstop"></a>
  97. </dd>
  98. <dt><code>set non-stop on</code></dt>
  99. <dd><p>Enable selection of non-stop mode.
  100. </p></dd>
  101. <dt><code>set non-stop off</code></dt>
  102. <dd><p>Disable selection of non-stop mode.
  103. <a name="index-show-non_002dstop"></a>
  104. </p></dd>
  105. <dt><code>show non-stop</code></dt>
  106. <dd><p>Show the current non-stop enablement setting.
  107. </p></dd>
  108. </dl>
  109. <p>Note these commands only reflect whether non-stop mode is enabled,
  110. not whether the currently-executing program is being run in non-stop mode.
  111. In particular, the <code>set non-stop</code> preference is only consulted when
  112. <small>GDB</small> starts or connects to the target program, and it is generally
  113. not possible to switch modes once debugging has started. Furthermore,
  114. since not all targets support non-stop mode, even when you have enabled
  115. non-stop mode, <small>GDB</small> may still fall back to all-stop operation by
  116. default.
  117. </p>
  118. <p>In non-stop mode, all execution commands apply only to the current thread
  119. by default. That is, <code>continue</code> only continues one thread.
  120. To continue all threads, issue <code>continue -a</code> or <code>c -a</code>.
  121. </p>
  122. <p>You can use <small>GDB</small>&rsquo;s background execution commands
  123. (see <a href="Background-Execution.html#Background-Execution">Background Execution</a>) to run some threads in the background
  124. while you continue to examine or step others from <small>GDB</small>.
  125. The MI execution commands (see <a href="GDB_002fMI-Program-Execution.html#GDB_002fMI-Program-Execution">GDB/MI Program Execution</a>) are
  126. always executed asynchronously in non-stop mode.
  127. </p>
  128. <p>Suspending execution is done with the <code>interrupt</code> command when
  129. running in the background, or <kbd>Ctrl-c</kbd> during foreground execution.
  130. In all-stop mode, this stops the whole process;
  131. but in non-stop mode the interrupt applies only to the current thread.
  132. To stop the whole program, use <code>interrupt -a</code>.
  133. </p>
  134. <p>Other execution commands do not currently support the <code>-a</code> option.
  135. </p>
  136. <p>In non-stop mode, when a thread stops, <small>GDB</small> doesn&rsquo;t automatically make
  137. that thread current, as it does in all-stop mode. This is because the
  138. thread stop notifications are asynchronous with respect to <small>GDB</small>&rsquo;s
  139. command interpreter, and it would be confusing if <small>GDB</small> unexpectedly
  140. changed to a different thread just as you entered a command to operate on the
  141. previously current thread.
  142. </p>
  143. <hr>
  144. <div class="header">
  145. <p>
  146. Next: <a href="Background-Execution.html#Background-Execution" accesskey="n" rel="next">Background Execution</a>, Previous: <a href="All_002dStop-Mode.html#All_002dStop-Mode" accesskey="p" rel="prev">All-Stop Mode</a>, Up: <a href="Thread-Stops.html#Thread-Stops" accesskey="u" rel="up">Thread Stops</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>
  147. </div>
  148. </body>
  149. </html>