Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

226 lines
8.9KB

  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 Thread Commands (Debugging with GDB)</title>
  17. <meta name="description" content="GDB/MI Thread Commands (Debugging with GDB)">
  18. <meta name="keywords" content="GDB/MI Thread Commands (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.html#GDB_002fMI" rel="up" title="GDB/MI">
  26. <link href="GDB_002fMI-Ada-Tasking-Commands.html#GDB_002fMI-Ada-Tasking-Commands" rel="next" title="GDB/MI Ada Tasking Commands">
  27. <link href="GDB_002fMI-Program-Context.html#GDB_002fMI-Program-Context" rel="prev" title="GDB/MI Program Context">
  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-Thread-Commands"></a>
  58. <div class="header">
  59. <p>
  60. Next: <a href="GDB_002fMI-Ada-Tasking-Commands.html#GDB_002fMI-Ada-Tasking-Commands" accesskey="n" rel="next">GDB/MI Ada Tasking Commands</a>, Previous: <a href="GDB_002fMI-Program-Context.html#GDB_002fMI-Program-Context" accesskey="p" rel="prev">GDB/MI Program Context</a>, Up: <a href="GDB_002fMI.html#GDB_002fMI" accesskey="u" rel="up">GDB/MI</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-Thread-Commands-1"></a>
  64. <h3 class="section">27.11 <small>GDB/MI</small> Thread Commands</h3>
  65. <a name="The-_002dthread_002dinfo-Command"></a>
  66. <h4 class="subheading">The <code>-thread-info</code> Command</h4>
  67. <a name="index-_002dthread_002dinfo"></a>
  68. <a name="Synopsis-26"></a>
  69. <h4 class="subsubheading">Synopsis</h4>
  70. <div class="smallexample">
  71. <pre class="smallexample"> -thread-info [ <var>thread-id</var> ]
  72. </pre></div>
  73. <p>Reports information about either a specific thread, if the
  74. <var>thread-id</var> parameter is present, or about all threads.
  75. <var>thread-id</var> is the thread&rsquo;s global thread ID. When printing
  76. information about all threads, also reports the global ID of the
  77. current thread.
  78. </p>
  79. <a name="GDB-Command-25"></a>
  80. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  81. <p>The &lsquo;<samp>info thread</samp>&rsquo; command prints the same information
  82. about all threads.
  83. </p>
  84. <a name="Result-3"></a>
  85. <h4 class="subsubheading">Result</h4>
  86. <p>The result contains the following attributes:
  87. </p>
  88. <dl compact="compact">
  89. <dt>&lsquo;<samp>threads</samp>&rsquo;</dt>
  90. <dd><p>A list of threads. The format of the elements of the list is described in
  91. <a href="GDB_002fMI-Thread-Information.html#GDB_002fMI-Thread-Information">GDB/MI Thread Information</a>.
  92. </p>
  93. </dd>
  94. <dt>&lsquo;<samp>current-thread-id</samp>&rsquo;</dt>
  95. <dd><p>The global id of the currently selected thread. This field is omitted if there
  96. is no selected thread (for example, when the selected inferior is not running,
  97. and therefore has no threads) or if a <var>thread-id</var> argument was passed to
  98. the command.
  99. </p>
  100. </dd>
  101. </dl>
  102. <a name="Example-25"></a>
  103. <h4 class="subsubheading">Example</h4>
  104. <div class="smallexample">
  105. <pre class="smallexample">-thread-info
  106. ^done,threads=[
  107. {id=&quot;2&quot;,target-id=&quot;Thread 0xb7e14b90 (LWP 21257)&quot;,
  108. frame={level=&quot;0&quot;,addr=&quot;0xffffe410&quot;,func=&quot;__kernel_vsyscall&quot;,
  109. args=[]},state=&quot;running&quot;},
  110. {id=&quot;1&quot;,target-id=&quot;Thread 0xb7e156b0 (LWP 21254)&quot;,
  111. frame={level=&quot;0&quot;,addr=&quot;0x0804891f&quot;,func=&quot;foo&quot;,
  112. args=[{name=&quot;i&quot;,value=&quot;10&quot;}],
  113. file=&quot;/tmp/a.c&quot;,fullname=&quot;/tmp/a.c&quot;,line=&quot;158&quot;,arch=&quot;i386:x86_64&quot;},
  114. state=&quot;running&quot;}],
  115. current-thread-id=&quot;1&quot;
  116. (gdb)
  117. </pre></div>
  118. <a name="The-_002dthread_002dlist_002dids-Command"></a>
  119. <h4 class="subheading">The <code>-thread-list-ids</code> Command</h4>
  120. <a name="index-_002dthread_002dlist_002dids"></a>
  121. <a name="Synopsis-27"></a>
  122. <h4 class="subsubheading">Synopsis</h4>
  123. <div class="smallexample">
  124. <pre class="smallexample"> -thread-list-ids
  125. </pre></div>
  126. <p>Produces a list of the currently known global <small>GDB</small> thread ids.
  127. At the end of the list it also prints the total number of such
  128. threads.
  129. </p>
  130. <p>This command is retained for historical reasons, the
  131. <code>-thread-info</code> command should be used instead.
  132. </p>
  133. <a name="GDB-Command-26"></a>
  134. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  135. <p>Part of &lsquo;<samp>info threads</samp>&rsquo; supplies the same information.
  136. </p>
  137. <a name="Example-26"></a>
  138. <h4 class="subsubheading">Example</h4>
  139. <div class="smallexample">
  140. <pre class="smallexample">(gdb)
  141. -thread-list-ids
  142. ^done,thread-ids={thread-id=&quot;3&quot;,thread-id=&quot;2&quot;,thread-id=&quot;1&quot;},
  143. current-thread-id=&quot;1&quot;,number-of-threads=&quot;3&quot;
  144. (gdb)
  145. </pre></div>
  146. <a name="The-_002dthread_002dselect-Command"></a>
  147. <h4 class="subheading">The <code>-thread-select</code> Command</h4>
  148. <a name="index-_002dthread_002dselect"></a>
  149. <a name="Synopsis-28"></a>
  150. <h4 class="subsubheading">Synopsis</h4>
  151. <div class="smallexample">
  152. <pre class="smallexample"> -thread-select <var>thread-id</var>
  153. </pre></div>
  154. <p>Make thread with global thread number <var>thread-id</var> the current
  155. thread. It prints the number of the new current thread, and the
  156. topmost frame for that thread.
  157. </p>
  158. <p>This command is deprecated in favor of explicitly using the
  159. &lsquo;<samp>--thread</samp>&rsquo; option to each command.
  160. </p>
  161. <a name="GDB-Command-27"></a>
  162. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  163. <p>The corresponding <small>GDB</small> command is &lsquo;<samp>thread</samp>&rsquo;.
  164. </p>
  165. <a name="Example-27"></a>
  166. <h4 class="subsubheading">Example</h4>
  167. <div class="smallexample">
  168. <pre class="smallexample">(gdb)
  169. -exec-next
  170. ^running
  171. (gdb)
  172. *stopped,reason=&quot;end-stepping-range&quot;,thread-id=&quot;2&quot;,line=&quot;187&quot;,
  173. file=&quot;../../../devo/gdb/testsuite/gdb.threads/linux-dp.c&quot;
  174. (gdb)
  175. -thread-list-ids
  176. ^done,
  177. thread-ids={thread-id=&quot;3&quot;,thread-id=&quot;2&quot;,thread-id=&quot;1&quot;},
  178. number-of-threads=&quot;3&quot;
  179. (gdb)
  180. -thread-select 3
  181. ^done,new-thread-id=&quot;3&quot;,
  182. frame={level=&quot;0&quot;,func=&quot;vprintf&quot;,
  183. args=[{name=&quot;format&quot;,value=&quot;0x8048e9c \&quot;%*s%c %d %c\\n\&quot;&quot;},
  184. {name=&quot;arg&quot;,value=&quot;0x2&quot;}],file=&quot;vprintf.c&quot;,line=&quot;31&quot;,arch=&quot;i386:x86_64&quot;}
  185. (gdb)
  186. </pre></div>
  187. <hr>
  188. <div class="header">
  189. <p>
  190. Next: <a href="GDB_002fMI-Ada-Tasking-Commands.html#GDB_002fMI-Ada-Tasking-Commands" accesskey="n" rel="next">GDB/MI Ada Tasking Commands</a>, Previous: <a href="GDB_002fMI-Program-Context.html#GDB_002fMI-Program-Context" accesskey="p" rel="prev">GDB/MI Program Context</a>, Up: <a href="GDB_002fMI.html#GDB_002fMI" accesskey="u" rel="up">GDB/MI</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>
  191. </div>
  192. </body>
  193. </html>