3 <title>Debugging with GDB
</title>
4 <meta http-equiv=
"Content-Type" content=
"text/html">
5 <meta name=
"description" content=
"Debugging with GDB">
6 <meta name=
"generator" content=
"makeinfo 4.3">
7 <link href=
"http://www.gnu.org/software/texinfo/" rel=
"generator-home">
12 Node:
<a name=
"GDB%2fMI%20Thread%20Commands">GDB/MI Thread Commands
</a>,
13 Next:
<a rel=
"next" accesskey=
"n" href=
"GDB-MI-Tracepoint-Commands.html#GDB%2fMI%20Tracepoint%20Commands">GDB/MI Tracepoint Commands
</a>,
14 Previous:
<a rel=
"previous" accesskey=
"p" href=
"GDB-MI-Target-Manipulation.html#GDB%2fMI%20Target%20Manipulation">GDB/MI Target Manipulation
</a>,
15 Up:
<a rel=
"up" accesskey=
"u" href=
"GDB-MI.html#GDB%2fMI">GDB/MI
</a>
19 <h3 class=
"section"><small>GDB/MI
</small> Thread Commands
</h3>
21 <h4 class=
"subheading">The
<code>-thread-info
</code> Command
</h4>
23 <h5 class=
"subsubheading">Synopsis
</h5>
25 <pre class=
"example"> -thread-info
28 <h5 class=
"subsubheading">GDB command
</h5>
32 <h5 class=
"subsubheading">Example
</h5>
36 <h4 class=
"subheading">The
<code>-thread-list-all-threads
</code> Command
</h4>
38 <h5 class=
"subsubheading">Synopsis
</h5>
40 <pre class=
"example"> -thread-list-all-threads
43 <h5 class=
"subsubheading">GDB Command
</h5>
45 <p>The equivalent GDB command is
<code>info threads
</code>.
47 <h5 class=
"subsubheading">Example
</h5>
51 <h4 class=
"subheading">The
<code>-thread-list-ids
</code> Command
</h4>
53 <h5 class=
"subsubheading">Synopsis
</h5>
55 <pre class=
"example"> -thread-list-ids
58 <p>Produces a list of the currently known GDB thread ids. At the
59 end of the list it also prints the total number of such threads.
61 <h5 class=
"subsubheading">GDB Command
</h5>
63 <p>Part of
<code>info threads
</code> supplies the same information.
65 <h5 class=
"subsubheading">Example
</h5>
67 <p>No threads present, besides the main process:
69 <pre class=
"smallexample"> (gdb)
71 ^done,thread-ids={},
number-of-threads=
"0"
77 <pre class=
"smallexample"> (gdb)
79 ^done,thread-ids={
thread-id=
"3",
thread-id=
"2",
thread-id=
"1"},
84 <h4 class=
"subheading">The
<code>-thread-select
</code> Command
</h4>
86 <h5 class=
"subsubheading">Synopsis
</h5>
88 <pre class=
"example"> -thread-select
<var>threadnum
</var>
91 <p>Make
<var>threadnum
</var> the current thread. It prints the number of the new
92 current thread, and the topmost frame for that thread.
94 <h5 class=
"subsubheading">GDB Command
</h5>
96 <p>The corresponding GDB command is
<code>thread
</code>.
98 <h5 class=
"subsubheading">Example
</h5>
100 <pre class=
"smallexample"> (gdb)
104 *stopped,
reason=
"end-stepping-range",
thread-id=
"2",
line=
"187",
105 file=
"../../../devo/gdb/testsuite/gdb.threads/linux-dp.c"
109 thread-ids={
thread-id=
"3",
thread-id=
"2",
thread-id=
"1"},
110 number-of-threads=
"3"
113 ^done,
new-thread-id=
"3",
114 frame={
level=
"0 ",
func=
"vprintf",
115 args=[{
name=
"format",
value=
"0x8048e9c \"%*s%c %d %c\\n\
""},
116 {
name=
"arg",
value=
"0x2"}],
file=
"vprintf.c",
line=
"31"}