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.

Symbols.html 44KB

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