• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/toolchains/hndtools-armeabi-2011.09/share/doc/arm-arm-none-eabi/html/gdb/
1<html lang="en">
2<head>
3<title>File Options - Debugging with GDB</title>
4<meta http-equiv="Content-Type" content="text/html">
5<meta name="description" content="Debugging with GDB">
6<meta name="generator" content="makeinfo 4.13">
7<link title="Top" rel="start" href="index.html#Top">
8<link rel="up" href="Invoking-GDB.html#Invoking-GDB" title="Invoking GDB">
9<link rel="next" href="Mode-Options.html#Mode-Options" title="Mode Options">
10<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
11<!--
12Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
131998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
14Free Software Foundation, Inc.
15
16Permission is granted to copy, distribute and/or modify this document
17under the terms of the GNU Free Documentation License, Version 1.3 or
18any later version published by the Free Software Foundation; with the
19Invariant Sections being ``Free Software'' and ``Free Software Needs
20Free Documentation'', with the Front-Cover Texts being ``A GNU Manual,''
21and with the Back-Cover Texts as in (a) below.
22
23(a) The FSF's Back-Cover Text is: ``You are free to copy and modify
24this GNU Manual.  Buying copies from GNU Press supports the FSF in
25developing GNU and promoting software freedom.''-->
26<meta http-equiv="Content-Style-Type" content="text/css">
27<style type="text/css"><!--
28  pre.display { font-family:inherit }
29  pre.format  { font-family:inherit }
30  pre.smalldisplay { font-family:inherit; font-size:smaller }
31  pre.smallformat  { font-family:inherit; font-size:smaller }
32  pre.smallexample { font-size:smaller }
33  pre.smalllisp    { font-size:smaller }
34  span.sc    { font-variant:small-caps }
35  span.roman { font-family:serif; font-weight:normal; } 
36  span.sansserif { font-family:sans-serif; font-weight:normal; } 
37--></style>
38<link rel="stylesheet" type="text/css" href="../cs.css">
39</head>
40<body>
41<div class="node">
42<a name="File-Options"></a>
43<p>
44Next:&nbsp;<a rel="next" accesskey="n" href="Mode-Options.html#Mode-Options">Mode Options</a>,
45Up:&nbsp;<a rel="up" accesskey="u" href="Invoking-GDB.html#Invoking-GDB">Invoking GDB</a>
46<hr>
47</div>
48
49<h4 class="subsection">2.1.1 Choosing Files</h4>
50
51<p>When <span class="sc">gdb</span> starts, it reads any arguments other than options as
52specifying an executable file and core file (or process ID).  This is
53the same as if the arguments were specified by the &lsquo;<samp><span class="samp">-se</span></samp>&rsquo; and
54&lsquo;<samp><span class="samp">-c</span></samp>&rsquo; (or &lsquo;<samp><span class="samp">-p</span></samp>&rsquo;) options respectively.  (<span class="sc">gdb</span> reads the
55first argument that does not have an associated option flag as
56equivalent to the &lsquo;<samp><span class="samp">-se</span></samp>&rsquo; option followed by that argument; and the
57second argument that does not have an associated option flag, if any, as
58equivalent to the &lsquo;<samp><span class="samp">-c</span></samp>&rsquo;/&lsquo;<samp><span class="samp">-p</span></samp>&rsquo; option followed by that argument.) 
59If the second argument begins with a decimal digit, <span class="sc">gdb</span> will
60first attempt to attach to it as a process, and if that fails, attempt
61to open it as a corefile.  If you have a corefile whose name begins with
62a digit, you can prevent <span class="sc">gdb</span> from treating it as a pid by
63prefixing it with <samp><span class="file">./</span></samp>, e.g. <samp><span class="file">./12345</span></samp>.
64
65   <p>If <span class="sc">gdb</span> has not been configured to included core file support,
66such as for most embedded targets, then it will complain about a second
67argument and ignore it.
68
69   <p>Many options have both long and short forms; both are shown in the
70following list.  <span class="sc">gdb</span> also recognizes the long forms if you truncate
71them, so long as enough of the option is present to be unambiguous. 
72(If you prefer, you can flag option arguments with &lsquo;<samp><span class="samp">--</span></samp>&rsquo; rather
73than &lsquo;<samp><span class="samp">-</span></samp>&rsquo;, though we illustrate the more usual convention.)
74
75<!-- NOTE: the @cindex entries here use double dashes ON PURPOSE.  This -->
76<!-- way, both those who look for -foo and -foo in the index, will find -->
77<!-- it. -->
78     <dl>
79<dt><code>-symbols </code><var>file</var><dt><code>-s </code><var>file</var><dd><a name="index-g_t_0040code_007b_002d_002dsymbols_007d-4"></a><a name="index-g_t_0040code_007b_002ds_007d-5"></a>Read symbol table from file <var>file</var>.
80
81     <br><dt><code>-exec </code><var>file</var><dt><code>-e </code><var>file</var><dd><a name="index-g_t_0040code_007b_002d_002dexec_007d-6"></a><a name="index-g_t_0040code_007b_002de_007d-7"></a>Use file <var>file</var> as the executable file to execute when appropriate,
82and for examining pure data in conjunction with a core dump.
83
84     <br><dt><code>-se </code><var>file</var><dd><a name="index-g_t_0040code_007b_002d_002dse_007d-8"></a>Read symbol table from file <var>file</var> and use it as the executable
85file.
86
87     <br><dt><code>-core </code><var>file</var><dt><code>-c </code><var>file</var><dd><a name="index-g_t_0040code_007b_002d_002dcore_007d-9"></a><a name="index-g_t_0040code_007b_002dc_007d-10"></a>Use file <var>file</var> as a core dump to examine.
88
89     <br><dt><code>-pid </code><var>number</var><dt><code>-p </code><var>number</var><dd><a name="index-g_t_0040code_007b_002d_002dpid_007d-11"></a><a name="index-g_t_0040code_007b_002dp_007d-12"></a>Connect to process ID <var>number</var>, as with the <code>attach</code> command.
90
91     <br><dt><code>-command </code><var>file</var><dt><code>-x </code><var>file</var><dd><a name="index-g_t_0040code_007b_002d_002dcommand_007d-13"></a><a name="index-g_t_0040code_007b_002dx_007d-14"></a>Execute commands from file <var>file</var>.  The contents of this file is
92evaluated exactly as the <code>source</code> command would. 
93See <a href="Command-Files.html#Command-Files">Command files</a>.
94
95     <br><dt><code>-eval-command </code><var>command</var><dt><code>-ex </code><var>command</var><dd><a name="index-g_t_0040code_007b_002d_002deval_002dcommand_007d-15"></a><a name="index-g_t_0040code_007b_002dex_007d-16"></a>Execute a single <span class="sc">gdb</span> command.
96
97     <p>This option may be used multiple times to call multiple commands.  It may
98also be interleaved with &lsquo;<samp><span class="samp">-command</span></samp>&rsquo; as required.
99
100     <pre class="smallexample">          gdb -ex 'target sim' -ex 'load' \
101             -x setbreakpoints -ex 'run' a.out
102</pre>
103     <br><dt><code>-directory </code><var>directory</var><dt><code>-d </code><var>directory</var><dd><a name="index-g_t_0040code_007b_002d_002ddirectory_007d-17"></a><a name="index-g_t_0040code_007b_002dd_007d-18"></a>Add <var>directory</var> to the path to search for source and script files.
104
105     <br><dt><code>-r</code><dt><code>-readnow</code><dd><a name="index-g_t_0040code_007b_002d_002dreadnow_007d-19"></a><a name="index-g_t_0040code_007b_002dr_007d-20"></a>Read each symbol file's entire symbol table immediately, rather than
106the default, which is to read it incrementally as it is needed. 
107This makes startup slower, but makes future operations faster.
108
109   </dl>
110
111   </body></html>
112
113