home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 8
/
FreshFishVol8-CD2.bin
/
bbs
/
gnu
/
gcc-2.6.3-bin.lha
/
GNU
/
info
/
gcc.info-3
(
.txt
)
< prev
next >
Wrap
GNU Info File
|
1994-12-23
|
51KB
|
980 lines
This is Info file gcc.info, produced by Makeinfo-1.55 from the input
file gcc.texi.
This file documents the use and the internals of the GNU compiler.
Published by the Free Software Foundation 675 Massachusetts Avenue
Cambridge, MA 02139 USA
Copyright (C) 1988, 1989, 1992, 1993, 1994 Free Software Foundation,
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.
Permission is granted to copy and distribute modified versions of
this manual under the conditions for verbatim copying, provided also
that the sections entitled "GNU General Public License," "Funding for
Free Software," and "Protect Your Freedom--Fight `Look And Feel'" are
included exactly as in the original, and provided that the entire
resulting derived work is distributed under the terms of a permission
notice identical to this one.
Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that the sections entitled "GNU General Public
License," "Funding for Free Software," and "Protect Your Freedom--Fight
`Look And Feel'", and this permission notice, may be included in
translations approved by the Free Software Foundation instead of in the
original English.
File: gcc.info, Node: Debugging Options, Next: Optimize Options, Prev: Warning Options, Up: Invoking GCC
Options for Debugging Your Program or GNU CC
============================================
GNU CC has various special options that are used for debugging
either your program or GCC:
Produce debugging information in the operating system's native
format (stabs, COFF, XCOFF, or DWARF). GDB can work with this
debugging information.
On most systems that use stabs format, `-g' enables use of extra
debugging information that only GDB can use; this extra information
makes debugging work better in GDB but will probably make other
debuggers crash or refuse to read the program. If you want to
control for certain whether to generate the extra information, use
`-gstabs+', `-gstabs', `-gxcoff+', `-gxcoff', `-gdwarf+', or
`-gdwarf' (see below).
Unlike most other C compilers, GNU CC allows you to use `-g' with
`-O'. The shortcuts taken by optimized code may occasionally
produce surprising results: some variables you declared may not
exist at all; flow of control may briefly move where you did not
expect it; some statements may not be executed because they
compute constant results or their values were already at hand;
some statements may execute in different places because they were
moved out of loops.
Nevertheless it proves possible to debug optimized output. This
makes it reasonable to use the optimizer for programs that might
have bugs.
The following options are useful when GNU CC is generated with the
capability for more than one debugging format.
`-ggdb'
Produce debugging information in the native format (if that is
supported), including GDB extensions if at all possible.
`-gstabs'
Produce debugging information in stabs format (if that is
supported), without GDB extensions. This is the format used by
DBX on most BSD systems. On MIPS, Alpha and System V Release 4
systems this option produces stabs debugging output which is not
understood by DBX or SDB. On System V Release 4 systems this
option requires the GNU assembler.
`-gstabs+'
Produce debugging information in stabs format (if that is
supported), using GNU extensions understood only by the GNU
debugger (GDB). The use of these extensions is likely to make
other debuggers crash or refuse to read the program.
`-gcoff'
Produce debugging information in COFF format (if that is
supported). This is the format used by SDB on most System V
systems prior to System V Release 4.
`-gxcoff'
Produce debugging information in XCOFF format (if that is
supported). This is the format used by the DBX debugger on IBM
RS/6000 systems.
`-gxcoff+'
Produce debugging information in XCOFF format (if that is
supported), using GNU extensions understood only by the GNU
debugger (GDB). The use of these extensions is likely to make
other debuggers crash or refuse to read the program.
`-gdwarf'
Produce debugging information in DWARF format (if that is
supported). This is the format used by SDB on most System V
Release 4 systems.
`-gdwarf+'
Produce debugging information in DWARF format (if that is
supported), using GNU extensions understood only by the GNU
debugger (GDB). The use of these extensions is likely to make
other debuggers crash or refuse to read the program.
`-gLEVEL'
`-ggdbLEVEL'
`-gstabsLEVEL'
`-gcoffLEVEL'
`-gxcoffLEVEL'
`-gdwarfLEVEL'
Request debugging information and also use LEVEL to specify how
much information. The default level is 2.
Level 1 produces minimal information, enough for making backtraces
in parts of the program that you don't plan to debug. This
includes descriptions of functions and external variables, but no
information about local variables and no line numbers.
Level 3 includes extra information, such as all the macro
definitions present in the program. Some debuggers support macro
expansion when you use `-g3'.
Generate extra code to write profile information suitable for the
analysis program `prof'. You must use this option when compiling
the source files you want data about, and you must also use it when
linking.
`-pg'
Generate extra code to write profile information suitable for the
analysis program `gprof'. You must use this option when compiling
the source files you want data about, and you must also use it when
linking.
Generate extra code to write profile information for basic blocks,
which will record the number of times each basic block is
executed, the basic block start address, and the function name
containing the basic block. If `-g' is used, the line number and
filename of the start of the basic block will also be recorded.
If not overridden by the machine description, the default action is
to append to the text file `bb.out'.
This data could be analyzed by a program like `tcov'. Note,
however, that the format of the data is not what `tcov' expects.
Eventually GNU `gprof' should be extended to process this data.
`-dLETTERS'
Says to make debugging dumps during compilation at times specified
by LETTERS. This is used for debugging the compiler. The file
names for most of the dumps are made by appending a word to the
source file name (e.g. `foo.c.rtl' or `foo.c.jump'). Here are the
possible letters for use in LETTERS, and their meanings:
`M'
Dump all macro definitions, at the end of preprocessing, and
write no output.
`N'
Dump all macro names, at the end of preprocessing.
`D'
Dump all macro definitions, at the end of preprocessing, in
addition to normal output.
`y'
Dump debugging information during parsing, to standard error.
`r'
Dump after RTL generation, to `FILE.rtl'.
`x'
Just generate RTL for a function instead of compiling it.
Usually used with `r'.
`j'
Dump after first jump optimization, to `FILE.jump'.
`s'
Dump after CSE (including the jump optimization that sometimes
follows CSE), to `FILE.cse'.
`L'
Dump after loop optimization, to `FILE.loop'.
`t'
Dump after the second CSE pass (including the jump
optimization that sometimes follows CSE), to `FILE.cse2'.
`f'
Dump after flow analysis, to `FILE.flow'.
`c'
Dump after instruction combination, to the file
`FILE.combine'.
`S'
Dump after the first instruction scheduling pass, to
`FILE.sched'.
`l'
D