GDB_002fMI-Symbol-Query.html 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1988-2020 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation; with the
  7. Invariant Sections being "Free Software" and "Free Software Needs
  8. Free Documentation", with the Front-Cover Texts being "A GNU Manual,"
  9. and with the Back-Cover Texts as in (a) below.
  10. (a) The FSF's Back-Cover Text is: "You are free to copy and modify
  11. this GNU Manual. Buying copies from GNU Press supports the FSF in
  12. developing GNU and promoting software freedom." -->
  13. <!-- Created by GNU Texinfo 5.1, http://www.gnu.org/software/texinfo/ -->
  14. <head>
  15. <title>Debugging with GDB: GDB/MI Symbol Query</title>
  16. <meta name="description" content="Debugging with GDB: GDB/MI Symbol Query">
  17. <meta name="keywords" content="Debugging with GDB: GDB/MI Symbol Query">
  18. <meta name="resource-type" content="document">
  19. <meta name="distribution" content="global">
  20. <meta name="Generator" content="makeinfo">
  21. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  22. <link href="index.html#Top" rel="start" title="Top">
  23. <link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
  24. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  25. <link href="GDB_002fMI.html#GDB_002fMI" rel="up" title="GDB/MI">
  26. <link href="GDB_002fMI-File-Commands.html#GDB_002fMI-File-Commands" rel="next" title="GDB/MI File Commands">
  27. <link href="GDB_002fMI-Tracepoint-Commands.html#GDB_002fMI-Tracepoint-Commands" rel="previous" title="GDB/MI Tracepoint Commands">
  28. <style type="text/css">
  29. <!--
  30. a.summary-letter {text-decoration: none}
  31. blockquote.smallquotation {font-size: smaller}
  32. div.display {margin-left: 3.2em}
  33. div.example {margin-left: 3.2em}
  34. div.indentedblock {margin-left: 3.2em}
  35. div.lisp {margin-left: 3.2em}
  36. div.smalldisplay {margin-left: 3.2em}
  37. div.smallexample {margin-left: 3.2em}
  38. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  39. div.smalllisp {margin-left: 3.2em}
  40. kbd {font-style:oblique}
  41. pre.display {font-family: inherit}
  42. pre.format {font-family: inherit}
  43. pre.menu-comment {font-family: serif}
  44. pre.menu-preformatted {font-family: serif}
  45. pre.smalldisplay {font-family: inherit; font-size: smaller}
  46. pre.smallexample {font-size: smaller}
  47. pre.smallformat {font-family: inherit; font-size: smaller}
  48. pre.smalllisp {font-size: smaller}
  49. span.nocodebreak {white-space:nowrap}
  50. span.nolinebreak {white-space:nowrap}
  51. span.roman {font-family:serif; font-weight:normal}
  52. span.sansserif {font-family:sans-serif; font-weight:normal}
  53. ul.no-bullet {list-style: none}
  54. -->
  55. </style>
  56. </head>
  57. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  58. <a name="GDB_002fMI-Symbol-Query"></a>
  59. <div class="header">
  60. <p>
  61. Next: <a href="GDB_002fMI-File-Commands.html#GDB_002fMI-File-Commands" accesskey="n" rel="next">GDB/MI File Commands</a>, Previous: <a href="GDB_002fMI-Tracepoint-Commands.html#GDB_002fMI-Tracepoint-Commands" accesskey="p" rel="previous">GDB/MI Tracepoint Commands</a>, Up: <a href="GDB_002fMI.html#GDB_002fMI" accesskey="u" rel="up">GDB/MI</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
  62. </div>
  63. <hr>
  64. <a name="GDB_002fMI-Symbol-Query-Commands"></a>
  65. <h3 class="section">27.18 <small>GDB/MI</small> Symbol Query Commands</h3>
  66. <a name="The-_002dsymbol_002dinfo_002dfunctions-Command"></a>
  67. <h4 class="subheading">The <code>-symbol-info-functions</code> Command</h4>
  68. <a name="index-_002dsymbol_002dinfo_002dfunctions"></a>
  69. <a name="g_t_002dsymbol_002dinfo_002dfunctions"></a>
  70. <a name="Synopsis-80"></a>
  71. <h4 class="subsubheading">Synopsis</h4>
  72. <div class="smallexample">
  73. <pre class="smallexample"> -symbol-info-functions [--include-nondebug]
  74. [--type <var>type_regexp</var>]
  75. [--name <var>name_regexp</var>]
  76. [--max-results <var>limit</var>]
  77. </pre></div>
  78. <p>Return a list containing the names and types for all global functions
  79. taken from the debug information. The functions are grouped by source
  80. file, and shown with the line number on which each function is
  81. defined.
  82. </p>
  83. <p>The <code>--include-nondebug</code> option causes the output to include
  84. code symbols from the symbol table.
  85. </p>
  86. <p>The options <code>--type</code> and <code>--name</code> allow the symbols returned
  87. to be filtered based on either the name of the function, or the type
  88. signature of the function.
  89. </p>
  90. <p>The option <code>--max-results</code> restricts the command to return no
  91. more than <var>limit</var> results. If exactly <var>limit</var> results are
  92. returned then there might be additional results available if a higher
  93. limit is used.
  94. </p>
  95. <a name="GDB-Command-62"></a>
  96. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  97. <p>The corresponding <small>GDB</small> command is &lsquo;<samp>info functions</samp>&rsquo;.
  98. </p>
  99. <a name="Example-62"></a>
  100. <h4 class="subsubheading">Example</h4>
  101. <div class="smallexample">
  102. <pre class="smallexample">(gdb)
  103. -symbol-info-functions
  104. ^done,symbols=
  105. {debug=
  106. [{filename=&quot;/project/gdb/testsuite/gdb.mi/mi-sym-info-1.c&quot;,
  107. fullname=&quot;/project/gdb/testsuite/gdb.mi/mi-sym-info-1.c&quot;,
  108. symbols=[{line=&quot;36&quot;, name=&quot;f4&quot;, type=&quot;void (int *)&quot;,
  109. description=&quot;void f4(int *);&quot;},
  110. {line=&quot;42&quot;, name=&quot;main&quot;, type=&quot;int ()&quot;,
  111. description=&quot;int main();&quot;},
  112. {line=&quot;30&quot;, name=&quot;f1&quot;, type=&quot;my_int_t (int, int)&quot;,
  113. description=&quot;static my_int_t f1(int, int);&quot;}]},
  114. {filename=&quot;/project/gdb/testsuite/gdb.mi/mi-sym-info-2.c&quot;,
  115. fullname=&quot;/project/gdb/testsuite/gdb.mi/mi-sym-info-2.c&quot;,
  116. symbols=[{line=&quot;33&quot;, name=&quot;f2&quot;, type=&quot;float (another_float_t)&quot;,
  117. description=&quot;float f2(another_float_t);&quot;},
  118. {line=&quot;39&quot;, name=&quot;f3&quot;, type=&quot;int (another_int_t)&quot;,
  119. description=&quot;int f3(another_int_t);&quot;},
  120. {line=&quot;27&quot;, name=&quot;f1&quot;, type=&quot;another_float_t (int)&quot;,
  121. description=&quot;static another_float_t f1(int);&quot;}]}]}
  122. </pre><pre class="smallexample">(gdb)
  123. -symbol-info-functions --name f1
  124. ^done,symbols=
  125. {debug=
  126. [{filename=&quot;/project/gdb/testsuite/gdb.mi/mi-sym-info-1.c&quot;,
  127. fullname=&quot;/project/gdb/testsuite/gdb.mi/mi-sym-info-1.c&quot;,
  128. symbols=[{line=&quot;30&quot;, name=&quot;f1&quot;, type=&quot;my_int_t (int, int)&quot;,
  129. description=&quot;static my_int_t f1(int, int);&quot;}]},
  130. {filename=&quot;/project/gdb/testsuite/gdb.mi/mi-sym-info-2.c&quot;,
  131. fullname=&quot;/project/gdb/testsuite/gdb.mi/mi-sym-info-2.c&quot;,
  132. symbols=[{line=&quot;27&quot;, name=&quot;f1&quot;, type=&quot;another_float_t (int)&quot;,
  133. description=&quot;static another_float_t f1(int);&quot;}]}]}
  134. </pre><pre class="smallexample">(gdb)
  135. -symbol-info-functions --type void
  136. ^done,symbols=
  137. {debug=
  138. [{filename=&quot;/project/gdb/testsuite/gdb.mi/mi-sym-info-1.c&quot;,
  139. fullname=&quot;/project/gdb/testsuite/gdb.mi/mi-sym-info-1.c&quot;,
  140. symbols=[{line=&quot;36&quot;, name=&quot;f4&quot;, type=&quot;void (int *)&quot;,
  141. description=&quot;void f4(int *);&quot;}]}]}
  142. </pre><pre class="smallexample">(gdb)
  143. -symbol-info-functions --include-nondebug
  144. ^done,symbols=
  145. {debug=
  146. [{filename=&quot;/project/gdb/testsuite/gdb.mi/mi-sym-info-1.c&quot;,
  147. fullname=&quot;/project/gdb/testsuite/gdb.mi/mi-sym-info-1.c&quot;,
  148. symbols=[{line=&quot;36&quot;, name=&quot;f4&quot;, type=&quot;void (int *)&quot;,
  149. description=&quot;void f4(int *);&quot;},
  150. {line=&quot;42&quot;, name=&quot;main&quot;, type=&quot;int ()&quot;,
  151. description=&quot;int main();&quot;},
  152. {line=&quot;30&quot;, name=&quot;f1&quot;, type=&quot;my_int_t (int, int)&quot;,
  153. description=&quot;static my_int_t f1(int, int);&quot;}]},
  154. {filename=&quot;/project/gdb/testsuite/gdb.mi/mi-sym-info-2.c&quot;,
  155. fullname=&quot;/project/gdb/testsuite/gdb.mi/mi-sym-info-2.c&quot;,
  156. symbols=[{line=&quot;33&quot;, name=&quot;f2&quot;, type=&quot;float (another_float_t)&quot;,
  157. description=&quot;float f2(another_float_t);&quot;},
  158. {line=&quot;39&quot;, name=&quot;f3&quot;, type=&quot;int (another_int_t)&quot;,
  159. description=&quot;int f3(another_int_t);&quot;},
  160. {line=&quot;27&quot;, name=&quot;f1&quot;, type=&quot;another_float_t (int)&quot;,
  161. description=&quot;static another_float_t f1(int);&quot;}]}],
  162. nondebug=
  163. [{address=&quot;0x0000000000400398&quot;,name=&quot;_init&quot;},
  164. {address=&quot;0x00000000004003b0&quot;,name=&quot;_start&quot;},
  165. ...
  166. ]}
  167. </pre></div>
  168. <a name="The-_002dsymbol_002dinfo_002dmodule_002dfunctions-Command"></a>
  169. <h4 class="subheading">The <code>-symbol-info-module-functions</code> Command</h4>
  170. <a name="index-_002dsymbol_002dinfo_002dmodule_002dfunctions"></a>
  171. <a name="g_t_002dsymbol_002dinfo_002dmodule_002dfunctions"></a>
  172. <a name="Synopsis-81"></a>
  173. <h4 class="subsubheading">Synopsis</h4>
  174. <div class="smallexample">
  175. <pre class="smallexample"> -symbol-info-module-functions [--module <var>module_regexp</var>]
  176. [--name <var>name_regexp</var>]
  177. [--type <var>type_regexp</var>]
  178. </pre></div>
  179. <p>Return a list containing the names of all known functions within all
  180. know Fortran modules. The functions are grouped by source file and
  181. containing module, and shown with the line number on which each
  182. function is defined.
  183. </p>
  184. <p>The option <code>--module</code> only returns results for modules matching
  185. <var>module_regexp</var>. The option <code>--name</code> only returns functions
  186. whose name matches <var>name_regexp</var>, and <code>--type</code> only returns
  187. functions whose type matches <var>type_regexp</var>.
  188. </p>
  189. <a name="GDB-Command-63"></a>
  190. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  191. <p>The corresponding <small>GDB</small> command is &lsquo;<samp>info module functions</samp>&rsquo;.
  192. </p>
  193. <a name="Example-63"></a>
  194. <h4 class="subsubheading">Example</h4>
  195. <div class="smallexample">
  196. <pre class="smallexample">(gdb)
  197. -symbol-info-module-functions
  198. ^done,symbols=
  199. [{module=&quot;mod1&quot;,
  200. files=[{filename=&quot;/project/gdb/testsuite/gdb.mi/mi-fortran-modules-2.f90&quot;,
  201. fullname=&quot;/project/gdb/testsuite/gdb.mi/mi-fortran-modules-2.f90&quot;,
  202. symbols=[{line=&quot;21&quot;,name=&quot;mod1::check_all&quot;,type=&quot;void (void)&quot;,
  203. description=&quot;void mod1::check_all(void);&quot;}]}]},
  204. {module=&quot;mod2&quot;,
  205. files=[{filename=&quot;/project/gdb/testsuite/gdb.mi/mi-fortran-modules-2.f90&quot;,
  206. fullname=&quot;/project/gdb/testsuite/gdb.mi/mi-fortran-modules-2.f90&quot;,
  207. symbols=[{line=&quot;30&quot;,name=&quot;mod2::check_var_i&quot;,type=&quot;void (void)&quot;,
  208. description=&quot;void mod2::check_var_i(void);&quot;}]}]},
  209. {module=&quot;mod3&quot;,
  210. files=[{filename=&quot;/projec/gdb/testsuite/gdb.mi/mi-fortran-modules.f90&quot;,
  211. fullname=&quot;/projec/gdb/testsuite/gdb.mi/mi-fortran-modules.f90&quot;,
  212. symbols=[{line=&quot;21&quot;,name=&quot;mod3::check_all&quot;,type=&quot;void (void)&quot;,
  213. description=&quot;void mod3::check_all(void);&quot;},
  214. {line=&quot;27&quot;,name=&quot;mod3::check_mod2&quot;,type=&quot;void (void)&quot;,
  215. description=&quot;void mod3::check_mod2(void);&quot;}]}]},
  216. {module=&quot;modmany&quot;,
  217. files=[{filename=&quot;/project/gdb/testsuite/gdb.mi/mi-fortran-modules.f90&quot;,
  218. fullname=&quot;/project/gdb/testsuite/gdb.mi/mi-fortran-modules.f90&quot;,
  219. symbols=[{line=&quot;35&quot;,name=&quot;modmany::check_some&quot;,type=&quot;void (void)&quot;,
  220. description=&quot;void modmany::check_some(void);&quot;}]}]},
  221. {module=&quot;moduse&quot;,
  222. files=[{filename=&quot;/project/gdb/testsuite/gdb.mi/mi-fortran-modules.f90&quot;,
  223. fullname=&quot;/project/gdb/testsuite/gdb.mi/mi-fortran-modules.f90&quot;,
  224. symbols=[{line=&quot;44&quot;,name=&quot;moduse::check_all&quot;,type=&quot;void (void)&quot;,
  225. description=&quot;void moduse::check_all(void);&quot;},
  226. {line=&quot;49&quot;,name=&quot;moduse::check_var_x&quot;,type=&quot;void (void)&quot;,
  227. description=&quot;void moduse::check_var_x(void);&quot;}]}]}]
  228. </pre></div>
  229. <a name="The-_002dsymbol_002dinfo_002dmodule_002dvariables-Command"></a>
  230. <h4 class="subheading">The <code>-symbol-info-module-variables</code> Command</h4>
  231. <a name="index-_002dsymbol_002dinfo_002dmodule_002dvariables"></a>
  232. <a name="g_t_002dsymbol_002dinfo_002dmodule_002dvariables"></a>
  233. <a name="Synopsis-82"></a>
  234. <h4 class="subsubheading">Synopsis</h4>
  235. <div class="smallexample">
  236. <pre class="smallexample"> -symbol-info-module-variables [--module <var>module_regexp</var>]
  237. [--name <var>name_regexp</var>]
  238. [--type <var>type_regexp</var>]
  239. </pre></div>
  240. <p>Return a list containing the names of all known variables within all
  241. know Fortran modules. The variables are grouped by source file and
  242. containing module, and shown with the line number on which each
  243. variable is defined.
  244. </p>
  245. <p>The option <code>--module</code> only returns results for modules matching
  246. <var>module_regexp</var>. The option <code>--name</code> only returns variables
  247. whose name matches <var>name_regexp</var>, and <code>--type</code> only returns
  248. variables whose type matches <var>type_regexp</var>.
  249. </p>
  250. <a name="GDB-Command-64"></a>
  251. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  252. <p>The corresponding <small>GDB</small> command is &lsquo;<samp>info module variables</samp>&rsquo;.
  253. </p>
  254. <a name="Example-64"></a>
  255. <h4 class="subsubheading">Example</h4>
  256. <div class="smallexample">
  257. <pre class="smallexample">(gdb)
  258. -symbol-info-module-variables
  259. ^done,symbols=
  260. [{module=&quot;mod1&quot;,
  261. files=[{filename=&quot;/project/gdb/testsuite/gdb.mi/mi-fortran-modules-2.f90&quot;,
  262. fullname=&quot;/project/gdb/testsuite/gdb.mi/mi-fortran-modules-2.f90&quot;,
  263. symbols=[{line=&quot;18&quot;,name=&quot;mod1::var_const&quot;,type=&quot;integer(kind=4)&quot;,
  264. description=&quot;integer(kind=4) mod1::var_const;&quot;},
  265. {line=&quot;17&quot;,name=&quot;mod1::var_i&quot;,type=&quot;integer(kind=4)&quot;,
  266. description=&quot;integer(kind=4) mod1::var_i;&quot;}]}]},
  267. {module=&quot;mod2&quot;,
  268. files=[{filename=&quot;/project/gdb/testsuite/gdb.mi/mi-fortran-modules-2.f90&quot;,
  269. fullname=&quot;/project/gdb/testsuite/gdb.mi/mi-fortran-modules-2.f90&quot;,
  270. symbols=[{line=&quot;28&quot;,name=&quot;mod2::var_i&quot;,type=&quot;integer(kind=4)&quot;,
  271. description=&quot;integer(kind=4) mod2::var_i;&quot;}]}]},
  272. {module=&quot;mod3&quot;,
  273. files=[{filename=&quot;/project/gdb/testsuite/gdb.mi/mi-fortran-modules.f90&quot;,
  274. fullname=&quot;/project/gdb/testsuite/gdb.mi/mi-fortran-modules.f90&quot;,
  275. symbols=[{line=&quot;18&quot;,name=&quot;mod3::mod1&quot;,type=&quot;integer(kind=4)&quot;,
  276. description=&quot;integer(kind=4) mod3::mod1;&quot;},
  277. {line=&quot;17&quot;,name=&quot;mod3::mod2&quot;,type=&quot;integer(kind=4)&quot;,
  278. description=&quot;integer(kind=4) mod3::mod2;&quot;},
  279. {line=&quot;19&quot;,name=&quot;mod3::var_i&quot;,type=&quot;integer(kind=4)&quot;,
  280. description=&quot;integer(kind=4) mod3::var_i;&quot;}]}]},
  281. {module=&quot;modmany&quot;,
  282. files=[{filename=&quot;/project/gdb/testsuite/gdb.mi/mi-fortran-modules.f90&quot;,
  283. fullname=&quot;/project/gdb/testsuite/gdb.mi/mi-fortran-modules.f90&quot;,
  284. symbols=[{line=&quot;33&quot;,name=&quot;modmany::var_a&quot;,type=&quot;integer(kind=4)&quot;,
  285. description=&quot;integer(kind=4) modmany::var_a;&quot;},
  286. {line=&quot;33&quot;,name=&quot;modmany::var_b&quot;,type=&quot;integer(kind=4)&quot;,
  287. description=&quot;integer(kind=4) modmany::var_b;&quot;},
  288. {line=&quot;33&quot;,name=&quot;modmany::var_c&quot;,type=&quot;integer(kind=4)&quot;,
  289. description=&quot;integer(kind=4) modmany::var_c;&quot;},
  290. {line=&quot;33&quot;,name=&quot;modmany::var_i&quot;,type=&quot;integer(kind=4)&quot;,
  291. description=&quot;integer(kind=4) modmany::var_i;&quot;}]}]},
  292. {module=&quot;moduse&quot;,
  293. files=[{filename=&quot;/project/gdb/testsuite/gdb.mi/mi-fortran-modules.f90&quot;,
  294. fullname=&quot;/project/gdb/testsuite/gdb.mi/mi-fortran-modules.f90&quot;,
  295. symbols=[{line=&quot;42&quot;,name=&quot;moduse::var_x&quot;,type=&quot;integer(kind=4)&quot;,
  296. description=&quot;integer(kind=4) moduse::var_x;&quot;},
  297. {line=&quot;42&quot;,name=&quot;moduse::var_y&quot;,type=&quot;integer(kind=4)&quot;,
  298. description=&quot;integer(kind=4) moduse::var_y;&quot;}]}]}]
  299. </pre></div>
  300. <a name="The-_002dsymbol_002dinfo_002dmodules-Command"></a>
  301. <h4 class="subheading">The <code>-symbol-info-modules</code> Command</h4>
  302. <a name="index-_002dsymbol_002dinfo_002dmodules"></a>
  303. <a name="g_t_002dsymbol_002dinfo_002dmodules"></a>
  304. <a name="Synopsis-83"></a>
  305. <h4 class="subsubheading">Synopsis</h4>
  306. <div class="smallexample">
  307. <pre class="smallexample"> -symbol-info-modules [--name <var>name_regexp</var>]
  308. [--max-results <var>limit</var>]
  309. </pre></div>
  310. <p>Return a list containing the names of all known Fortran modules. The
  311. modules are grouped by source file, and shown with the line number on
  312. which each modules is defined.
  313. </p>
  314. <p>The option <code>--name</code> allows the modules returned to be filtered
  315. based the name of the module.
  316. </p>
  317. <p>The option <code>--max-results</code> restricts the command to return no
  318. more than <var>limit</var> results. If exactly <var>limit</var> results are
  319. returned then there might be additional results available if a higher
  320. limit is used.
  321. </p>
  322. <a name="GDB-Command-65"></a>
  323. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  324. <p>The corresponding <small>GDB</small> command is &lsquo;<samp>info modules</samp>&rsquo;.
  325. </p>
  326. <a name="Example-65"></a>
  327. <h4 class="subsubheading">Example</h4>
  328. <div class="smallexample">
  329. <pre class="smallexample">(gdb)
  330. -symbol-info-modules
  331. ^done,symbols=
  332. {debug=
  333. [{filename=&quot;/project/gdb/testsuite/gdb.mi/mi-fortran-modules-2.f90&quot;,
  334. fullname=&quot;/project/gdb/testsuite/gdb.mi/mi-fortran-modules-2.f90&quot;,
  335. symbols=[{line=&quot;16&quot;,name=&quot;mod1&quot;},
  336. {line=&quot;22&quot;,name=&quot;mod2&quot;}]},
  337. {filename=&quot;/project/gdb/testsuite/gdb.mi/mi-fortran-modules.f90&quot;,
  338. fullname=&quot;/project/gdb/testsuite/gdb.mi/mi-fortran-modules.f90&quot;,
  339. symbols=[{line=&quot;16&quot;,name=&quot;mod3&quot;},
  340. {line=&quot;22&quot;,name=&quot;modmany&quot;},
  341. {line=&quot;26&quot;,name=&quot;moduse&quot;}]}]}
  342. </pre><pre class="smallexample">(gdb)
  343. -symbol-info-modules --name mod[123]
  344. ^done,symbols=
  345. {debug=
  346. [{filename=&quot;/project/gdb/testsuite/gdb.mi/mi-fortran-modules-2.f90&quot;,
  347. fullname=&quot;/project/gdb/testsuite/gdb.mi/mi-fortran-modules-2.f90&quot;,
  348. symbols=[{line=&quot;16&quot;,name=&quot;mod1&quot;},
  349. {line=&quot;22&quot;,name=&quot;mod2&quot;}]},
  350. {filename=&quot;/project/gdb/testsuite/gdb.mi/mi-fortran-modules.f90&quot;,
  351. fullname=&quot;/project/gdb/testsuite/gdb.mi/mi-fortran-modules.f90&quot;,
  352. symbols=[{line=&quot;16&quot;,name=&quot;mod3&quot;}]}]}
  353. </pre></div>
  354. <a name="The-_002dsymbol_002dinfo_002dtypes-Command"></a>
  355. <h4 class="subheading">The <code>-symbol-info-types</code> Command</h4>
  356. <a name="index-_002dsymbol_002dinfo_002dtypes"></a>
  357. <a name="g_t_002dsymbol_002dinfo_002dtypes"></a>
  358. <a name="Synopsis-84"></a>
  359. <h4 class="subsubheading">Synopsis</h4>
  360. <div class="smallexample">
  361. <pre class="smallexample"> -symbol-info-types [--name <var>name_regexp</var>]
  362. [--max-results <var>limit</var>]
  363. </pre></div>
  364. <p>Return a list of all defined types. The types are grouped by source
  365. file, and shown with the line number on which each user defined type
  366. is defined. Some base types are not defined in the source code but
  367. are added to the debug information by the compiler, for example
  368. <code>int</code>, <code>float</code>, etc.; these types do not have an associated
  369. line number.
  370. </p>
  371. <p>The option <code>--name</code> allows the list of types returned to be
  372. filtered by name.
  373. </p>
  374. <p>The option <code>--max-results</code> restricts the command to return no
  375. more than <var>limit</var> results. If exactly <var>limit</var> results are
  376. returned then there might be additional results available if a higher
  377. limit is used.
  378. </p>
  379. <a name="GDB-Command-66"></a>
  380. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  381. <p>The corresponding <small>GDB</small> command is &lsquo;<samp>info types</samp>&rsquo;.
  382. </p>
  383. <a name="Example-66"></a>
  384. <h4 class="subsubheading">Example</h4>
  385. <div class="smallexample">
  386. <pre class="smallexample">(gdb)
  387. -symbol-info-types
  388. ^done,symbols=
  389. {debug=
  390. [{filename=&quot;gdb.mi/mi-sym-info-1.c&quot;,
  391. fullname=&quot;/project/gdb/testsuite/gdb.mi/mi-sym-info-1.c&quot;,
  392. symbols=[{name=&quot;float&quot;},
  393. {name=&quot;int&quot;},
  394. {line=&quot;27&quot;,name=&quot;typedef int my_int_t;&quot;}]},
  395. {filename=&quot;gdb.mi/mi-sym-info-2.c&quot;,
  396. fullname=&quot;/project/gdb.mi/mi-sym-info-2.c&quot;,
  397. symbols=[{line=&quot;24&quot;,name=&quot;typedef float another_float_t;&quot;},
  398. {line=&quot;23&quot;,name=&quot;typedef int another_int_t;&quot;},
  399. {name=&quot;float&quot;},
  400. {name=&quot;int&quot;}]}]}
  401. </pre><pre class="smallexample">(gdb)
  402. -symbol-info-types --name _int_
  403. ^done,symbols=
  404. {debug=
  405. [{filename=&quot;gdb.mi/mi-sym-info-1.c&quot;,
  406. fullname=&quot;/project/gdb/testsuite/gdb.mi/mi-sym-info-1.c&quot;,
  407. symbols=[{line=&quot;27&quot;,name=&quot;typedef int my_int_t;&quot;}]},
  408. {filename=&quot;gdb.mi/mi-sym-info-2.c&quot;,
  409. fullname=&quot;/project/gdb.mi/mi-sym-info-2.c&quot;,
  410. symbols=[{line=&quot;23&quot;,name=&quot;typedef int another_int_t;&quot;}]}]}
  411. </pre></div>
  412. <a name="The-_002dsymbol_002dinfo_002dvariables-Command"></a>
  413. <h4 class="subheading">The <code>-symbol-info-variables</code> Command</h4>
  414. <a name="index-_002dsymbol_002dinfo_002dvariables"></a>
  415. <a name="g_t_002dsymbol_002dinfo_002dvariables"></a>
  416. <a name="Synopsis-85"></a>
  417. <h4 class="subsubheading">Synopsis</h4>
  418. <div class="smallexample">
  419. <pre class="smallexample"> -symbol-info-variables [--include-nondebug]
  420. [--type <var>type_regexp</var>]
  421. [--name <var>name_regexp</var>]
  422. [--max-results <var>limit</var>]
  423. </pre></div>
  424. <p>Return a list containing the names and types for all global variables
  425. taken from the debug information. The variables are grouped by source
  426. file, and shown with the line number on which each variable is
  427. defined.
  428. </p>
  429. <p>The <code>--include-nondebug</code> option causes the output to include
  430. data symbols from the symbol table.
  431. </p>
  432. <p>The options <code>--type</code> and <code>--name</code> allow the symbols returned
  433. to be filtered based on either the name of the variable, or the type
  434. of the variable.
  435. </p>
  436. <p>The option <code>--max-results</code> restricts the command to return no
  437. more than <var>limit</var> results. If exactly <var>limit</var> results are
  438. returned then there might be additional results available if a higher
  439. limit is used.
  440. </p>
  441. <a name="GDB-Command-67"></a>
  442. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  443. <p>The corresponding <small>GDB</small> command is &lsquo;<samp>info variables</samp>&rsquo;.
  444. </p>
  445. <a name="Example-67"></a>
  446. <h4 class="subsubheading">Example</h4>
  447. <div class="smallexample">
  448. <pre class="smallexample">(gdb)
  449. -symbol-info-variables
  450. ^done,symbols=
  451. {debug=
  452. [{filename=&quot;/project/gdb/testsuite/gdb.mi/mi-sym-info-1.c&quot;,
  453. fullname=&quot;/project/gdb/testsuite/gdb.mi/mi-sym-info-1.c&quot;,
  454. symbols=[{line=&quot;25&quot;,name=&quot;global_f1&quot;,type=&quot;float&quot;,
  455. description=&quot;static float global_f1;&quot;},
  456. {line=&quot;24&quot;,name=&quot;global_i1&quot;,type=&quot;int&quot;,
  457. description=&quot;static int global_i1;&quot;}]},
  458. {filename=&quot;/project/gdb/testsuite/gdb.mi/mi-sym-info-2.c&quot;,
  459. fullname=&quot;/project/gdb/testsuite/gdb.mi/mi-sym-info-2.c&quot;,
  460. symbols=[{line=&quot;21&quot;,name=&quot;global_f2&quot;,type=&quot;int&quot;,
  461. description=&quot;int global_f2;&quot;},
  462. {line=&quot;20&quot;,name=&quot;global_i2&quot;,type=&quot;int&quot;,
  463. description=&quot;int global_i2;&quot;},
  464. {line=&quot;19&quot;,name=&quot;global_f1&quot;,type=&quot;float&quot;,
  465. description=&quot;static float global_f1;&quot;},
  466. {line=&quot;18&quot;,name=&quot;global_i1&quot;,type=&quot;int&quot;,
  467. description=&quot;static int global_i1;&quot;}]}]}
  468. </pre><pre class="smallexample">(gdb)
  469. -symbol-info-variables --name f1
  470. ^done,symbols=
  471. {debug=
  472. [{filename=&quot;/project/gdb/testsuite/gdb.mi/mi-sym-info-1.c&quot;,
  473. fullname=&quot;/project/gdb/testsuite/gdb.mi/mi-sym-info-1.c&quot;,
  474. symbols=[{line=&quot;25&quot;,name=&quot;global_f1&quot;,type=&quot;float&quot;,
  475. description=&quot;static float global_f1;&quot;}]},
  476. {filename=&quot;/project/gdb/testsuite/gdb.mi/mi-sym-info-2.c&quot;,
  477. fullname=&quot;/project/gdb/testsuite/gdb.mi/mi-sym-info-2.c&quot;,
  478. symbols=[{line=&quot;19&quot;,name=&quot;global_f1&quot;,type=&quot;float&quot;,
  479. description=&quot;static float global_f1;&quot;}]}]}
  480. </pre><pre class="smallexample">(gdb)
  481. -symbol-info-variables --type float
  482. ^done,symbols=
  483. {debug=
  484. [{filename=&quot;/project/gdb/testsuite/gdb.mi/mi-sym-info-1.c&quot;,
  485. fullname=&quot;/project/gdb/testsuite/gdb.mi/mi-sym-info-1.c&quot;,
  486. symbols=[{line=&quot;25&quot;,name=&quot;global_f1&quot;,type=&quot;float&quot;,
  487. description=&quot;static float global_f1;&quot;}]},
  488. {filename=&quot;/project/gdb/testsuite/gdb.mi/mi-sym-info-2.c&quot;,
  489. fullname=&quot;/project/gdb/testsuite/gdb.mi/mi-sym-info-2.c&quot;,
  490. symbols=[{line=&quot;19&quot;,name=&quot;global_f1&quot;,type=&quot;float&quot;,
  491. description=&quot;static float global_f1;&quot;}]}]}
  492. </pre><pre class="smallexample">(gdb)
  493. -symbol-info-variables --include-nondebug
  494. ^done,symbols=
  495. {debug=
  496. [{filename=&quot;/project/gdb/testsuite/gdb.mi/mi-sym-info-1.c&quot;,
  497. fullname=&quot;/project/gdb/testsuite/gdb.mi/mi-sym-info-1.c&quot;,
  498. symbols=[{line=&quot;25&quot;,name=&quot;global_f1&quot;,type=&quot;float&quot;,
  499. description=&quot;static float global_f1;&quot;},
  500. {line=&quot;24&quot;,name=&quot;global_i1&quot;,type=&quot;int&quot;,
  501. description=&quot;static int global_i1;&quot;}]},
  502. {filename=&quot;/project/gdb/testsuite/gdb.mi/mi-sym-info-2.c&quot;,
  503. fullname=&quot;/project/gdb/testsuite/gdb.mi/mi-sym-info-2.c&quot;,
  504. symbols=[{line=&quot;21&quot;,name=&quot;global_f2&quot;,type=&quot;int&quot;,
  505. description=&quot;int global_f2;&quot;},
  506. {line=&quot;20&quot;,name=&quot;global_i2&quot;,type=&quot;int&quot;,
  507. description=&quot;int global_i2;&quot;},
  508. {line=&quot;19&quot;,name=&quot;global_f1&quot;,type=&quot;float&quot;,
  509. description=&quot;static float global_f1;&quot;},
  510. {line=&quot;18&quot;,name=&quot;global_i1&quot;,type=&quot;int&quot;,
  511. description=&quot;static int global_i1;&quot;}]}],
  512. nondebug=
  513. [{address=&quot;0x00000000004005d0&quot;,name=&quot;_IO_stdin_used&quot;},
  514. {address=&quot;0x00000000004005d8&quot;,name=&quot;__dso_handle&quot;}
  515. ...
  516. ]}
  517. </pre></div>
  518. <a name="The-_002dsymbol_002dlist_002dlines-Command"></a>
  519. <h4 class="subheading">The <code>-symbol-list-lines</code> Command</h4>
  520. <a name="index-_002dsymbol_002dlist_002dlines"></a>
  521. <a name="Synopsis-86"></a>
  522. <h4 class="subsubheading">Synopsis</h4>
  523. <div class="smallexample">
  524. <pre class="smallexample"> -symbol-list-lines <var>filename</var>
  525. </pre></div>
  526. <p>Print the list of lines that contain code and their associated program
  527. addresses for the given source filename. The entries are sorted in
  528. ascending PC order.
  529. </p>
  530. <a name="GDB-Command-68"></a>
  531. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  532. <p>There is no corresponding <small>GDB</small> command.
  533. </p>
  534. <a name="Example-68"></a>
  535. <h4 class="subsubheading">Example</h4>
  536. <div class="smallexample">
  537. <pre class="smallexample">(gdb)
  538. -symbol-list-lines basics.c
  539. ^done,lines=[{pc=&quot;0x08048554&quot;,line=&quot;7&quot;},{pc=&quot;0x0804855a&quot;,line=&quot;8&quot;}]
  540. (gdb)
  541. </pre></div>
  542. <hr>
  543. <div class="header">
  544. <p>
  545. Next: <a href="GDB_002fMI-File-Commands.html#GDB_002fMI-File-Commands" accesskey="n" rel="next">GDB/MI File Commands</a>, Previous: <a href="GDB_002fMI-Tracepoint-Commands.html#GDB_002fMI-Tracepoint-Commands" accesskey="p" rel="previous">GDB/MI Tracepoint Commands</a>, Up: <a href="GDB_002fMI.html#GDB_002fMI" accesskey="u" rel="up">GDB/MI</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
  546. </div>
  547. </body>
  548. </html>