Options For Debugging Your Program Or Gcc - Red Hat ENTERPRISE LINUX 4 Manual

Hide thumbs Also See for ENTERPRISE LINUX 4:
Table of Contents

Advertisement

Chapter 4. GCC Command Options
-Wdisabled-optimization
Warn if a requested optimization pass is disabled. This warning does not generally indicate that
there is anything wrong with your code; it merely indicates that GCC's optimizers were unable
to handle the code effectively. Often, the problem is that your code is too big or too complex;
GCC will refuse to optimize programs when the optimization itself is likely to take inordinate
amounts of time.
-Werror
Make all warnings into errors.

4.9. Options for Debugging Your Program or GCC

GCC has various special options that are used for debugging either your program or GCC:
-g
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,
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
(see below).
-gvms
Unlike most other C compilers, GCC allows you to use
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 GCC is generated with the capability for more than one
debugging format.
-ggdb
Produce debugging information for use by GDB. This means to use the most expressive format
available (DWARF 2, stabs, or the native format if neither of those are 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.
-feliminate-unused-debug-symbols
Produce debugging information in stabs format (if that is supported), for only symbols that are
actually used.
enables use of extra debugging information that only
-g
,
-gstabs+
-gstabs
-g
,
,
-gxcoff+
-gxcoff
with
. The shortcuts taken by
-O
45
, or

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ENTERPRISE LINUX 4 and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents