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.

GDB_002fMI-Symbol-Query.html 30KB

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