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.

658 lines
25KB

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