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.

298 lines
11KB

  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 File Commands (Debugging with GDB)</title>
  17. <meta name="description" content="GDB/MI File Commands (Debugging with GDB)">
  18. <meta name="keywords" content="GDB/MI File Commands (Debugging with GDB)">
  19. <meta name="resource-type" content="document">
  20. <meta name="distribution" content="global">
  21. <meta name="Generator" content="makeinfo">
  22. <link href="index.html#Top" rel="start" title="Top">
  23. <link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
  24. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  25. <link href="GDB_002fMI.html#GDB_002fMI" rel="up" title="GDB/MI">
  26. <link href="GDB_002fMI-Target-Manipulation.html#GDB_002fMI-Target-Manipulation" rel="next" title="GDB/MI Target Manipulation">
  27. <link href="GDB_002fMI-Symbol-Query.html#GDB_002fMI-Symbol-Query" rel="prev" title="GDB/MI Symbol Query">
  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-File-Commands"></a>
  58. <div class="header">
  59. <p>
  60. Next: <a href="GDB_002fMI-Target-Manipulation.html#GDB_002fMI-Target-Manipulation" accesskey="n" rel="next">GDB/MI Target Manipulation</a>, Previous: <a href="GDB_002fMI-Symbol-Query.html#GDB_002fMI-Symbol-Query" accesskey="p" rel="prev">GDB/MI Symbol Query</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-File-Commands-1"></a>
  64. <h3 class="section">27.19 <small>GDB/MI</small> File Commands</h3>
  65. <p>This section describes the GDB/MI commands to specify executable file names
  66. and to read in and obtain symbol table information.
  67. </p>
  68. <a name="The-_002dfile_002dexec_002dand_002dsymbols-Command"></a>
  69. <h4 class="subheading">The <code>-file-exec-and-symbols</code> Command</h4>
  70. <a name="index-_002dfile_002dexec_002dand_002dsymbols"></a>
  71. <a name="Synopsis-87"></a>
  72. <h4 class="subsubheading">Synopsis</h4>
  73. <div class="smallexample">
  74. <pre class="smallexample"> -file-exec-and-symbols <var>file</var>
  75. </pre></div>
  76. <p>Specify the executable file to be debugged. This file is the one from
  77. which the symbol table is also read. If no file is specified, the
  78. command clears the executable and symbol information. If breakpoints
  79. are set when using this command with no arguments, <small>GDB</small> will produce
  80. error messages. Otherwise, no output is produced, except a completion
  81. notification.
  82. </p>
  83. <a name="GDB-Command-69"></a>
  84. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  85. <p>The corresponding <small>GDB</small> command is &lsquo;<samp>file</samp>&rsquo;.
  86. </p>
  87. <a name="Example-69"></a>
  88. <h4 class="subsubheading">Example</h4>
  89. <div class="smallexample">
  90. <pre class="smallexample">(gdb)
  91. -file-exec-and-symbols /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
  92. ^done
  93. (gdb)
  94. </pre></div>
  95. <a name="The-_002dfile_002dexec_002dfile-Command"></a>
  96. <h4 class="subheading">The <code>-file-exec-file</code> Command</h4>
  97. <a name="index-_002dfile_002dexec_002dfile"></a>
  98. <a name="Synopsis-88"></a>
  99. <h4 class="subsubheading">Synopsis</h4>
  100. <div class="smallexample">
  101. <pre class="smallexample"> -file-exec-file <var>file</var>
  102. </pre></div>
  103. <p>Specify the executable file to be debugged. Unlike
  104. &lsquo;<samp>-file-exec-and-symbols</samp>&rsquo;, the symbol table is <em>not</em> read
  105. from this file. If used without argument, <small>GDB</small> clears the information
  106. about the executable file. No output is produced, except a completion
  107. notification.
  108. </p>
  109. <a name="GDB-Command-70"></a>
  110. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  111. <p>The corresponding <small>GDB</small> command is &lsquo;<samp>exec-file</samp>&rsquo;.
  112. </p>
  113. <a name="Example-70"></a>
  114. <h4 class="subsubheading">Example</h4>
  115. <div class="smallexample">
  116. <pre class="smallexample">(gdb)
  117. -file-exec-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
  118. ^done
  119. (gdb)
  120. </pre></div>
  121. <a name="The-_002dfile_002dlist_002dexec_002dsource_002dfile-Command"></a>
  122. <h4 class="subheading">The <code>-file-list-exec-source-file</code> Command</h4>
  123. <a name="index-_002dfile_002dlist_002dexec_002dsource_002dfile"></a>
  124. <a name="Synopsis-89"></a>
  125. <h4 class="subsubheading">Synopsis</h4>
  126. <div class="smallexample">
  127. <pre class="smallexample"> -file-list-exec-source-file
  128. </pre></div>
  129. <p>List the line number, the current source file, and the absolute path
  130. to the current source file for the current executable. The macro
  131. information field has a value of &lsquo;<samp>1</samp>&rsquo; or &lsquo;<samp>0</samp>&rsquo; depending on
  132. whether or not the file includes preprocessor macro information.
  133. </p>
  134. <a name="GDB-Command-71"></a>
  135. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  136. <p>The <small>GDB</small> equivalent is &lsquo;<samp>info source</samp>&rsquo;
  137. </p>
  138. <a name="Example-71"></a>
  139. <h4 class="subsubheading">Example</h4>
  140. <div class="smallexample">
  141. <pre class="smallexample">(gdb)
  142. 123-file-list-exec-source-file
  143. 123^done,line=&quot;1&quot;,file=&quot;foo.c&quot;,fullname=&quot;/home/bar/foo.c,macro-info=&quot;1&quot;
  144. (gdb)
  145. </pre></div>
  146. <a name="The-_002dfile_002dlist_002dexec_002dsource_002dfiles-Command"></a>
  147. <h4 class="subheading">The <code>-file-list-exec-source-files</code> Command</h4>
  148. <a name="index-_002dfile_002dlist_002dexec_002dsource_002dfiles"></a>
  149. <a name="Synopsis-90"></a>
  150. <h4 class="subsubheading">Synopsis</h4>
  151. <div class="smallexample">
  152. <pre class="smallexample"> -file-list-exec-source-files
  153. </pre></div>
  154. <p>List the source files for the current executable.
  155. </p>
  156. <p>It will always output both the filename and fullname (absolute file
  157. name) of a source file.
  158. </p>
  159. <a name="GDB-Command-72"></a>
  160. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  161. <p>The <small>GDB</small> equivalent is &lsquo;<samp>info sources</samp>&rsquo;.
  162. <code>gdbtk</code> has an analogous command &lsquo;<samp>gdb_listfiles</samp>&rsquo;.
  163. </p>
  164. <a name="Example-72"></a>
  165. <h4 class="subsubheading">Example</h4>
  166. <div class="smallexample">
  167. <pre class="smallexample">(gdb)
  168. -file-list-exec-source-files
  169. ^done,files=[
  170. {file=foo.c,fullname=/home/foo.c},
  171. {file=/home/bar.c,fullname=/home/bar.c},
  172. {file=gdb_could_not_find_fullpath.c}]
  173. (gdb)
  174. </pre></div>
  175. <a name="The-_002dfile_002dlist_002dshared_002dlibraries-Command"></a>
  176. <h4 class="subheading">The <code>-file-list-shared-libraries</code> Command</h4>
  177. <a name="index-_002dfile_002dlist_002dshared_002dlibraries"></a>
  178. <a name="Synopsis-91"></a>
  179. <h4 class="subsubheading">Synopsis</h4>
  180. <div class="smallexample">
  181. <pre class="smallexample"> -file-list-shared-libraries [ <var>regexp</var> ]
  182. </pre></div>
  183. <p>List the shared libraries in the program.
  184. With a regular expression <var>regexp</var>, only those libraries whose
  185. names match <var>regexp</var> are listed.
  186. </p>
  187. <a name="GDB-Command-73"></a>
  188. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  189. <p>The corresponding <small>GDB</small> command is &lsquo;<samp>info shared</samp>&rsquo;. The fields
  190. have a similar meaning to the <code>=library-loaded</code> notification.
  191. The <code>ranges</code> field specifies the multiple segments belonging to this
  192. library. Each range has the following fields:
  193. </p>
  194. <dl compact="compact">
  195. <dt>&lsquo;<samp>from</samp>&rsquo;</dt>
  196. <dd><p>The address defining the inclusive lower bound of the segment.
  197. </p></dd>
  198. <dt>&lsquo;<samp>to</samp>&rsquo;</dt>
  199. <dd><p>The address defining the exclusive upper bound of the segment.
  200. </p></dd>
  201. </dl>
  202. <a name="Example-73"></a>
  203. <h4 class="subsubheading">Example</h4>
  204. <div class="smallexample">
  205. <pre class="smallexample">(gdb)
  206. -file-list-exec-source-files
  207. ^done,shared-libraries=[
  208. {id=&quot;/lib/libfoo.so&quot;,target-name=&quot;/lib/libfoo.so&quot;,host-name=&quot;/lib/libfoo.so&quot;,symbols-loaded=&quot;1&quot;,thread-group=&quot;i1&quot;,ranges=[{from=&quot;0x72815989&quot;,to=&quot;0x728162c0&quot;}]},
  209. {id=&quot;/lib/libbar.so&quot;,target-name=&quot;/lib/libbar.so&quot;,host-name=&quot;/lib/libbar.so&quot;,symbols-loaded=&quot;1&quot;,thread-group=&quot;i1&quot;,ranges=[{from=&quot;0x76ee48c0&quot;,to=&quot;0x76ee9160&quot;}]}]
  210. (gdb)
  211. </pre></div>
  212. <a name="The-_002dfile_002dsymbol_002dfile-Command"></a>
  213. <h4 class="subheading">The <code>-file-symbol-file</code> Command</h4>
  214. <a name="index-_002dfile_002dsymbol_002dfile"></a>
  215. <a name="Synopsis-92"></a>
  216. <h4 class="subsubheading">Synopsis</h4>
  217. <div class="smallexample">
  218. <pre class="smallexample"> -file-symbol-file <var>file</var>
  219. </pre></div>
  220. <p>Read symbol table info from the specified <var>file</var> argument. When
  221. used without arguments, clears <small>GDB</small>&rsquo;s symbol table info. No output is
  222. produced, except for a completion notification.
  223. </p>
  224. <a name="GDB-Command-74"></a>
  225. <h4 class="subsubheading"><small>GDB</small> Command</h4>
  226. <p>The corresponding <small>GDB</small> command is &lsquo;<samp>symbol-file</samp>&rsquo;.
  227. </p>
  228. <a name="Example-74"></a>
  229. <h4 class="subsubheading">Example</h4>
  230. <div class="smallexample">
  231. <pre class="smallexample">(gdb)
  232. -file-symbol-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
  233. ^done
  234. (gdb)
  235. </pre></div>
  236. <hr>
  237. <div class="header">
  238. <p>
  239. Next: <a href="GDB_002fMI-Target-Manipulation.html#GDB_002fMI-Target-Manipulation" accesskey="n" rel="next">GDB/MI Target Manipulation</a>, Previous: <a href="GDB_002fMI-Symbol-Query.html#GDB_002fMI-Symbol-Query" accesskey="p" rel="prev">GDB/MI Symbol Query</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>
  240. </div>
  241. </body>
  242. </html>