Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

213 lines
9.0KB

  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>File Options (Debugging with GDB)</title>
  17. <meta name="description" content="File Options (Debugging with GDB)">
  18. <meta name="keywords" content="File Options (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="Invoking-GDB.html#Invoking-GDB" rel="up" title="Invoking GDB">
  26. <link href="Mode-Options.html#Mode-Options" rel="next" title="Mode Options">
  27. <link href="Invoking-GDB.html#Invoking-GDB" rel="prev" title="Invoking GDB">
  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="File-Options"></a>
  58. <div class="header">
  59. <p>
  60. Next: <a href="Mode-Options.html#Mode-Options" accesskey="n" rel="next">Mode Options</a>, Up: <a href="Invoking-GDB.html#Invoking-GDB" accesskey="u" rel="up">Invoking GDB</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="Choosing-Files"></a>
  64. <h4 class="subsection">2.1.1 Choosing Files</h4>
  65. <p>When <small>GDB</small> starts, it reads any arguments other than options as
  66. specifying an executable file and core file (or process ID). This is
  67. the same as if the arguments were specified by the &lsquo;<samp>-se</samp>&rsquo; and
  68. &lsquo;<samp>-c</samp>&rsquo; (or &lsquo;<samp>-p</samp>&rsquo;) options respectively. (<small>GDB</small> reads the
  69. first argument that does not have an associated option flag as
  70. equivalent to the &lsquo;<samp>-se</samp>&rsquo; option followed by that argument; and the
  71. second argument that does not have an associated option flag, if any, as
  72. equivalent to the &lsquo;<samp>-c</samp>&rsquo;/&lsquo;<samp>-p</samp>&rsquo; option followed by that argument.)
  73. If the second argument begins with a decimal digit, <small>GDB</small> will
  74. first attempt to attach to it as a process, and if that fails, attempt
  75. to open it as a corefile. If you have a corefile whose name begins with
  76. a digit, you can prevent <small>GDB</small> from treating it as a pid by
  77. prefixing it with <samp>./</samp>, e.g. <samp>./12345</samp>.
  78. </p>
  79. <p>If <small>GDB</small> has not been configured to included core file support,
  80. such as for most embedded targets, then it will complain about a second
  81. argument and ignore it.
  82. </p>
  83. <p>Many options have both long and short forms; both are shown in the
  84. following list. <small>GDB</small> also recognizes the long forms if you truncate
  85. them, so long as enough of the option is present to be unambiguous.
  86. (If you prefer, you can flag option arguments with &lsquo;<samp>--</samp>&rsquo; rather
  87. than &lsquo;<samp>-</samp>&rsquo;, though we illustrate the more usual convention.)
  88. </p>
  89. <dl compact="compact">
  90. <dt><code>-symbols <var>file</var></code></dt>
  91. <dt><code>-s <var>file</var></code></dt>
  92. <dd><a name="index-_002d_002dsymbols"></a>
  93. <a name="index-_002ds"></a>
  94. <p>Read symbol table from file <var>file</var>.
  95. </p>
  96. </dd>
  97. <dt><code>-exec <var>file</var></code></dt>
  98. <dt><code>-e <var>file</var></code></dt>
  99. <dd><a name="index-_002d_002dexec"></a>
  100. <a name="index-_002de"></a>
  101. <p>Use file <var>file</var> as the executable file to execute when appropriate,
  102. and for examining pure data in conjunction with a core dump.
  103. </p>
  104. </dd>
  105. <dt><code>-se <var>file</var></code></dt>
  106. <dd><a name="index-_002d_002dse"></a>
  107. <p>Read symbol table from file <var>file</var> and use it as the executable
  108. file.
  109. </p>
  110. </dd>
  111. <dt><code>-core <var>file</var></code></dt>
  112. <dt><code>-c <var>file</var></code></dt>
  113. <dd><a name="index-_002d_002dcore"></a>
  114. <a name="index-_002dc"></a>
  115. <p>Use file <var>file</var> as a core dump to examine.
  116. </p>
  117. </dd>
  118. <dt><code>-pid <var>number</var></code></dt>
  119. <dt><code>-p <var>number</var></code></dt>
  120. <dd><a name="index-_002d_002dpid"></a>
  121. <a name="index-_002dp"></a>
  122. <p>Connect to process ID <var>number</var>, as with the <code>attach</code> command.
  123. </p>
  124. </dd>
  125. <dt><code>-command <var>file</var></code></dt>
  126. <dt><code>-x <var>file</var></code></dt>
  127. <dd><a name="index-_002d_002dcommand"></a>
  128. <a name="index-_002dx"></a>
  129. <p>Execute commands from file <var>file</var>. The contents of this file is
  130. evaluated exactly as the <code>source</code> command would.
  131. See <a href="Command-Files.html#Command-Files">Command files</a>.
  132. </p>
  133. </dd>
  134. <dt><code>-eval-command <var>command</var></code></dt>
  135. <dt><code>-ex <var>command</var></code></dt>
  136. <dd><a name="index-_002d_002deval_002dcommand"></a>
  137. <a name="index-_002dex"></a>
  138. <p>Execute a single <small>GDB</small> command.
  139. </p>
  140. <p>This option may be used multiple times to call multiple commands. It may
  141. also be interleaved with &lsquo;<samp>-command</samp>&rsquo; as required.
  142. </p>
  143. <div class="smallexample">
  144. <pre class="smallexample">gdb -ex 'target sim' -ex 'load' \
  145. -x setbreakpoints -ex 'run' a.out
  146. </pre></div>
  147. </dd>
  148. <dt><code>-init-command <var>file</var></code></dt>
  149. <dt><code>-ix <var>file</var></code></dt>
  150. <dd><a name="index-_002d_002dinit_002dcommand"></a>
  151. <a name="index-_002dix"></a>
  152. <p>Execute commands from file <var>file</var> before loading the inferior (but
  153. after loading gdbinit files).
  154. See <a href="Startup.html#Startup">Startup</a>.
  155. </p>
  156. </dd>
  157. <dt><code>-init-eval-command <var>command</var></code></dt>
  158. <dt><code>-iex <var>command</var></code></dt>
  159. <dd><a name="index-_002d_002dinit_002deval_002dcommand"></a>
  160. <a name="index-_002diex"></a>
  161. <p>Execute a single <small>GDB</small> command before loading the inferior (but
  162. after loading gdbinit files).
  163. See <a href="Startup.html#Startup">Startup</a>.
  164. </p>
  165. </dd>
  166. <dt><code>-directory <var>directory</var></code></dt>
  167. <dt><code>-d <var>directory</var></code></dt>
  168. <dd><a name="index-_002d_002ddirectory"></a>
  169. <a name="index-_002dd"></a>
  170. <p>Add <var>directory</var> to the path to search for source and script files.
  171. </p>
  172. </dd>
  173. <dt><code>-r</code></dt>
  174. <dt><code>-readnow</code></dt>
  175. <dd><a name="index-_002d_002dreadnow"></a>
  176. <a name="index-_002dr"></a>
  177. <p>Read each symbol file&rsquo;s entire symbol table immediately, rather than
  178. the default, which is to read it incrementally as it is needed.
  179. This makes startup slower, but makes future operations faster.
  180. </p>
  181. </dd>
  182. <dt><code>--readnever</code></dt>
  183. <dd><a name="g_t_002d_002dreadnever"></a><a name="index-_002d_002dreadnever_002c-command_002dline-option"></a>
  184. <p>Do not read each symbol file&rsquo;s symbolic debug information. This makes
  185. startup faster but at the expense of not being able to perform
  186. symbolic debugging. DWARF unwind information is also not read,
  187. meaning backtraces may become incomplete or inaccurate. One use of
  188. this is when a user simply wants to do the following sequence: attach,
  189. dump core, detach. Loading the debugging information in this case is
  190. an unnecessary cause of delay.
  191. </p></dd>
  192. </dl>
  193. <hr>
  194. <div class="header">
  195. <p>
  196. Next: <a href="Mode-Options.html#Mode-Options" accesskey="n" rel="next">Mode Options</a>, Up: <a href="Invoking-GDB.html#Invoking-GDB" accesskey="u" rel="up">Invoking GDB</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>
  197. </div>
  198. </body>
  199. </html>