📄 debugging-options.html
字号:
suffix is removed (e.g. <code>foo.00.rtl</code> or <code>foo.01.sibling</code>).
Here are the possible letters for use in <var>letters</var>, and their
meanings:
<dl>
<dt><code>A</code>
<dd>Annotate the assembler output with miscellaneous debugging information.
<br><dt><code>b</code>
<dd>Dump after computing branch probabilities, to <code></code><var>file</var><code>.14.bp</code>.
<br><dt><code>B</code>
<dd>Dump after block reordering, to <code></code><var>file</var><code>.32.bbro</code>.
<br><dt><code>c</code>
<dd>Dump after instruction combination, to the file <code></code><var>file</var><code>.19.combine</code>.
<br><dt><code>C</code>
<dd>Dump after the first if conversion, to the file <code></code><var>file</var><code>.15.ce1</code>.
<br><dt><code>d</code>
<dd>Dump after delayed branch scheduling, to <code></code><var>file</var><code>.34.dbr</code>.
<br><dt><code>D</code>
<dd>Dump all macro definitions, at the end of preprocessing, in addition to
normal output.
<br><dt><code>e</code>
<dd>Dump after SSA optimizations, to <code></code><var>file</var><code>.04.ssa</code> and
<code></code><var>file</var><code>.07.ussa</code>.
<br><dt><code>E</code>
<dd>Dump after the second if conversion, to <code></code><var>file</var><code>.29.ce3</code>.
<br><dt><code>f</code>
<dd>Dump after life analysis, to <code></code><var>file</var><code>.18.life</code>.
<br><dt><code>F</code>
<dd>Dump after purging <code>ADDRESSOF</code> codes, to <code></code><var>file</var><code>.10.addressof</code>.
<br><dt><code>g</code>
<dd>Dump after global register allocation, to <code></code><var>file</var><code>.24.greg</code>.
<br><dt><code>h</code>
<dd>Dump after finalization of EH handling code, to <code></code><var>file</var><code>.02.eh</code>.
<br><dt><code>k</code>
<dd>Dump after reg-to-stack conversion, to <code></code><var>file</var><code>.31.stack</code>.
<br><dt><code>o</code>
<dd>Dump after post-reload optimizations, to <code></code><var>file</var><code>.25.postreload</code>.
<br><dt><code>G</code>
<dd>Dump after GCSE, to <code></code><var>file</var><code>.11.gcse</code>.
<br><dt><code>i</code>
<dd>Dump after sibling call optimizations, to <code></code><var>file</var><code>.01.sibling</code>.
<br><dt><code>j</code>
<dd>Dump after the first jump optimization, to <code></code><var>file</var><code>.03.jump</code>.
<br><dt><code>k</code>
<dd>Dump after conversion from registers to stack, to <code></code><var>file</var><code>.31.stack</code>.
<br><dt><code>l</code>
<dd>Dump after local register allocation, to <code></code><var>file</var><code>.23.lreg</code>.
<br><dt><code>L</code>
<dd>Dump after loop optimization, to <code></code><var>file</var><code>.12.loop</code>.
<br><dt><code>M</code>
<dd>Dump after performing the machine dependent reorganization pass, to
<code></code><var>file</var><code>.33.mach</code>.
<br><dt><code>n</code>
<dd>Dump after register renumbering, to <code></code><var>file</var><code>.28.rnreg</code>.
<br><dt><code>N</code>
<dd>Dump after the register move pass, to <code></code><var>file</var><code>.21.regmove</code>.
<br><dt><code>r</code>
<dd>Dump after RTL generation, to <code></code><var>file</var><code>.00.rtl</code>.
<br><dt><code>R</code>
<dd>Dump after the second scheduling pass, to <code></code><var>file</var><code>.30.sched2</code>.
<br><dt><code>s</code>
<dd>Dump after CSE (including the jump optimization that sometimes follows
CSE), to <code></code><var>file</var><code>.09.cse</code>.
<br><dt><code>S</code>
<dd>Dump after the first scheduling pass, to <code></code><var>file</var><code>.22.sched</code>.
<br><dt><code>t</code>
<dd>Dump after the second CSE pass (including the jump optimization that
sometimes follows CSE), to <code></code><var>file</var><code>.17.cse2</code>.
<br><dt><code>u</code>
<dd>Dump after null pointer elimination pass to <code></code><var>file</var><code>.08.null</code>.
<br><dt><code>w</code>
<dd>Dump after the second flow pass, to <code></code><var>file</var><code>.26.flow2</code>.
<br><dt><code>X</code>
<dd>Dump after SSA dead code elimination, to <code></code><var>file</var><code>.06.ssadce</code>.
<br><dt><code>z</code>
<dd>Dump after the peephole pass, to <code></code><var>file</var><code>.27.peephole2</code>.
<br><dt><code>a</code>
<dd>Produce all the dumps listed above.
<br><dt><code>m</code>
<dd>Print statistics on memory usage, at the end of the run, to
standard error.
<br><dt><code>p</code>
<dd>Annotate the assembler output with a comment indicating which
pattern and alternative was used. The length of each instruction is
also printed.
<br><dt><code>P</code>
<dd>Dump the RTL in the assembler output as a comment before each instruction.
Also turns on <code>-dp</code> annotation.
<br><dt><code>v</code>
<dd>For each of the other indicated dump files (except for
<code></code><var>file</var><code>.00.rtl</code>), dump a representation of the control flow graph
suitable for viewing with VCG to <code></code><var>file</var><code>.</code><var>pass</var><code>.vcg</code>.
<br><dt><code>x</code>
<dd>Just generate RTL for a function instead of compiling it. Usually used
with <code>r</code>.
<br><dt><code>y</code>
<dd>Dump debugging information during parsing, to standard error.
</dl>
<br><dt><code>-fdump-unnumbered</code>
<dd>When doing debugging dumps (see <code>-d</code> option above), suppress instruction
numbers and line number note output. This makes it more feasible to
use diff on debugging dumps for compiler invocations with different
options, in particular with and without <code>-g</code>.
<br><dt><code>-fdump-translation-unit </code>(C and C++ only)<code></code>
<dd><dt><code>-fdump-translation-unit-</code><var>options</var><code> </code>(C and C++ only)<code></code>
<dd>Dump a representation of the tree structure for the entire translation
unit to a file. The file name is made by appending <code>.tu</code> to the
source file name. If the <code>-</code><var>options</var><code></code> form is used, <var>options</var>
controls the details of the dump as described for the
<code>-fdump-tree</code> options.
<br><dt><code>-fdump-class-hierarchy </code>(C++ only)<code></code>
<dd><dt><code>-fdump-class-hierarchy-</code><var>options</var><code> </code>(C++ only)<code></code>
<dd>Dump a representation of each class's hierarchy and virtual function
table layout to a file. The file name is made by appending <code>.class</code>
to the source file name. If the <code>-</code><var>options</var><code></code> form is used,
<var>options</var> controls the details of the dump as described for the
<code>-fdump-tree</code> options.
<br><dt><code>-fdump-tree-</code><var>switch</var><code> </code>(C++ only)<code></code>
<dd><dt><code>-fdump-tree-</code><var>switch</var><code>-</code><var>options</var><code> </code>(C++ only)<code></code>
<dd>Control the dumping at various stages of processing the intermediate
language tree to a file. The file name is generated by appending a switch
specific suffix to the source file name. If the <code>-</code><var>options</var><code></code>
form is used, <var>options</var> is a list of <code>-</code> separated options that
control the details of the dump. Not all options are applicable to all
dumps, those which are not meaningful will be ignored. The following
options are available
<dl>
<dt><code>address</code>
<dd>Print the address of each node. Usually this is not meaningful as it
changes according to the environment and source file. Its primary use
is for tying up a dump file with a debug environment.
<br><dt><code>slim</code>
<dd>Inhibit dumping of members of a scope or body of a function merely
because that scope has been reached. Only dump such items when they
are directly reachable by some other path.
<br><dt><code>all</code>
<dd>Turn on all options.
</dl>
<p>The following tree dumps are possible:
<dl>
<dt><code>original</code>
<dd>Dump before any tree based optimization, to <code></code><var>file</var><code>.original</code>.
<br><dt><code>optimized</code>
<dd>Dump after all tree based optimization, to <code></code><var>file</var><code>.optimized</code>.
<br><dt><code>inlined</code>
<dd>Dump after function inlining, to <code></code><var>file</var><code>.inlined</code>.
</dl>
<br><dt><code>-fsched-verbose=</code><var>n</var><code></code>
<dd>On targets that use instruction scheduling, this option controls the
amount of debugging output the scheduler prints. This information is
written to standard error, unless <code>-dS</code> or <code>-dR</code> is
specified, in which case it is output to the usual dump
listing file, <code>.sched</code> or <code>.sched2</code> respectively. However
for <var>n</var> greater than nine, the output is always printed to standard
error.
<p>For <var>n</var> greater than zero, <code>-fsched-verbose</code> outputs the
same information as <code>-dRS</code>. For <var>n</var> greater than one, it
also output basic block probabilities, detailed ready list information
and unit/insn info. For <var>n</var> greater than two, it includes RTL
at abort point, control-flow and regions info. And for <var>n</var> over
four, <code>-fsched-verbose</code> also includes dependence info.
<br><dt><code>-save-temps</code>
<dd>Store the usual "temporary" intermediate files permanently; place them
in the current directory and name them based on the source file. Thus,
compiling <code>foo.c</code> with <code>-c -save-temps</code> would produce files
<code>foo.i</code> and <code>foo.s</code>, as well as <code>foo.o</code>. This creates a
preprocessed <code>foo.i</code> output file even though the compiler now
normally uses an integrated preprocessor.
<br><dt><code>-time</code>
<dd>Report the CPU time taken by each subprocess in the compilation
sequence. For C source files, this is the compiler proper and assembler
(plus the linker if linking is done). The output looks like this:
<pre class="smallexample"> # cc1 0.12 0.01
# as 0.00 0.01
</pre>
<p>The first number on each line is the "user time," that is time spent
executing the program itself. The second number is "system time,"
time spent executing operating system routines on behalf of the program.
Both numbers are in seconds.
<br><dt><code>-print-file-name=</code><var>library</var><code></code>
<dd>Print the full absolute name of the library file <var>library</var> that
would be used when linking--and don't do anything else. With this
option, GCC does not compile or link anything; it just prints the
file name.
<br><dt><code>-print-multi-directory</code>
<dd>Print the directory name corresponding to the multilib selected by any
other switches present in the command line. This directory is supposed
to exist in <code>GCC_EXEC_PREFIX</code>.
<br><dt><code>-print-multi-lib</code>
<dd>Print the mapping from multilib directory names to compiler switches
that enable them. The directory name is separated from the switches by
<code>;</code>, and each switch starts with an <code>@</code> instead of the
<code>-</code>, without spaces between multiple switches. This is supposed to
ease shell-processing.
<br><dt><code>-print-prog-name=</code><var>program</var><code></code>
<dd>Like <code>-print-file-name</code>, but searches for a program such as <code>cpp</code>.
<br><dt><code>-print-libgcc-file-name</code>
<dd>Same as <code>-print-file-name=libgcc.a</code>.
<p>This is useful when you use <code>-nostdlib</code> or <code>-nodefaultlibs</code>
but you do want to link with <code>libgcc.a</code>. You can do
<pre class="example"> gcc -nostdlib <var>files</var>... `gcc -print-libgcc-file-name`
</pre>
<br><dt><code>-print-search-dirs</code>
<dd>Print the name of the configured installation directory and a list of
program and library directories gcc will search--and don't do anything else.
<p>This is useful when gcc prints the error message
<code>installation problem, cannot exec cpp0: No such file or directory</code>.
To resolve this you either need to put <code>cpp0</code> and the other compiler
components where gcc expects to find them, or you can set the environment
variable <code>GCC_EXEC_PREFIX</code> to the directory where you installed them.
Don't forget the trailing '/'.
See <a href="Environment-Variables.html#Environment%20Variables">Environment Variables</a>.
<br><dt><code>-dumpmachine</code>
<dd>Print the compiler's target machine (for example,
<code>i686-pc-linux-gnu</code>)--and don't do anything else.
<br><dt><code>-dumpversion</code>
<dd>Print the compiler version (for example, <code>3.0</code>)--and don't do
anything else.
<br><dt><code>-dumpspecs</code>
<dd>Print the compiler's built-in specs--and don't do anything else. (This
is used when GCC itself is being built.) See <a href="Spec-Files.html#Spec%20Files">Spec Files</a>.
</dl>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -