GDB_002fMI-Miscellaneous-Commands.html 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658
  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 5.1, http://www.gnu.org/software/texinfo/ -->
  14. <head>
  15. <title>Debugging with GDB: GDB/MI Miscellaneous Commands</title>
  16. <meta name="description" content="Debugging with GDB: GDB/MI Miscellaneous Commands">
  17. <meta name="keywords" content="Debugging with GDB: GDB/MI Miscellaneous Commands">
  18. <meta name="resource-type" content="document">
  19. <meta name="distribution" content="global">
  20. <meta name="Generator" content="makeinfo">
  21. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  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="Annotations.html#Annotations" rel="next" title="Annotations">
  27. <link href="GDB_002fMI-Support-Commands.html#GDB_002fMI-Support-Commands" rel="previous" title="GDB/MI Support Commands">
  28. <style type="text/css">
  29. <!--
  30. a.summary-letter {text-decoration: none}
  31. blockquote.smallquotation {font-size: smaller}
  32. div.display {margin-left: 3.2em}
  33. div.example {margin-left: 3.2em}
  34. div.indentedblock {margin-left: 3.2em}
  35. div.lisp {margin-left: 3.2em}
  36. div.smalldisplay {margin-left: 3.2em}
  37. div.smallexample {margin-left: 3.2em}
  38. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  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.nocodebreak {white-space:nowrap}
  50. span.nolinebreak {white-space:nowrap}
  51. span.roman {font-family:serif; font-weight:normal}
  52. span.sansserif {font-family:sans-serif; font-weight:normal}
  53. ul.no-bullet {list-style: none}
  54. -->
  55. </style>
  56. </head>
  57. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  58. <a name="GDB_002fMI-Miscellaneous-Commands"></a>
  59. <div class="header">
  60. <p>
  61. Previous: <a href="GDB_002fMI-Support-Commands.html#GDB_002fMI-Support-Commands" accesskey="p" rel="previous">GDB/MI Support Commands</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>
  62. </div>
  63. <hr>
  64. <a name="Miscellaneous-GDB_002fMI-Commands"></a>
  65. <h3 class="section">27.24 Miscellaneous <small>GDB/MI</small> Commands</h3>
  66. <a name="The-_002dgdb_002dexit-Command"></a>
  67. <h4 class="subheading">The <code>-gdb-exit</code> Command</h4>
  68. <a name="index-_002dgdb_002dexit"></a>
  69. <a name="Synopsis-104"></a>
  70. <h4 class="subsubheading">Synopsis</h4>
  71. <div class="smallexample">
  72. <pre class="smallexample"> -gdb-exit
  73. </pre></div>
  74. <p>Exit <small>GDB</small> immediately.
  75. </p>
  76. <a name="GDB-Command-86"></a>
  77. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  78. <p>Approximately corresponds to &lsquo;<samp>quit</samp>&rsquo;.
  79. </p>
  80. <a name="Example-86"></a>
  81. <h4 class="subsubheading">Example</h4>
  82. <div class="smallexample">
  83. <pre class="smallexample">(gdb)
  84. -gdb-exit
  85. ^exit
  86. </pre></div>
  87. <a name="The-_002dgdb_002dset-Command"></a>
  88. <h4 class="subheading">The <code>-gdb-set</code> Command</h4>
  89. <a name="index-_002dgdb_002dset"></a>
  90. <a name="Synopsis-105"></a>
  91. <h4 class="subsubheading">Synopsis</h4>
  92. <div class="smallexample">
  93. <pre class="smallexample"> -gdb-set
  94. </pre></div>
  95. <p>Set an internal <small>GDB</small> variable.
  96. </p>
  97. <a name="GDB-Command-87"></a>
  98. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  99. <p>The corresponding <small>GDB</small> command is &lsquo;<samp>set</samp>&rsquo;.
  100. </p>
  101. <a name="Example-87"></a>
  102. <h4 class="subsubheading">Example</h4>
  103. <div class="smallexample">
  104. <pre class="smallexample">(gdb)
  105. -gdb-set $foo=3
  106. ^done
  107. (gdb)
  108. </pre></div>
  109. <a name="The-_002dgdb_002dshow-Command"></a>
  110. <h4 class="subheading">The <code>-gdb-show</code> Command</h4>
  111. <a name="index-_002dgdb_002dshow"></a>
  112. <a name="Synopsis-106"></a>
  113. <h4 class="subsubheading">Synopsis</h4>
  114. <div class="smallexample">
  115. <pre class="smallexample"> -gdb-show
  116. </pre></div>
  117. <p>Show the current value of a <small>GDB</small> variable.
  118. </p>
  119. <a name="GDB-Command-88"></a>
  120. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  121. <p>The corresponding <small>GDB</small> command is &lsquo;<samp>show</samp>&rsquo;.
  122. </p>
  123. <a name="Example-88"></a>
  124. <h4 class="subsubheading">Example</h4>
  125. <div class="smallexample">
  126. <pre class="smallexample">(gdb)
  127. -gdb-show annotate
  128. ^done,value=&quot;0&quot;
  129. (gdb)
  130. </pre></div>
  131. <a name="The-_002dgdb_002dversion-Command"></a>
  132. <h4 class="subheading">The <code>-gdb-version</code> Command</h4>
  133. <a name="index-_002dgdb_002dversion"></a>
  134. <a name="Synopsis-107"></a>
  135. <h4 class="subsubheading">Synopsis</h4>
  136. <div class="smallexample">
  137. <pre class="smallexample"> -gdb-version
  138. </pre></div>
  139. <p>Show version information for <small>GDB</small>. Used mostly in testing.
  140. </p>
  141. <a name="GDB-Command-89"></a>
  142. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  143. <p>The <small>GDB</small> equivalent is &lsquo;<samp>show version</samp>&rsquo;. <small>GDB</small> by
  144. default shows this information when you start an interactive session.
  145. </p>
  146. <a name="Example-89"></a>
  147. <h4 class="subsubheading">Example</h4>
  148. <div class="smallexample">
  149. <pre class="smallexample">(gdb)
  150. -gdb-version
  151. ~GNU gdb 5.2.1
  152. ~Copyright 2000 Free Software Foundation, Inc.
  153. ~GDB is free software, covered by the GNU General Public License, and
  154. ~you are welcome to change it and/or distribute copies of it under
  155. ~ certain conditions.
  156. ~Type &quot;show copying&quot; to see the conditions.
  157. ~There is absolutely no warranty for GDB. Type &quot;show warranty&quot; for
  158. ~ details.
  159. ~This GDB was configured as
  160. &quot;--host=sparc-sun-solaris2.5.1 --target=ppc-eabi&quot;.
  161. ^done
  162. (gdb)
  163. </pre></div>
  164. <a name="The-_002dlist_002dthread_002dgroups-Command"></a>
  165. <h4 class="subheading">The <code>-list-thread-groups</code> Command</h4>
  166. <a name="index-_002dlist_002dthread_002dgroups"></a>
  167. <a name="Synopsis-108"></a>
  168. <h4 class="subheading">Synopsis</h4>
  169. <div class="smallexample">
  170. <pre class="smallexample">-list-thread-groups [ --available ] [ --recurse 1 ] [ <var>group</var> ... ]
  171. </pre></div>
  172. <p>Lists thread groups (see <a href="Thread-groups.html#Thread-groups">Thread groups</a>). When a single thread
  173. group is passed as the argument, lists the children of that group.
  174. When several thread group are passed, lists information about those
  175. thread groups. Without any parameters, lists information about all
  176. top-level thread groups.
  177. </p>
  178. <p>Normally, thread groups that are being debugged are reported.
  179. With the &lsquo;<samp>--available</samp>&rsquo; option, <small>GDB</small> reports thread groups
  180. available on the target.
  181. </p>
  182. <p>The output of this command may have either a &lsquo;<samp>threads</samp>&rsquo; result or
  183. a &lsquo;<samp>groups</samp>&rsquo; result. The &lsquo;<samp>thread</samp>&rsquo; result has a list of tuples
  184. as value, with each tuple describing a thread (see <a href="GDB_002fMI-Thread-Information.html#GDB_002fMI-Thread-Information">GDB/MI Thread Information</a>). The &lsquo;<samp>groups</samp>&rsquo; result has a list of tuples as value,
  185. each tuple describing a thread group. If top-level groups are
  186. requested (that is, no parameter is passed), or when several groups
  187. are passed, the output always has a &lsquo;<samp>groups</samp>&rsquo; result. The format
  188. of the &lsquo;<samp>group</samp>&rsquo; result is described below.
  189. </p>
  190. <p>To reduce the number of roundtrips it&rsquo;s possible to list thread groups
  191. together with their children, by passing the &lsquo;<samp>--recurse</samp>&rsquo; option
  192. and the recursion depth. Presently, only recursion depth of 1 is
  193. permitted. If this option is present, then every reported thread group
  194. will also include its children, either as &lsquo;<samp>group</samp>&rsquo; or
  195. &lsquo;<samp>threads</samp>&rsquo; field.
  196. </p>
  197. <p>In general, any combination of option and parameters is permitted, with
  198. the following caveats:
  199. </p>
  200. <ul>
  201. <li> When a single thread group is passed, the output will typically
  202. be the &lsquo;<samp>threads</samp>&rsquo; result. Because threads may not contain
  203. anything, the &lsquo;<samp>recurse</samp>&rsquo; option will be ignored.
  204. </li><li> When the &lsquo;<samp>--available</samp>&rsquo; option is passed, limited information may
  205. be available. In particular, the list of threads of a process might
  206. be inaccessible. Further, specifying specific thread groups might
  207. not give any performance advantage over listing all thread groups.
  208. The frontend should assume that &lsquo;<samp>-list-thread-groups --available</samp>&rsquo;
  209. is always an expensive operation and cache the results.
  210. </li></ul>
  211. <p>The &lsquo;<samp>groups</samp>&rsquo; result is a list of tuples, where each tuple may
  212. have the following fields:
  213. </p>
  214. <dl compact="compact">
  215. <dt><code>id</code></dt>
  216. <dd><p>Identifier of the thread group. This field is always present.
  217. The identifier is an opaque string; frontends should not try to
  218. convert it to an integer, even though it might look like one.
  219. </p>
  220. </dd>
  221. <dt><code>type</code></dt>
  222. <dd><p>The type of the thread group. At present, only &lsquo;<samp>process</samp>&rsquo; is a
  223. valid type.
  224. </p>
  225. </dd>
  226. <dt><code>pid</code></dt>
  227. <dd><p>The target-specific process identifier. This field is only present
  228. for thread groups of type &lsquo;<samp>process</samp>&rsquo; and only if the process exists.
  229. </p>
  230. </dd>
  231. <dt><code>exit-code</code></dt>
  232. <dd><p>The exit code of this group&rsquo;s last exited thread, formatted in octal.
  233. This field is only present for thread groups of type &lsquo;<samp>process</samp>&rsquo; and
  234. only if the process is not running.
  235. </p>
  236. </dd>
  237. <dt><code>num_children</code></dt>
  238. <dd><p>The number of children this thread group has. This field may be
  239. absent for an available thread group.
  240. </p>
  241. </dd>
  242. <dt><code>threads</code></dt>
  243. <dd><p>This field has a list of tuples as value, each tuple describing a
  244. thread. It may be present if the &lsquo;<samp>--recurse</samp>&rsquo; option is
  245. specified, and it&rsquo;s actually possible to obtain the threads.
  246. </p>
  247. </dd>
  248. <dt><code>cores</code></dt>
  249. <dd><p>This field is a list of integers, each identifying a core that one
  250. thread of the group is running on. This field may be absent if
  251. such information is not available.
  252. </p>
  253. </dd>
  254. <dt><code>executable</code></dt>
  255. <dd><p>The name of the executable file that corresponds to this thread group.
  256. The field is only present for thread groups of type &lsquo;<samp>process</samp>&rsquo;,
  257. and only if there is a corresponding executable file.
  258. </p>
  259. </dd>
  260. </dl>
  261. <a name="Example-90"></a>
  262. <h4 class="subheading">Example</h4>
  263. <div class="smallexample">
  264. <pre class="smallexample">gdb
  265. -list-thread-groups
  266. ^done,groups=[{id=&quot;17&quot;,type=&quot;process&quot;,pid=&quot;yyy&quot;,num_children=&quot;2&quot;}]
  267. -list-thread-groups 17
  268. ^done,threads=[{id=&quot;2&quot;,target-id=&quot;Thread 0xb7e14b90 (LWP 21257)&quot;,
  269. frame={level=&quot;0&quot;,addr=&quot;0xffffe410&quot;,func=&quot;__kernel_vsyscall&quot;,args=[]},state=&quot;running&quot;},
  270. {id=&quot;1&quot;,target-id=&quot;Thread 0xb7e156b0 (LWP 21254)&quot;,
  271. frame={level=&quot;0&quot;,addr=&quot;0x0804891f&quot;,func=&quot;foo&quot;,args=[{name=&quot;i&quot;,value=&quot;10&quot;}],
  272. file=&quot;/tmp/a.c&quot;,fullname=&quot;/tmp/a.c&quot;,line=&quot;158&quot;,arch=&quot;i386:x86_64&quot;},state=&quot;running&quot;}]]
  273. -list-thread-groups --available
  274. ^done,groups=[{id=&quot;17&quot;,type=&quot;process&quot;,pid=&quot;yyy&quot;,num_children=&quot;2&quot;,cores=[1,2]}]
  275. -list-thread-groups --available --recurse 1
  276. ^done,groups=[{id=&quot;17&quot;, types=&quot;process&quot;,pid=&quot;yyy&quot;,num_children=&quot;2&quot;,cores=[1,2],
  277. threads=[{id=&quot;1&quot;,target-id=&quot;Thread 0xb7e14b90&quot;,cores=[1]},
  278. {id=&quot;2&quot;,target-id=&quot;Thread 0xb7e14b90&quot;,cores=[2]}]},..]
  279. -list-thread-groups --available --recurse 1 17 18
  280. ^done,groups=[{id=&quot;17&quot;, types=&quot;process&quot;,pid=&quot;yyy&quot;,num_children=&quot;2&quot;,cores=[1,2],
  281. threads=[{id=&quot;1&quot;,target-id=&quot;Thread 0xb7e14b90&quot;,cores=[1]},
  282. {id=&quot;2&quot;,target-id=&quot;Thread 0xb7e14b90&quot;,cores=[2]}]},...]
  283. </pre></div>
  284. <a name="The-_002dinfo_002dos-Command"></a>
  285. <h4 class="subheading">The <code>-info-os</code> Command</h4>
  286. <a name="index-_002dinfo_002dos"></a>
  287. <a name="Synopsis-109"></a>
  288. <h4 class="subsubheading">Synopsis</h4>
  289. <div class="smallexample">
  290. <pre class="smallexample">-info-os [ <var>type</var> ]
  291. </pre></div>
  292. <p>If no argument is supplied, the command returns a table of available
  293. operating-system-specific information types. If one of these types is
  294. supplied as an argument <var>type</var>, then the command returns a table
  295. of data of that type.
  296. </p>
  297. <p>The types of information available depend on the target operating
  298. system.
  299. </p>
  300. <a name="GDB-Command-90"></a>
  301. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  302. <p>The corresponding <small>GDB</small> command is &lsquo;<samp>info os</samp>&rsquo;.
  303. </p>
  304. <a name="Example-91"></a>
  305. <h4 class="subsubheading">Example</h4>
  306. <p>When run on a <small>GNU</small>/Linux system, the output will look something
  307. like this:
  308. </p>
  309. <div class="smallexample">
  310. <pre class="smallexample">gdb
  311. -info-os
  312. ^done,OSDataTable={nr_rows=&quot;10&quot;,nr_cols=&quot;3&quot;,
  313. hdr=[{width=&quot;10&quot;,alignment=&quot;-1&quot;,col_name=&quot;col0&quot;,colhdr=&quot;Type&quot;},
  314. {width=&quot;10&quot;,alignment=&quot;-1&quot;,col_name=&quot;col1&quot;,colhdr=&quot;Description&quot;},
  315. {width=&quot;10&quot;,alignment=&quot;-1&quot;,col_name=&quot;col2&quot;,colhdr=&quot;Title&quot;}],
  316. body=[item={col0=&quot;cpus&quot;,col1=&quot;Listing of all cpus/cores on the system&quot;,
  317. col2=&quot;CPUs&quot;},
  318. item={col0=&quot;files&quot;,col1=&quot;Listing of all file descriptors&quot;,
  319. col2=&quot;File descriptors&quot;},
  320. item={col0=&quot;modules&quot;,col1=&quot;Listing of all loaded kernel modules&quot;,
  321. col2=&quot;Kernel modules&quot;},
  322. item={col0=&quot;msg&quot;,col1=&quot;Listing of all message queues&quot;,
  323. col2=&quot;Message queues&quot;},
  324. item={col0=&quot;processes&quot;,col1=&quot;Listing of all processes&quot;,
  325. col2=&quot;Processes&quot;},
  326. item={col0=&quot;procgroups&quot;,col1=&quot;Listing of all process groups&quot;,
  327. col2=&quot;Process groups&quot;},
  328. item={col0=&quot;semaphores&quot;,col1=&quot;Listing of all semaphores&quot;,
  329. col2=&quot;Semaphores&quot;},
  330. item={col0=&quot;shm&quot;,col1=&quot;Listing of all shared-memory regions&quot;,
  331. col2=&quot;Shared-memory regions&quot;},
  332. item={col0=&quot;sockets&quot;,col1=&quot;Listing of all internet-domain sockets&quot;,
  333. col2=&quot;Sockets&quot;},
  334. item={col0=&quot;threads&quot;,col1=&quot;Listing of all threads&quot;,
  335. col2=&quot;Threads&quot;}]
  336. gdb
  337. -info-os processes
  338. ^done,OSDataTable={nr_rows=&quot;190&quot;,nr_cols=&quot;4&quot;,
  339. hdr=[{width=&quot;10&quot;,alignment=&quot;-1&quot;,col_name=&quot;col0&quot;,colhdr=&quot;pid&quot;},
  340. {width=&quot;10&quot;,alignment=&quot;-1&quot;,col_name=&quot;col1&quot;,colhdr=&quot;user&quot;},
  341. {width=&quot;10&quot;,alignment=&quot;-1&quot;,col_name=&quot;col2&quot;,colhdr=&quot;command&quot;},
  342. {width=&quot;10&quot;,alignment=&quot;-1&quot;,col_name=&quot;col3&quot;,colhdr=&quot;cores&quot;}],
  343. body=[item={col0=&quot;1&quot;,col1=&quot;root&quot;,col2=&quot;/sbin/init&quot;,col3=&quot;0&quot;},
  344. item={col0=&quot;2&quot;,col1=&quot;root&quot;,col2=&quot;[kthreadd]&quot;,col3=&quot;1&quot;},
  345. item={col0=&quot;3&quot;,col1=&quot;root&quot;,col2=&quot;[ksoftirqd/0]&quot;,col3=&quot;0&quot;},
  346. ...
  347. item={col0=&quot;26446&quot;,col1=&quot;stan&quot;,col2=&quot;bash&quot;,col3=&quot;0&quot;},
  348. item={col0=&quot;28152&quot;,col1=&quot;stan&quot;,col2=&quot;bash&quot;,col3=&quot;1&quot;}]}
  349. (gdb)
  350. </pre></div>
  351. <p>(Note that the MI output here includes a <code>&quot;Title&quot;</code> column that
  352. does not appear in command-line <code>info os</code>; this column is useful
  353. for MI clients that want to enumerate the types of data, such as in a
  354. popup menu, but is needless clutter on the command line, and
  355. <code>info os</code> omits it.)
  356. </p>
  357. <a name="The-_002dadd_002dinferior-Command"></a>
  358. <h4 class="subheading">The <code>-add-inferior</code> Command</h4>
  359. <a name="index-_002dadd_002dinferior"></a>
  360. <a name="Synopsis-110"></a>
  361. <h4 class="subheading">Synopsis</h4>
  362. <div class="smallexample">
  363. <pre class="smallexample">-add-inferior
  364. </pre></div>
  365. <p>Creates a new inferior (see <a href="Inferiors-Connections-and-Programs.html#Inferiors-Connections-and-Programs">Inferiors Connections and Programs</a>). The created
  366. inferior is not associated with any executable. Such association may
  367. be established with the &lsquo;<samp>-file-exec-and-symbols</samp>&rsquo; command
  368. (see <a href="GDB_002fMI-File-Commands.html#GDB_002fMI-File-Commands">GDB/MI File Commands</a>). The command response has a single
  369. field, &lsquo;<samp>inferior</samp>&rsquo;, whose value is the identifier of the
  370. thread group corresponding to the new inferior.
  371. </p>
  372. <a name="Example-92"></a>
  373. <h4 class="subheading">Example</h4>
  374. <div class="smallexample">
  375. <pre class="smallexample">gdb
  376. -add-inferior
  377. ^done,inferior=&quot;i3&quot;
  378. </pre></div>
  379. <a name="The-_002dinterpreter_002dexec-Command"></a>
  380. <h4 class="subheading">The <code>-interpreter-exec</code> Command</h4>
  381. <a name="index-_002dinterpreter_002dexec"></a>
  382. <a name="Synopsis-111"></a>
  383. <h4 class="subheading">Synopsis</h4>
  384. <div class="smallexample">
  385. <pre class="smallexample">-interpreter-exec <var>interpreter</var> <var>command</var>
  386. </pre></div>
  387. <a name="g_t_002dinterpreter_002dexec"></a>
  388. <p>Execute the specified <var>command</var> in the given <var>interpreter</var>.
  389. </p>
  390. <a name="GDB-Command-91"></a>
  391. <h4 class="subheading"><small>GDB</small> Command</h4>
  392. <p>The corresponding <small>GDB</small> command is &lsquo;<samp>interpreter-exec</samp>&rsquo;.
  393. </p>
  394. <a name="Example-93"></a>
  395. <h4 class="subheading">Example</h4>
  396. <div class="smallexample">
  397. <pre class="smallexample">(gdb)
  398. -interpreter-exec console &quot;break main&quot;
  399. &amp;&quot;During symbol reading, couldn't parse type; debugger out of date?.\n&quot;
  400. &amp;&quot;During symbol reading, bad structure-type format.\n&quot;
  401. ~&quot;Breakpoint 1 at 0x8074fc6: file ../../src/gdb/main.c, line 743.\n&quot;
  402. ^done
  403. (gdb)
  404. </pre></div>
  405. <a name="The-_002dinferior_002dtty_002dset-Command"></a>
  406. <h4 class="subheading">The <code>-inferior-tty-set</code> Command</h4>
  407. <a name="index-_002dinferior_002dtty_002dset"></a>
  408. <a name="Synopsis-112"></a>
  409. <h4 class="subheading">Synopsis</h4>
  410. <div class="smallexample">
  411. <pre class="smallexample">-inferior-tty-set /dev/pts/1
  412. </pre></div>
  413. <p>Set terminal for future runs of the program being debugged.
  414. </p>
  415. <a name="GDB-Command-92"></a>
  416. <h4 class="subheading"><small>GDB</small> Command</h4>
  417. <p>The corresponding <small>GDB</small> command is &lsquo;<samp>set inferior-tty</samp>&rsquo; /dev/pts/1.
  418. </p>
  419. <a name="Example-94"></a>
  420. <h4 class="subheading">Example</h4>
  421. <div class="smallexample">
  422. <pre class="smallexample">(gdb)
  423. -inferior-tty-set /dev/pts/1
  424. ^done
  425. (gdb)
  426. </pre></div>
  427. <a name="The-_002dinferior_002dtty_002dshow-Command"></a>
  428. <h4 class="subheading">The <code>-inferior-tty-show</code> Command</h4>
  429. <a name="index-_002dinferior_002dtty_002dshow"></a>
  430. <a name="Synopsis-113"></a>
  431. <h4 class="subheading">Synopsis</h4>
  432. <div class="smallexample">
  433. <pre class="smallexample">-inferior-tty-show
  434. </pre></div>
  435. <p>Show terminal for future runs of program being debugged.
  436. </p>
  437. <a name="GDB-Command-93"></a>
  438. <h4 class="subheading"><small>GDB</small> Command</h4>
  439. <p>The corresponding <small>GDB</small> command is &lsquo;<samp>show inferior-tty</samp>&rsquo;.
  440. </p>
  441. <a name="Example-95"></a>
  442. <h4 class="subheading">Example</h4>
  443. <div class="smallexample">
  444. <pre class="smallexample">(gdb)
  445. -inferior-tty-set /dev/pts/1
  446. ^done
  447. (gdb)
  448. -inferior-tty-show
  449. ^done,inferior_tty_terminal=&quot;/dev/pts/1&quot;
  450. (gdb)
  451. </pre></div>
  452. <a name="The-_002denable_002dtimings-Command"></a>
  453. <h4 class="subheading">The <code>-enable-timings</code> Command</h4>
  454. <a name="index-_002denable_002dtimings"></a>
  455. <a name="Synopsis-114"></a>
  456. <h4 class="subheading">Synopsis</h4>
  457. <div class="smallexample">
  458. <pre class="smallexample">-enable-timings [yes | no]
  459. </pre></div>
  460. <p>Toggle the printing of the wallclock, user and system times for an MI
  461. command as a field in its output. This command is to help frontend
  462. developers optimize the performance of their code. No argument is
  463. equivalent to &lsquo;<samp>yes</samp>&rsquo;.
  464. </p>
  465. <a name="GDB-Command-94"></a>
  466. <h4 class="subheading"><small>GDB</small> Command</h4>
  467. <p>No equivalent.
  468. </p>
  469. <a name="Example-96"></a>
  470. <h4 class="subheading">Example</h4>
  471. <div class="smallexample">
  472. <pre class="smallexample">(gdb)
  473. -enable-timings
  474. ^done
  475. (gdb)
  476. -break-insert main
  477. ^done,bkpt={number=&quot;1&quot;,type=&quot;breakpoint&quot;,disp=&quot;keep&quot;,enabled=&quot;y&quot;,
  478. addr=&quot;0x080484ed&quot;,func=&quot;main&quot;,file=&quot;myprog.c&quot;,
  479. fullname=&quot;/home/nickrob/myprog.c&quot;,line=&quot;73&quot;,thread-groups=[&quot;i1&quot;],
  480. times=&quot;0&quot;},
  481. time={wallclock=&quot;0.05185&quot;,user=&quot;0.00800&quot;,system=&quot;0.00000&quot;}
  482. (gdb)
  483. -enable-timings no
  484. ^done
  485. (gdb)
  486. -exec-run
  487. ^running
  488. (gdb)
  489. *stopped,reason=&quot;breakpoint-hit&quot;,disp=&quot;keep&quot;,bkptno=&quot;1&quot;,thread-id=&quot;0&quot;,
  490. frame={addr=&quot;0x080484ed&quot;,func=&quot;main&quot;,args=[{name=&quot;argc&quot;,value=&quot;1&quot;},
  491. {name=&quot;argv&quot;,value=&quot;0xbfb60364&quot;}],file=&quot;myprog.c&quot;,
  492. fullname=&quot;/home/nickrob/myprog.c&quot;,line=&quot;73&quot;,arch=&quot;i386:x86_64&quot;}
  493. (gdb)
  494. </pre></div>
  495. <a name="The-_002dcomplete-Command"></a>
  496. <h4 class="subheading">The <code>-complete</code> Command</h4>
  497. <a name="index-_002dcomplete"></a>
  498. <a name="Synopsis-115"></a>
  499. <h4 class="subheading">Synopsis</h4>
  500. <div class="smallexample">
  501. <pre class="smallexample">-complete <var>command</var>
  502. </pre></div>
  503. <p>Show a list of completions for partially typed CLI <var>command</var>.
  504. </p>
  505. <p>This command is intended for <small>GDB/MI</small> frontends that cannot use two separate
  506. CLI and MI channels &mdash; for example: because of lack of PTYs like on Windows or
  507. because <small>GDB</small> is used remotely via a SSH connection.
  508. </p>
  509. <a name="Result-9"></a>
  510. <h4 class="subheading">Result</h4>
  511. <p>The result consists of two or three fields:
  512. </p>
  513. <dl compact="compact">
  514. <dt>&lsquo;<samp>completion</samp>&rsquo;</dt>
  515. <dd><p>This field contains the completed <var>command</var>. If <var>command</var>
  516. has no known completions, this field is omitted.
  517. </p>
  518. </dd>
  519. <dt>&lsquo;<samp>matches</samp>&rsquo;</dt>
  520. <dd><p>This field contains a (possibly empty) array of matches. It is always present.
  521. </p>
  522. </dd>
  523. <dt>&lsquo;<samp>max_completions_reached</samp>&rsquo;</dt>
  524. <dd><p>This field contains <code>1</code> if number of known completions is above
  525. <code>max-completions</code> limit (see <a href="Completion.html#Completion">Completion</a>), otherwise it contains
  526. <code>0</code>. It is always present.
  527. </p>
  528. </dd>
  529. </dl>
  530. <a name="GDB-Command-95"></a>
  531. <h4 class="subheading"><small>GDB</small> Command</h4>
  532. <p>The corresponding <small>GDB</small> command is &lsquo;<samp>complete</samp>&rsquo;.
  533. </p>
  534. <a name="Example-97"></a>
  535. <h4 class="subheading">Example</h4>
  536. <div class="smallexample">
  537. <pre class="smallexample">(gdb)
  538. -complete br
  539. ^done,completion=&quot;break&quot;,
  540. matches=[&quot;break&quot;,&quot;break-range&quot;],
  541. max_completions_reached=&quot;0&quot;
  542. (gdb)
  543. -complete &quot;b ma&quot;
  544. ^done,completion=&quot;b ma&quot;,
  545. matches=[&quot;b madvise&quot;,&quot;b main&quot;],max_completions_reached=&quot;0&quot;
  546. (gdb)
  547. -complete &quot;b push_b&quot;
  548. ^done,completion=&quot;b push_back(&quot;,
  549. matches=[
  550. &quot;b A::push_back(void*)&quot;,
  551. &quot;b std::string::push_back(char)&quot;,
  552. &quot;b std::vector&lt;int, std::allocator&lt;int&gt; &gt;::push_back(int&amp;&amp;)&quot;],
  553. max_completions_reached=&quot;0&quot;
  554. (gdb)
  555. -complete &quot;nonexist&quot;
  556. ^done,matches=[],max_completions_reached=&quot;0&quot;
  557. (gdb)
  558. </pre></div>
  559. <hr>
  560. <div class="header">
  561. <p>
  562. Previous: <a href="GDB_002fMI-Support-Commands.html#GDB_002fMI-Support-Commands" accesskey="p" rel="previous">GDB/MI Support Commands</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>
  563. </div>
  564. </body>
  565. </html>