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.

Background-Execution.html 7.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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>Background Execution (Debugging with GDB)</title>
  17. <meta name="description" content="Background Execution (Debugging with GDB)">
  18. <meta name="keywords" content="Background Execution (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="Thread_002dSpecific-Breakpoints.html#Thread_002dSpecific-Breakpoints" rel="next" title="Thread-Specific Breakpoints">
  27. <link href="Non_002dStop-Mode.html#Non_002dStop-Mode" rel="prev" title="Non-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="Background-Execution"></a>
  58. <div class="header">
  59. <p>
  60. Next: <a href="Thread_002dSpecific-Breakpoints.html#Thread_002dSpecific-Breakpoints" accesskey="n" rel="next">Thread-Specific Breakpoints</a>, Previous: <a href="Non_002dStop-Mode.html#Non_002dStop-Mode" accesskey="p" rel="prev">Non-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="Background-Execution-1"></a>
  64. <h4 class="subsection">5.5.3 Background Execution</h4>
  65. <a name="index-foreground-execution"></a>
  66. <a name="index-background-execution"></a>
  67. <a name="index-asynchronous-execution"></a>
  68. <a name="index-execution_002c-foreground_002c-background-and-asynchronous"></a>
  69. <p><small>GDB</small>&rsquo;s execution commands have two variants: the normal
  70. foreground (synchronous) behavior, and a background
  71. (asynchronous) behavior. In foreground execution, <small>GDB</small> waits for
  72. the program to report that some thread has stopped before prompting for
  73. another command. In background execution, <small>GDB</small> immediately gives
  74. a command prompt so that you can issue other commands while your program runs.
  75. </p>
  76. <p>If the target doesn&rsquo;t support async mode, <small>GDB</small> issues an error
  77. message if you attempt to use the background execution commands.
  78. </p>
  79. <a name="index-_0026_002c-background-execution-of-commands"></a>
  80. <p>To specify background execution, add a <code>&amp;</code> to the command. For example,
  81. the background form of the <code>continue</code> command is <code>continue&amp;</code>, or
  82. just <code>c&amp;</code>. The execution commands that accept background execution
  83. are:
  84. </p>
  85. <dl compact="compact">
  86. <dd><a name="index-run_0026"></a>
  87. </dd>
  88. <dt><code>run</code></dt>
  89. <dd><p>See <a href="Starting.html#Starting">Starting your Program</a>.
  90. </p>
  91. </dd>
  92. <dt><code>attach</code></dt>
  93. <dd><a name="index-attach_0026"></a>
  94. <p>See <a href="Attach.html#Attach">Debugging an Already-running Process</a>.
  95. </p>
  96. </dd>
  97. <dt><code>step</code></dt>
  98. <dd><a name="index-step_0026"></a>
  99. <p>See <a href="Continuing-and-Stepping.html#Continuing-and-Stepping">step</a>.
  100. </p>
  101. </dd>
  102. <dt><code>stepi</code></dt>
  103. <dd><a name="index-stepi_0026"></a>
  104. <p>See <a href="Continuing-and-Stepping.html#Continuing-and-Stepping">stepi</a>.
  105. </p>
  106. </dd>
  107. <dt><code>next</code></dt>
  108. <dd><a name="index-next_0026"></a>
  109. <p>See <a href="Continuing-and-Stepping.html#Continuing-and-Stepping">next</a>.
  110. </p>
  111. </dd>
  112. <dt><code>nexti</code></dt>
  113. <dd><a name="index-nexti_0026"></a>
  114. <p>See <a href="Continuing-and-Stepping.html#Continuing-and-Stepping">nexti</a>.
  115. </p>
  116. </dd>
  117. <dt><code>continue</code></dt>
  118. <dd><a name="index-continue_0026"></a>
  119. <p>See <a href="Continuing-and-Stepping.html#Continuing-and-Stepping">continue</a>.
  120. </p>
  121. </dd>
  122. <dt><code>finish</code></dt>
  123. <dd><a name="index-finish_0026"></a>
  124. <p>See <a href="Continuing-and-Stepping.html#Continuing-and-Stepping">finish</a>.
  125. </p>
  126. </dd>
  127. <dt><code>until</code></dt>
  128. <dd><a name="index-until_0026"></a>
  129. <p>See <a href="Continuing-and-Stepping.html#Continuing-and-Stepping">until</a>.
  130. </p>
  131. </dd>
  132. </dl>
  133. <p>Background execution is especially useful in conjunction with non-stop
  134. mode for debugging programs with multiple threads; see <a href="Non_002dStop-Mode.html#Non_002dStop-Mode">Non-Stop Mode</a>.
  135. However, you can also use these commands in the normal all-stop mode with
  136. the restriction that you cannot issue another execution command until the
  137. previous one finishes. Examples of commands that are valid in all-stop
  138. mode while the program is running include <code>help</code> and <code>info break</code>.
  139. </p>
  140. <p>You can interrupt your program while it is running in the background by
  141. using the <code>interrupt</code> command.
  142. </p>
  143. <dl compact="compact">
  144. <dd><a name="index-interrupt-1"></a>
  145. </dd>
  146. <dt><code>interrupt</code></dt>
  147. <dt><code>interrupt -a</code></dt>
  148. <dd>
  149. <p>Suspend execution of the running program. In all-stop mode,
  150. <code>interrupt</code> stops the whole process, but in non-stop mode, it stops
  151. only the current thread. To stop the whole program in non-stop mode,
  152. use <code>interrupt -a</code>.
  153. </p></dd>
  154. </dl>
  155. <hr>
  156. <div class="header">
  157. <p>
  158. Next: <a href="Thread_002dSpecific-Breakpoints.html#Thread_002dSpecific-Breakpoints" accesskey="n" rel="next">Thread-Specific Breakpoints</a>, Previous: <a href="Non_002dStop-Mode.html#Non_002dStop-Mode" accesskey="p" rel="prev">Non-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>
  159. </div>
  160. </body>
  161. </html>