Symbols.html 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967
  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: Symbols</title>
  16. <meta name="description" content="Debugging with GDB: Symbols">
  17. <meta name="keywords" content="Debugging with GDB: Symbols">
  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="index.html#Top" rel="up" title="Top">
  26. <link href="Altering.html#Altering" rel="next" title="Altering">
  27. <link href="Unsupported-Languages.html#Unsupported-Languages" rel="previous" title="Unsupported Languages">
  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="Symbols"></a>
  59. <div class="header">
  60. <p>
  61. Next: <a href="Altering.html#Altering" accesskey="n" rel="next">Altering</a>, Previous: <a href="Languages.html#Languages" accesskey="p" rel="previous">Languages</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</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="Examining-the-Symbol-Table"></a>
  65. <h2 class="chapter">16 Examining the Symbol Table</h2>
  66. <p>The commands described in this chapter allow you to inquire about the
  67. symbols (names of variables, functions and types) defined in your
  68. program. This information is inherent in the text of your program and
  69. does not change as your program executes. <small>GDB</small> finds it in your
  70. program&rsquo;s symbol table, in the file indicated when you started <small>GDB</small>
  71. (see <a href="File-Options.html#File-Options">Choosing Files</a>), or by one of the
  72. file-management commands (see <a href="Files.html#Files">Commands to Specify Files</a>).
  73. </p>
  74. <a name="index-symbol-names"></a>
  75. <a name="index-names-of-symbols"></a>
  76. <a name="index-quoting-names"></a>
  77. <a name="quoting-names"></a><p>Occasionally, you may need to refer to symbols that contain unusual
  78. characters, which <small>GDB</small> ordinarily treats as word delimiters. The
  79. most frequent case is in referring to static variables in other
  80. source files (see <a href="Variables.html#Variables">Program Variables</a>). File names
  81. are recorded in object files as debugging symbols, but <small>GDB</small> would
  82. ordinarily parse a typical file name, like <samp>foo.c</samp>, as the three words
  83. &lsquo;<samp>foo</samp>&rsquo; &lsquo;<samp>.</samp>&rsquo; &lsquo;<samp>c</samp>&rsquo;. To allow <small>GDB</small> to recognize
  84. &lsquo;<samp>foo.c</samp>&rsquo; as a single symbol, enclose it in single quotes; for example,
  85. </p>
  86. <div class="smallexample">
  87. <pre class="smallexample">p 'foo.c'::x
  88. </pre></div>
  89. <p>looks up the value of <code>x</code> in the scope of the file <samp>foo.c</samp>.
  90. </p>
  91. <dl compact="compact">
  92. <dd><a name="index-case_002dinsensitive-symbol-names"></a>
  93. <a name="index-case-sensitivity-in-symbol-names"></a>
  94. <a name="index-set-case_002dsensitive"></a>
  95. </dd>
  96. <dt><code>set case-sensitive on</code></dt>
  97. <dt><code>set case-sensitive off</code></dt>
  98. <dt><code>set case-sensitive auto</code></dt>
  99. <dd><p>Normally, when <small>GDB</small> looks up symbols, it matches their names
  100. with case sensitivity determined by the current source language.
  101. Occasionally, you may wish to control that. The command <code>set
  102. case-sensitive</code> lets you do that by specifying <code>on</code> for
  103. case-sensitive matches or <code>off</code> for case-insensitive ones. If
  104. you specify <code>auto</code>, case sensitivity is reset to the default
  105. suitable for the source language. The default is case-sensitive
  106. matches for all languages except for Fortran, for which the default is
  107. case-insensitive matches.
  108. </p>
  109. <a name="index-show-case_002dsensitive"></a>
  110. </dd>
  111. <dt><code>show case-sensitive</code></dt>
  112. <dd><p>This command shows the current setting of case sensitivity for symbols
  113. lookups.
  114. </p>
  115. <a name="index-set-print-type-methods"></a>
  116. </dd>
  117. <dt><code>set print type methods</code></dt>
  118. <dt><code>set print type methods on</code></dt>
  119. <dt><code>set print type methods off</code></dt>
  120. <dd><p>Normally, when <small>GDB</small> prints a class, it displays any methods
  121. declared in that class. You can control this behavior either by
  122. passing the appropriate flag to <code>ptype</code>, or using <code>set
  123. print type methods</code>. Specifying <code>on</code> will cause <small>GDB</small> to
  124. display the methods; this is the default. Specifying <code>off</code> will
  125. cause <small>GDB</small> to omit the methods.
  126. </p>
  127. <a name="index-show-print-type-methods"></a>
  128. </dd>
  129. <dt><code>show print type methods</code></dt>
  130. <dd><p>This command shows the current setting of method display when printing
  131. classes.
  132. </p>
  133. <a name="index-set-print-type-nested_002dtype_002dlimit"></a>
  134. </dd>
  135. <dt><code>set print type nested-type-limit <var>limit</var></code></dt>
  136. <dt><code>set print type nested-type-limit unlimited</code></dt>
  137. <dd><p>Set the limit of displayed nested types that the type printer will
  138. show. A <var>limit</var> of <code>unlimited</code> or <code>-1</code> will show all
  139. nested definitions. By default, the type printer will not show any nested
  140. types defined in classes.
  141. </p>
  142. <a name="index-show-print-type-nested_002dtype_002dlimit"></a>
  143. </dd>
  144. <dt><code>show print type nested-type-limit</code></dt>
  145. <dd><p>This command shows the current display limit of nested types when
  146. printing classes.
  147. </p>
  148. <a name="index-set-print-type-typedefs"></a>
  149. </dd>
  150. <dt><code>set print type typedefs</code></dt>
  151. <dt><code>set print type typedefs on</code></dt>
  152. <dt><code>set print type typedefs off</code></dt>
  153. <dd>
  154. <p>Normally, when <small>GDB</small> prints a class, it displays any typedefs
  155. defined in that class. You can control this behavior either by
  156. passing the appropriate flag to <code>ptype</code>, or using <code>set
  157. print type typedefs</code>. Specifying <code>on</code> will cause <small>GDB</small> to
  158. display the typedef definitions; this is the default. Specifying
  159. <code>off</code> will cause <small>GDB</small> to omit the typedef definitions.
  160. Note that this controls whether the typedef definition itself is
  161. printed, not whether typedef names are substituted when printing other
  162. types.
  163. </p>
  164. <a name="index-show-print-type-typedefs"></a>
  165. </dd>
  166. <dt><code>show print type typedefs</code></dt>
  167. <dd><p>This command shows the current setting of typedef display when
  168. printing classes.
  169. </p>
  170. <a name="index-info-address"></a>
  171. <a name="index-address-of-a-symbol"></a>
  172. </dd>
  173. <dt><code>info address <var>symbol</var></code></dt>
  174. <dd><p>Describe where the data for <var>symbol</var> is stored. For a register
  175. variable, this says which register it is kept in. For a non-register
  176. local variable, this prints the stack-frame offset at which the variable
  177. is always stored.
  178. </p>
  179. <p>Note the contrast with &lsquo;<samp>print &amp;<var>symbol</var></samp>&rsquo;, which does not work
  180. at all for a register variable, and for a stack local variable prints
  181. the exact address of the current instantiation of the variable.
  182. </p>
  183. <a name="index-info-symbol"></a>
  184. <a name="index-symbol-from-address"></a>
  185. <a name="index-closest-symbol-and-offset-for-an-address"></a>
  186. </dd>
  187. <dt><code>info symbol <var>addr</var></code></dt>
  188. <dd><p>Print the name of a symbol which is stored at the address <var>addr</var>.
  189. If no symbol is stored exactly at <var>addr</var>, <small>GDB</small> prints the
  190. nearest symbol and an offset from it:
  191. </p>
  192. <div class="smallexample">
  193. <pre class="smallexample">(gdb) info symbol 0x54320
  194. _initialize_vx + 396 in section .text
  195. </pre></div>
  196. <p>This is the opposite of the <code>info address</code> command. You can use
  197. it to find out the name of a variable or a function given its address.
  198. </p>
  199. <p>For dynamically linked executables, the name of executable or shared
  200. library containing the symbol is also printed:
  201. </p>
  202. <div class="smallexample">
  203. <pre class="smallexample">(gdb) info symbol 0x400225
  204. _start + 5 in section .text of /tmp/a.out
  205. (gdb) info symbol 0x2aaaac2811cf
  206. __read_nocancel + 6 in section .text of /usr/lib64/libc.so.6
  207. </pre></div>
  208. <a name="index-demangle-1"></a>
  209. <a name="index-demangle"></a>
  210. </dd>
  211. <dt><code>demangle <span class="roman">[</span>-l <var>language</var><span class="roman">]</span> <span class="roman">[</span><var>--</var><span class="roman">]</span> <var>name</var></code></dt>
  212. <dd><p>Demangle <var>name</var>.
  213. If <var>language</var> is provided it is the name of the language to demangle
  214. <var>name</var> in. Otherwise <var>name</var> is demangled in the current language.
  215. </p>
  216. <p>The &lsquo;<samp>--</samp>&rsquo; option specifies the end of options,
  217. and is useful when <var>name</var> begins with a dash.
  218. </p>
  219. <p>The parameter <code>demangle-style</code> specifies how to interpret the kind
  220. of mangling used. See <a href="Print-Settings.html#Print-Settings">Print Settings</a>.
  221. </p>
  222. <a name="index-whatis"></a>
  223. </dd>
  224. <dt><code>whatis[/<var>flags</var>] [<var>arg</var>]</code></dt>
  225. <dd><p>Print the data type of <var>arg</var>, which can be either an expression
  226. or a name of a data type. With no argument, print the data type of
  227. <code>$</code>, the last value in the value history.
  228. </p>
  229. <p>If <var>arg</var> is an expression (see <a href="Expressions.html#Expressions">Expressions</a>), it
  230. is not actually evaluated, and any side-effecting operations (such as
  231. assignments or function calls) inside it do not take place.
  232. </p>
  233. <p>If <var>arg</var> is a variable or an expression, <code>whatis</code> prints its
  234. literal type as it is used in the source code. If the type was
  235. defined using a <code>typedef</code>, <code>whatis</code> will <em>not</em> print
  236. the data type underlying the <code>typedef</code>. If the type of the
  237. variable or the expression is a compound data type, such as
  238. <code>struct</code> or <code>class</code>, <code>whatis</code> never prints their
  239. fields or methods. It just prints the <code>struct</code>/<code>class</code>
  240. name (a.k.a. its <em>tag</em>). If you want to see the members of
  241. such a compound data type, use <code>ptype</code>.
  242. </p>
  243. <p>If <var>arg</var> is a type name that was defined using <code>typedef</code>,
  244. <code>whatis</code> <em>unrolls</em> only one level of that <code>typedef</code>.
  245. Unrolling means that <code>whatis</code> will show the underlying type used
  246. in the <code>typedef</code> declaration of <var>arg</var>. However, if that
  247. underlying type is also a <code>typedef</code>, <code>whatis</code> will not
  248. unroll it.
  249. </p>
  250. <p>For C code, the type names may also have the form &lsquo;<samp>class
  251. <var>class-name</var></samp>&rsquo;, &lsquo;<samp>struct <var>struct-tag</var></samp>&rsquo;, &lsquo;<samp>union
  252. <var>union-tag</var></samp>&rsquo; or &lsquo;<samp>enum <var>enum-tag</var></samp>&rsquo;.
  253. </p>
  254. <p><var>flags</var> can be used to modify how the type is displayed.
  255. Available flags are:
  256. </p>
  257. <dl compact="compact">
  258. <dt><code>r</code></dt>
  259. <dd><p>Display in &ldquo;raw&rdquo; form. Normally, <small>GDB</small> substitutes template
  260. parameters and typedefs defined in a class when printing the class&rsquo;
  261. members. The <code>/r</code> flag disables this.
  262. </p>
  263. </dd>
  264. <dt><code>m</code></dt>
  265. <dd><p>Do not print methods defined in the class.
  266. </p>
  267. </dd>
  268. <dt><code>M</code></dt>
  269. <dd><p>Print methods defined in the class. This is the default, but the flag
  270. exists in case you change the default with <code>set print type methods</code>.
  271. </p>
  272. </dd>
  273. <dt><code>t</code></dt>
  274. <dd><p>Do not print typedefs defined in the class. Note that this controls
  275. whether the typedef definition itself is printed, not whether typedef
  276. names are substituted when printing other types.
  277. </p>
  278. </dd>
  279. <dt><code>T</code></dt>
  280. <dd><p>Print typedefs defined in the class. This is the default, but the flag
  281. exists in case you change the default with <code>set print type typedefs</code>.
  282. </p>
  283. </dd>
  284. <dt><code>o</code></dt>
  285. <dd><p>Print the offsets and sizes of fields in a struct, similar to what the
  286. <code>pahole</code> tool does. This option implies the <code>/tm</code> flags.
  287. </p>
  288. <p>For example, given the following declarations:
  289. </p>
  290. <div class="smallexample">
  291. <pre class="smallexample">struct tuv
  292. {
  293. int a1;
  294. char *a2;
  295. int a3;
  296. };
  297. struct xyz
  298. {
  299. int f1;
  300. char f2;
  301. void *f3;
  302. struct tuv f4;
  303. };
  304. union qwe
  305. {
  306. struct tuv fff1;
  307. struct xyz fff2;
  308. };
  309. struct tyu
  310. {
  311. int a1 : 1;
  312. int a2 : 3;
  313. int a3 : 23;
  314. char a4 : 2;
  315. int64_t a5;
  316. int a6 : 5;
  317. int64_t a7 : 3;
  318. };
  319. </pre></div>
  320. <p>Issuing a <kbd>ptype /o struct tuv</kbd> command would print:
  321. </p>
  322. <div class="smallexample">
  323. <pre class="smallexample">(gdb) ptype /o struct tuv
  324. /* offset | size */ type = struct tuv {
  325. /* 0 | 4 */ int a1;
  326. /* XXX 4-byte hole */
  327. /* 8 | 8 */ char *a2;
  328. /* 16 | 4 */ int a3;
  329. /* total size (bytes): 24 */
  330. }
  331. </pre></div>
  332. <p>Notice the format of the first column of comments. There, you can
  333. find two parts separated by the &lsquo;<samp>|</samp>&rsquo; character: the <em>offset</em>,
  334. which indicates where the field is located inside the struct, in
  335. bytes, and the <em>size</em> of the field. Another interesting line is
  336. the marker of a <em>hole</em> in the struct, indicating that it may be
  337. possible to pack the struct and make it use less space by reorganizing
  338. its fields.
  339. </p>
  340. <p>It is also possible to print offsets inside an union:
  341. </p>
  342. <div class="smallexample">
  343. <pre class="smallexample">(gdb) ptype /o union qwe
  344. /* offset | size */ type = union qwe {
  345. /* 24 */ struct tuv {
  346. /* 0 | 4 */ int a1;
  347. /* XXX 4-byte hole */
  348. /* 8 | 8 */ char *a2;
  349. /* 16 | 4 */ int a3;
  350. /* total size (bytes): 24 */
  351. } fff1;
  352. /* 40 */ struct xyz {
  353. /* 0 | 4 */ int f1;
  354. /* 4 | 1 */ char f2;
  355. /* XXX 3-byte hole */
  356. /* 8 | 8 */ void *f3;
  357. /* 16 | 24 */ struct tuv {
  358. /* 16 | 4 */ int a1;
  359. /* XXX 4-byte hole */
  360. /* 24 | 8 */ char *a2;
  361. /* 32 | 4 */ int a3;
  362. /* total size (bytes): 24 */
  363. } f4;
  364. /* total size (bytes): 40 */
  365. } fff2;
  366. /* total size (bytes): 40 */
  367. }
  368. </pre></div>
  369. <p>In this case, since <code>struct tuv</code> and <code>struct xyz</code> occupy the
  370. same space (because we are dealing with an union), the offset is not
  371. printed for them. However, you can still examine the offset of each
  372. of these structures&rsquo; fields.
  373. </p>
  374. <p>Another useful scenario is printing the offsets of a struct containing
  375. bitfields:
  376. </p>
  377. <div class="smallexample">
  378. <pre class="smallexample">(gdb) ptype /o struct tyu
  379. /* offset | size */ type = struct tyu {
  380. /* 0:31 | 4 */ int a1 : 1;
  381. /* 0:28 | 4 */ int a2 : 3;
  382. /* 0: 5 | 4 */ int a3 : 23;
  383. /* 3: 3 | 1 */ signed char a4 : 2;
  384. /* XXX 3-bit hole */
  385. /* XXX 4-byte hole */
  386. /* 8 | 8 */ int64_t a5;
  387. /* 16: 0 | 4 */ int a6 : 5;
  388. /* 16: 5 | 8 */ int64_t a7 : 3;
  389. &quot;/* XXX 7-byte padding */
  390. /* total size (bytes): 24 */
  391. }
  392. </pre></div>
  393. <p>Note how the offset information is now extended to also include the
  394. first bit of the bitfield.
  395. </p></dd>
  396. </dl>
  397. <a name="index-ptype"></a>
  398. </dd>
  399. <dt><code>ptype[/<var>flags</var>] [<var>arg</var>]</code></dt>
  400. <dd><p><code>ptype</code> accepts the same arguments as <code>whatis</code>, but prints a
  401. detailed description of the type, instead of just the name of the type.
  402. See <a href="Expressions.html#Expressions">Expressions</a>.
  403. </p>
  404. <p>Contrary to <code>whatis</code>, <code>ptype</code> always unrolls any
  405. <code>typedef</code>s in its argument declaration, whether the argument is
  406. a variable, expression, or a data type. This means that <code>ptype</code>
  407. of a variable or an expression will not print literally its type as
  408. present in the source code&mdash;use <code>whatis</code> for that. <code>typedef</code>s at
  409. the pointer or reference targets are also unrolled. Only <code>typedef</code>s of
  410. fields, methods and inner <code>class typedef</code>s of <code>struct</code>s,
  411. <code>class</code>es and <code>union</code>s are not unrolled even with <code>ptype</code>.
  412. </p>
  413. <p>For example, for this variable declaration:
  414. </p>
  415. <div class="smallexample">
  416. <pre class="smallexample">typedef double real_t;
  417. struct complex { real_t real; double imag; };
  418. typedef struct complex complex_t;
  419. complex_t var;
  420. real_t *real_pointer_var;
  421. </pre></div>
  422. <p>the two commands give this output:
  423. </p>
  424. <div class="smallexample">
  425. <pre class="smallexample">(gdb) whatis var
  426. type = complex_t
  427. (gdb) ptype var
  428. type = struct complex {
  429. real_t real;
  430. double imag;
  431. }
  432. (gdb) whatis complex_t
  433. type = struct complex
  434. (gdb) whatis struct complex
  435. type = struct complex
  436. (gdb) ptype struct complex
  437. type = struct complex {
  438. real_t real;
  439. double imag;
  440. }
  441. (gdb) whatis real_pointer_var
  442. type = real_t *
  443. (gdb) ptype real_pointer_var
  444. type = double *
  445. </pre></div>
  446. <p>As with <code>whatis</code>, using <code>ptype</code> without an argument refers to
  447. the type of <code>$</code>, the last value in the value history.
  448. </p>
  449. <a name="index-incomplete-type"></a>
  450. <p>Sometimes, programs use opaque data types or incomplete specifications
  451. of complex data structure. If the debug information included in the
  452. program does not allow <small>GDB</small> to display a full declaration of
  453. the data type, it will say &lsquo;<samp>&lt;incomplete type&gt;</samp>&rsquo;. For example,
  454. given these declarations:
  455. </p>
  456. <div class="smallexample">
  457. <pre class="smallexample"> struct foo;
  458. struct foo *fooptr;
  459. </pre></div>
  460. <p>but no definition for <code>struct foo</code> itself, <small>GDB</small> will say:
  461. </p>
  462. <div class="smallexample">
  463. <pre class="smallexample"> (gdb) ptype foo
  464. $1 = &lt;incomplete type&gt;
  465. </pre></div>
  466. <p>&ldquo;Incomplete type&rdquo; is C terminology for data types that are not
  467. completely specified.
  468. </p>
  469. <a name="index-unknown-type"></a>
  470. <p>Othertimes, information about a variable&rsquo;s type is completely absent
  471. from the debug information included in the program. This most often
  472. happens when the program or library where the variable is defined
  473. includes no debug information at all. <small>GDB</small> knows the variable
  474. exists from inspecting the linker/loader symbol table (e.g., the ELF
  475. dynamic symbol table), but such symbols do not contain type
  476. information. Inspecting the type of a (global) variable for which
  477. <small>GDB</small> has no type information shows:
  478. </p>
  479. <div class="smallexample">
  480. <pre class="smallexample"> (gdb) ptype var
  481. type = &lt;data variable, no debug info&gt;
  482. </pre></div>
  483. <p>See <a href="Variables.html#Variables">no debug info variables</a>, for how to print the values
  484. of such variables.
  485. </p>
  486. <a name="index-info-types"></a>
  487. </dd>
  488. <dt><code>info types [-q] [<var>regexp</var>]</code></dt>
  489. <dd><p>Print a brief description of all types whose names match the regular
  490. expression <var>regexp</var> (or all types in your program, if you supply
  491. no argument). Each complete typename is matched as though it were a
  492. complete line; thus, &lsquo;<samp>i type value</samp>&rsquo; gives information on all
  493. types in your program whose names include the string <code>value</code>, but
  494. &lsquo;<samp>i type ^value$</samp>&rsquo; gives information only on types whose complete
  495. name is <code>value</code>.
  496. </p>
  497. <p>In programs using different languages, <small>GDB</small> chooses the syntax
  498. to print the type description according to the
  499. &lsquo;<samp>set language</samp>&rsquo; value: using &lsquo;<samp>set language auto</samp>&rsquo;
  500. (see <a href="Automatically.html#Automatically">Set Language Automatically</a>) means to use the
  501. language of the type, other values mean to use
  502. the manually specified language (see <a href="Manually.html#Manually">Set Language Manually</a>).
  503. </p>
  504. <p>This command differs from <code>ptype</code> in two ways: first, like
  505. <code>whatis</code>, it does not print a detailed description; second, it
  506. lists all source files and line numbers where a type is defined.
  507. </p>
  508. <p>The output from &lsquo;<samp>into types</samp>&rsquo; is proceeded with a header line
  509. describing what types are being listed. The optional flag &lsquo;<samp>-q</samp>&rsquo;,
  510. which stands for &lsquo;<samp>quiet</samp>&rsquo;, disables printing this header
  511. information.
  512. </p>
  513. <a name="index-info-type_002dprinters"></a>
  514. </dd>
  515. <dt><code>info type-printers</code></dt>
  516. <dd><p>Versions of <small>GDB</small> that ship with Python scripting enabled may
  517. have &ldquo;type printers&rdquo; available. When using <code>ptype</code> or
  518. <code>whatis</code>, these printers are consulted when the name of a type
  519. is needed. See <a href="Type-Printing-API.html#Type-Printing-API">Type Printing API</a>, for more information on writing
  520. type printers.
  521. </p>
  522. <p><code>info type-printers</code> displays all the available type printers.
  523. </p>
  524. <a name="index-enable-type_002dprinter"></a>
  525. <a name="index-disable-type_002dprinter"></a>
  526. </dd>
  527. <dt><code>enable type-printer <var>name</var>&hellip;</code></dt>
  528. <dt><code>disable type-printer <var>name</var>&hellip;</code></dt>
  529. <dd><p>These commands can be used to enable or disable type printers.
  530. </p>
  531. <a name="index-info-scope"></a>
  532. <a name="index-local-variables"></a>
  533. </dd>
  534. <dt><code>info scope <var>location</var></code></dt>
  535. <dd><p>List all the variables local to a particular scope. This command
  536. accepts a <var>location</var> argument&mdash;a function name, a source line, or
  537. an address preceded by a &lsquo;<samp>*</samp>&rsquo;, and prints all the variables local
  538. to the scope defined by that location. (See <a href="Specify-Location.html#Specify-Location">Specify Location</a>, for
  539. details about supported forms of <var>location</var>.) For example:
  540. </p>
  541. <div class="smallexample">
  542. <pre class="smallexample">(gdb) <b>info scope command_line_handler</b>
  543. Scope for command_line_handler:
  544. Symbol rl is an argument at stack/frame offset 8, length 4.
  545. Symbol linebuffer is in static storage at address 0x150a18, length 4.
  546. Symbol linelength is in static storage at address 0x150a1c, length 4.
  547. Symbol p is a local variable in register $esi, length 4.
  548. Symbol p1 is a local variable in register $ebx, length 4.
  549. Symbol nline is a local variable in register $edx, length 4.
  550. Symbol repeat is a local variable at frame offset -8, length 4.
  551. </pre></div>
  552. <p>This command is especially useful for determining what data to collect
  553. during a <em>trace experiment</em>, see <a href="Tracepoint-Actions.html#Tracepoint-Actions">collect</a>.
  554. </p>
  555. <a name="index-info-source"></a>
  556. </dd>
  557. <dt><code>info source</code></dt>
  558. <dd><p>Show information about the current source file&mdash;that is, the source file for
  559. the function containing the current point of execution:
  560. </p><ul>
  561. <li> the name of the source file, and the directory containing it,
  562. </li><li> the directory it was compiled in,
  563. </li><li> its length, in lines,
  564. </li><li> which programming language it is written in,
  565. </li><li> if the debug information provides it, the program that compiled the file
  566. (which may include, e.g., the compiler version and command line arguments),
  567. </li><li> whether the executable includes debugging information for that file, and
  568. if so, what format the information is in (e.g., STABS, Dwarf 2, etc.), and
  569. </li><li> whether the debugging information includes information about
  570. preprocessor macros.
  571. </li></ul>
  572. <a name="index-info-sources"></a>
  573. </dd>
  574. <dt><code>info sources</code></dt>
  575. <dd><p>Print the names of all source files in your program for which there is
  576. debugging information, organized into two lists: files whose symbols
  577. have already been read, and files whose symbols will be read when needed.
  578. </p>
  579. </dd>
  580. <dt><code>info sources [-dirname | -basename] [--] [<var>regexp</var>]</code></dt>
  581. <dd><p>Like &lsquo;<samp>info sources</samp>&rsquo;, but only print the names of the files
  582. matching the provided <var>regexp</var>.
  583. By default, the <var>regexp</var> is used to match anywhere in the filename.
  584. If <code>-dirname</code>, only files having a dirname matching <var>regexp</var> are shown.
  585. If <code>-basename</code>, only files having a basename matching <var>regexp</var>
  586. are shown.
  587. The matching is case-sensitive, except on operating systems that
  588. have case-insensitive filesystem (e.g., MS-Windows).
  589. </p>
  590. <a name="index-info-functions"></a>
  591. </dd>
  592. <dt><code>info functions [-q] [-n]</code></dt>
  593. <dd><p>Print the names and data types of all defined functions.
  594. Similarly to &lsquo;<samp>info types</samp>&rsquo;, this command groups its output by source
  595. files and annotates each function definition with its source line
  596. number.
  597. </p>
  598. <p>In programs using different languages, <small>GDB</small> chooses the syntax
  599. to print the function name and type according to the
  600. &lsquo;<samp>set language</samp>&rsquo; value: using &lsquo;<samp>set language auto</samp>&rsquo;
  601. (see <a href="Automatically.html#Automatically">Set Language Automatically</a>) means to use the
  602. language of the function, other values mean to use
  603. the manually specified language (see <a href="Manually.html#Manually">Set Language Manually</a>).
  604. </p>
  605. <p>The &lsquo;<samp>-n</samp>&rsquo; flag excludes <em>non-debugging symbols</em> from the
  606. results. A non-debugging symbol is a symbol that comes from the
  607. executable&rsquo;s symbol table, not from the debug information (for
  608. example, DWARF) associated with the executable.
  609. </p>
  610. <p>The optional flag &lsquo;<samp>-q</samp>&rsquo;, which stands for &lsquo;<samp>quiet</samp>&rsquo;, disables
  611. printing header information and messages explaining why no functions
  612. have been printed.
  613. </p>
  614. </dd>
  615. <dt><code>info functions [-q] [-n] [-t <var>type_regexp</var>] [<var>regexp</var>]</code></dt>
  616. <dd><p>Like &lsquo;<samp>info functions</samp>&rsquo;, but only print the names and data types
  617. of the functions selected with the provided regexp(s).
  618. </p>
  619. <p>If <var>regexp</var> is provided, print only the functions whose names
  620. match the regular expression <var>regexp</var>.
  621. Thus, &lsquo;<samp>info fun step</samp>&rsquo; finds all functions whose
  622. names include <code>step</code>; &lsquo;<samp>info fun ^step</samp>&rsquo; finds those whose names
  623. start with <code>step</code>. If a function name contains characters that
  624. conflict with the regular expression language (e.g.
  625. &lsquo;<samp>operator*()</samp>&rsquo;), they may be quoted with a backslash.
  626. </p>
  627. <p>If <var>type_regexp</var> is provided, print only the functions whose
  628. types, as printed by the <code>whatis</code> command, match
  629. the regular expression <var>type_regexp</var>.
  630. If <var>type_regexp</var> contains space(s), it should be enclosed in
  631. quote characters. If needed, use backslash to escape the meaning
  632. of special characters or quotes.
  633. Thus, &lsquo;<samp>info fun -t '^int ('</samp>&rsquo; finds the functions that return
  634. an integer; &lsquo;<samp>info fun -t '(.*int.*'</samp>&rsquo; finds the functions that
  635. have an argument type containing int; &lsquo;<samp>info fun -t '^int (' ^step</samp>&rsquo;
  636. finds the functions whose names start with <code>step</code> and that return
  637. int.
  638. </p>
  639. <p>If both <var>regexp</var> and <var>type_regexp</var> are provided, a function
  640. is printed only if its name matches <var>regexp</var> and its type matches
  641. <var>type_regexp</var>.
  642. </p>
  643. <a name="index-info-variables"></a>
  644. </dd>
  645. <dt><code>info variables [-q] [-n]</code></dt>
  646. <dd><p>Print the names and data types of all variables that are defined
  647. outside of functions (i.e. excluding local variables).
  648. The printed variables are grouped by source files and annotated with
  649. their respective source line numbers.
  650. </p>
  651. <p>In programs using different languages, <small>GDB</small> chooses the syntax
  652. to print the variable name and type according to the
  653. &lsquo;<samp>set language</samp>&rsquo; value: using &lsquo;<samp>set language auto</samp>&rsquo;
  654. (see <a href="Automatically.html#Automatically">Set Language Automatically</a>) means to use the
  655. language of the variable, other values mean to use
  656. the manually specified language (see <a href="Manually.html#Manually">Set Language Manually</a>).
  657. </p>
  658. <p>The &lsquo;<samp>-n</samp>&rsquo; flag excludes non-debugging symbols from the results.
  659. </p>
  660. <p>The optional flag &lsquo;<samp>-q</samp>&rsquo;, which stands for &lsquo;<samp>quiet</samp>&rsquo;, disables
  661. printing header information and messages explaining why no variables
  662. have been printed.
  663. </p>
  664. </dd>
  665. <dt><code>info variables [-q] [-n] [-t <var>type_regexp</var>] [<var>regexp</var>]</code></dt>
  666. <dd><p>Like <kbd>info variables</kbd>, but only print the variables selected
  667. with the provided regexp(s).
  668. </p>
  669. <p>If <var>regexp</var> is provided, print only the variables whose names
  670. match the regular expression <var>regexp</var>.
  671. </p>
  672. <p>If <var>type_regexp</var> is provided, print only the variables whose
  673. types, as printed by the <code>whatis</code> command, match
  674. the regular expression <var>type_regexp</var>.
  675. If <var>type_regexp</var> contains space(s), it should be enclosed in
  676. quote characters. If needed, use backslash to escape the meaning
  677. of special characters or quotes.
  678. </p>
  679. <p>If both <var>regexp</var> and <var>type_regexp</var> are provided, an argument
  680. is printed only if its name matches <var>regexp</var> and its type matches
  681. <var>type_regexp</var>.
  682. </p>
  683. <a name="index-info-modules"></a>
  684. <a name="index-modules"></a>
  685. </dd>
  686. <dt><code>info modules <span class="roman">[</span>-q<span class="roman">]</span> <span class="roman">[</span><var>regexp</var><span class="roman">]</span></code></dt>
  687. <dd><p>List all Fortran modules in the program, or all modules matching the
  688. optional regular expression <var>regexp</var>.
  689. </p>
  690. <p>The optional flag &lsquo;<samp>-q</samp>&rsquo;, which stands for &lsquo;<samp>quiet</samp>&rsquo;, disables
  691. printing header information and messages explaining why no modules
  692. have been printed.
  693. </p>
  694. <a name="index-info-module"></a>
  695. <a name="index-Fortran-modules_002c-information-about"></a>
  696. <a name="index-functions-and-variables-by-Fortran-module"></a>
  697. <a name="index-module-functions-and-variables"></a>
  698. </dd>
  699. <dt><code>info module functions <span class="roman">[</span>-q<span class="roman">]</span> <span class="roman">[</span>-m <var>module-regexp</var><span class="roman">]</span> <span class="roman">[</span>-t <var>type-regexp</var><span class="roman">]</span> <span class="roman">[</span><var>regexp</var><span class="roman">]</span></code></dt>
  700. <dt><code>info module variables <span class="roman">[</span>-q<span class="roman">]</span> <span class="roman">[</span>-m <var>module-regexp</var><span class="roman">]</span> <span class="roman">[</span>-t <var>type-regexp</var><span class="roman">]</span> <span class="roman">[</span><var>regexp</var><span class="roman">]</span></code></dt>
  701. <dd><p>List all functions or variables within all Fortran modules. The set
  702. of functions or variables listed can be limited by providing some or
  703. all of the optional regular expressions. If <var>module-regexp</var> is
  704. provided, then only Fortran modules matching <var>module-regexp</var> will
  705. be searched. Only functions or variables whose type matches the
  706. optional regular expression <var>type-regexp</var> will be listed. And
  707. only functions or variables whose name matches the optional regular
  708. expression <var>regexp</var> will be listed.
  709. </p>
  710. <p>The optional flag &lsquo;<samp>-q</samp>&rsquo;, which stands for &lsquo;<samp>quiet</samp>&rsquo;, disables
  711. printing header information and messages explaining why no functions
  712. or variables have been printed.
  713. </p>
  714. <a name="index-info-classes"></a>
  715. <a name="index-Objective_002dC_002c-classes-and-selectors"></a>
  716. </dd>
  717. <dt><code>info classes</code></dt>
  718. <dt><code>info classes <var>regexp</var></code></dt>
  719. <dd><p>Display all Objective-C classes in your program, or
  720. (with the <var>regexp</var> argument) all those matching a particular regular
  721. expression.
  722. </p>
  723. <a name="index-info-selectors"></a>
  724. </dd>
  725. <dt><code>info selectors</code></dt>
  726. <dt><code>info selectors <var>regexp</var></code></dt>
  727. <dd><p>Display all Objective-C selectors in your program, or
  728. (with the <var>regexp</var> argument) all those matching a particular regular
  729. expression.
  730. </p>
  731. <a name="index-opaque-data-types"></a>
  732. <a name="index-set-opaque_002dtype_002dresolution"></a>
  733. </dd>
  734. <dt><code>set opaque-type-resolution on</code></dt>
  735. <dd><p>Tell <small>GDB</small> to resolve opaque types. An opaque type is a type
  736. declared as a pointer to a <code>struct</code>, <code>class</code>, or
  737. <code>union</code>&mdash;for example, <code>struct MyType *</code>&mdash;that is used in one
  738. source file although the full declaration of <code>struct MyType</code> is in
  739. another source file. The default is on.
  740. </p>
  741. <p>A change in the setting of this subcommand will not take effect until
  742. the next time symbols for a file are loaded.
  743. </p>
  744. </dd>
  745. <dt><code>set opaque-type-resolution off</code></dt>
  746. <dd><p>Tell <small>GDB</small> not to resolve opaque types. In this case, the type
  747. is printed as follows:
  748. </p><div class="smallexample">
  749. <pre class="smallexample">{&lt;no data fields&gt;}
  750. </pre></div>
  751. <a name="index-show-opaque_002dtype_002dresolution"></a>
  752. </dd>
  753. <dt><code>show opaque-type-resolution</code></dt>
  754. <dd><p>Show whether opaque types are resolved or not.
  755. </p>
  756. <a name="index-set-print-symbol_002dloading"></a>
  757. <a name="index-print-messages-when-symbols-are-loaded"></a>
  758. </dd>
  759. <dt><code>set print symbol-loading</code></dt>
  760. <dt><code>set print symbol-loading full</code></dt>
  761. <dt><code>set print symbol-loading brief</code></dt>
  762. <dt><code>set print symbol-loading off</code></dt>
  763. <dd><p>The <code>set print symbol-loading</code> command allows you to control the
  764. printing of messages when <small>GDB</small> loads symbol information.
  765. By default a message is printed for the executable and one for each
  766. shared library, and normally this is what you want. However, when
  767. debugging apps with large numbers of shared libraries these messages
  768. can be annoying.
  769. When set to <code>brief</code> a message is printed for each executable,
  770. and when <small>GDB</small> loads a collection of shared libraries at once
  771. it will only print one message regardless of the number of shared
  772. libraries. When set to <code>off</code> no messages are printed.
  773. </p>
  774. <a name="index-show-print-symbol_002dloading"></a>
  775. </dd>
  776. <dt><code>show print symbol-loading</code></dt>
  777. <dd><p>Show whether messages will be printed when a <small>GDB</small> command
  778. entered from the keyboard causes symbol information to be loaded.
  779. </p>
  780. <a name="index-maint-print-symbols"></a>
  781. <a name="index-symbol-dump"></a>
  782. <a name="index-maint-print-psymbols"></a>
  783. <a name="index-partial-symbol-dump"></a>
  784. <a name="index-maint-print-msymbols"></a>
  785. <a name="index-minimal-symbol-dump"></a>
  786. </dd>
  787. <dt><code>maint print symbols <span class="roman">[</span>-pc <var>address</var><span class="roman">]</span> <span class="roman">[</span><var>filename</var><span class="roman">]</span></code></dt>
  788. <dt><code>maint print symbols <span class="roman">[</span>-objfile <var>objfile</var><span class="roman">]</span> <span class="roman">[</span>-source <var>source</var><span class="roman">]</span> <span class="roman">[</span>--<span class="roman">]</span> <span class="roman">[</span><var>filename</var><span class="roman">]</span></code></dt>
  789. <dt><code>maint print psymbols <span class="roman">[</span>-objfile <var>objfile</var><span class="roman">]</span> <span class="roman">[</span>-pc <var>address</var><span class="roman">]</span> <span class="roman">[</span>--<span class="roman">]</span> <span class="roman">[</span><var>filename</var><span class="roman">]</span></code></dt>
  790. <dt><code>maint print psymbols <span class="roman">[</span>-objfile <var>objfile</var><span class="roman">]</span> <span class="roman">[</span>-source <var>source</var><span class="roman">]</span> <span class="roman">[</span>--<span class="roman">]</span> <span class="roman">[</span><var>filename</var><span class="roman">]</span></code></dt>
  791. <dt><code>maint print msymbols <span class="roman">[</span>-objfile <var>objfile</var><span class="roman">]</span> <span class="roman">[</span>--<span class="roman">]</span> <span class="roman">[</span><var>filename</var><span class="roman">]</span></code></dt>
  792. <dd><p>Write a dump of debugging symbol data into the file <var>filename</var> or
  793. the terminal if <var>filename</var> is unspecified.
  794. If <code>-objfile <var>objfile</var></code> is specified, only dump symbols for
  795. that objfile.
  796. If <code>-pc <var>address</var></code> is specified, only dump symbols for the file
  797. with code at that address. Note that <var>address</var> may be a symbol like
  798. <code>main</code>.
  799. If <code>-source <var>source</var></code> is specified, only dump symbols for that
  800. source file.
  801. </p>
  802. <p>These commands are used to debug the <small>GDB</small> symbol-reading code.
  803. These commands do not modify internal <small>GDB</small> state, therefore
  804. &lsquo;<samp>maint print symbols</samp>&rsquo; will only print symbols for already expanded symbol
  805. tables.
  806. You can use the command <code>info sources</code> to find out which files these are.
  807. If you use &lsquo;<samp>maint print psymbols</samp>&rsquo; instead, the dump shows information
  808. about symbols that <small>GDB</small> only knows partially&mdash;that is, symbols
  809. defined in files that <small>GDB</small> has skimmed, but not yet read completely.
  810. Finally, &lsquo;<samp>maint print msymbols</samp>&rsquo; just dumps &ldquo;minimal symbols&rdquo;, e.g.,
  811. &ldquo;ELF symbols&rdquo;.
  812. </p>
  813. <p>See <a href="Files.html#Files">Commands to Specify Files</a>, for a discussion of how
  814. <small>GDB</small> reads symbols (in the description of <code>symbol-file</code>).
  815. </p>
  816. <a name="index-maint-info-symtabs"></a>
  817. <a name="index-maint-info-psymtabs"></a>
  818. <a name="index-listing-GDB_0027s-internal-symbol-tables"></a>
  819. <a name="index-symbol-tables_002c-listing-GDB_0027s-internal"></a>
  820. <a name="index-full-symbol-tables_002c-listing-GDB_0027s-internal"></a>
  821. <a name="index-partial-symbol-tables_002c-listing-GDB_0027s-internal"></a>
  822. </dd>
  823. <dt><code>maint info symtabs <span class="roman">[</span> <var>regexp</var> <span class="roman">]</span></code></dt>
  824. <dt><code>maint info psymtabs <span class="roman">[</span> <var>regexp</var> <span class="roman">]</span></code></dt>
  825. <dd>
  826. <p>List the <code>struct symtab</code> or <code>struct partial_symtab</code>
  827. structures whose names match <var>regexp</var>. If <var>regexp</var> is not
  828. given, list them all. The output includes expressions which you can
  829. copy into a <small>GDB</small> debugging this one to examine a particular
  830. structure in more detail. For example:
  831. </p>
  832. <div class="smallexample">
  833. <pre class="smallexample">(gdb) maint info psymtabs dwarf2read
  834. { objfile /home/gnu/build/gdb/gdb
  835. ((struct objfile *) 0x82e69d0)
  836. { psymtab /home/gnu/src/gdb/dwarf2read.c
  837. ((struct partial_symtab *) 0x8474b10)
  838. readin no
  839. fullname (null)
  840. text addresses 0x814d3c8 -- 0x8158074
  841. globals (* (struct partial_symbol **) 0x8507a08 @ 9)
  842. statics (* (struct partial_symbol **) 0x40e95b78 @ 2882)
  843. dependencies (none)
  844. }
  845. }
  846. (gdb) maint info symtabs
  847. (gdb)
  848. </pre></div>
  849. <p>We see that there is one partial symbol table whose filename contains
  850. the string &lsquo;<samp>dwarf2read</samp>&rsquo;, belonging to the &lsquo;<samp>gdb</samp>&rsquo; executable;
  851. and we see that <small>GDB</small> has not read in any symtabs yet at all.
  852. If we set a breakpoint on a function, that will cause <small>GDB</small> to
  853. read the symtab for the compilation unit containing that function:
  854. </p>
  855. <div class="smallexample">
  856. <pre class="smallexample">(gdb) break dwarf2_psymtab_to_symtab
  857. Breakpoint 1 at 0x814e5da: file /home/gnu/src/gdb/dwarf2read.c,
  858. line 1574.
  859. (gdb) maint info symtabs
  860. { objfile /home/gnu/build/gdb/gdb
  861. ((struct objfile *) 0x82e69d0)
  862. { symtab /home/gnu/src/gdb/dwarf2read.c
  863. ((struct symtab *) 0x86c1f38)
  864. dirname (null)
  865. fullname (null)
  866. blockvector ((struct blockvector *) 0x86c1bd0) (primary)
  867. linetable ((struct linetable *) 0x8370fa0)
  868. debugformat DWARF 2
  869. }
  870. }
  871. (gdb)
  872. </pre></div>
  873. <a name="index-maint-info-line_002dtable"></a>
  874. <a name="index-listing-GDB_0027s-internal-line-tables"></a>
  875. <a name="index-line-tables_002c-listing-GDB_0027s-internal"></a>
  876. </dd>
  877. <dt><code>maint info line-table <span class="roman">[</span> <var>regexp</var> <span class="roman">]</span></code></dt>
  878. <dd>
  879. <p>List the <code>struct linetable</code> from all <code>struct symtab</code>
  880. instances whose name matches <var>regexp</var>. If <var>regexp</var> is not
  881. given, list the <code>struct linetable</code> from all <code>struct symtab</code>.
  882. </p>
  883. <a name="index-maint-set-symbol_002dcache_002dsize"></a>
  884. <a name="index-symbol-cache-size"></a>
  885. </dd>
  886. <dt><code>maint set symbol-cache-size <var>size</var></code></dt>
  887. <dd><p>Set the size of the symbol cache to <var>size</var>.
  888. The default size is intended to be good enough for debugging
  889. most applications. This option exists to allow for experimenting
  890. with different sizes.
  891. </p>
  892. <a name="index-maint-show-symbol_002dcache_002dsize"></a>
  893. </dd>
  894. <dt><code>maint show symbol-cache-size</code></dt>
  895. <dd><p>Show the size of the symbol cache.
  896. </p>
  897. <a name="index-maint-print-symbol_002dcache"></a>
  898. <a name="index-symbol-cache_002c-printing-its-contents"></a>
  899. </dd>
  900. <dt><code>maint print symbol-cache</code></dt>
  901. <dd><p>Print the contents of the symbol cache.
  902. This is useful when debugging symbol cache issues.
  903. </p>
  904. <a name="index-maint-print-symbol_002dcache_002dstatistics"></a>
  905. <a name="index-symbol-cache_002c-printing-usage-statistics"></a>
  906. </dd>
  907. <dt><code>maint print symbol-cache-statistics</code></dt>
  908. <dd><p>Print symbol cache usage statistics.
  909. This helps determine how well the cache is being utilized.
  910. </p>
  911. <a name="index-maint-flush_002dsymbol_002dcache"></a>
  912. <a name="index-symbol-cache_002c-flushing"></a>
  913. </dd>
  914. <dt><code>maint flush-symbol-cache</code></dt>
  915. <dd><p>Flush the contents of the symbol cache, all entries are removed.
  916. This command is useful when debugging the symbol cache.
  917. It is also useful when collecting performance data.
  918. </p>
  919. </dd>
  920. </dl>
  921. <hr>
  922. <div class="header">
  923. <p>
  924. Next: <a href="Altering.html#Altering" accesskey="n" rel="next">Altering</a>, Previous: <a href="Languages.html#Languages" accesskey="p" rel="previous">Languages</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</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>
  925. </div>
  926. </body>
  927. </html>