home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / gnu / info / gcc.info-3 (.txt) < prev    next >
GNU Info File  |  1994-12-22  |  51KB  |  980 lines

  1. This is Info file gcc.info, produced by Makeinfo-1.55 from the input
  2. file gcc.texi.
  3.    This file documents the use and the internals of the GNU compiler.
  4.    Published by the Free Software Foundation 675 Massachusetts Avenue
  5. Cambridge, MA 02139 USA
  6.    Copyright (C) 1988, 1989, 1992, 1993, 1994 Free Software Foundation,
  7.    Permission is granted to make and distribute verbatim copies of this
  8. manual provided the copyright notice and this permission notice are
  9. preserved on all copies.
  10.    Permission is granted to copy and distribute modified versions of
  11. this manual under the conditions for verbatim copying, provided also
  12. that the sections entitled "GNU General Public License," "Funding for
  13. Free Software," and "Protect Your Freedom--Fight `Look And Feel'" are
  14. included exactly as in the original, and provided that the entire
  15. resulting derived work is distributed under the terms of a permission
  16. notice identical to this one.
  17.    Permission is granted to copy and distribute translations of this
  18. manual into another language, under the above conditions for modified
  19. versions, except that the sections entitled "GNU General Public
  20. License," "Funding for Free Software," and "Protect Your Freedom--Fight
  21. `Look And Feel'", and this permission notice, may be included in
  22. translations approved by the Free Software Foundation instead of in the
  23. original English.
  24. File: gcc.info,  Node: Debugging Options,  Next: Optimize Options,  Prev: Warning Options,  Up: Invoking GCC
  25. Options for Debugging Your Program or GNU CC
  26. ============================================
  27.    GNU CC has various special options that are used for debugging
  28. either your program or GCC:
  29.      Produce debugging information in the operating system's native
  30.      format (stabs, COFF, XCOFF, or DWARF).  GDB can work with this
  31.      debugging information.
  32.      On most systems that use stabs format, `-g' enables use of extra
  33.      debugging information that only GDB can use; this extra information
  34.      makes debugging work better in GDB but will probably make other
  35.      debuggers crash or refuse to read the program.  If you want to
  36.      control for certain whether to generate the extra information, use
  37.      `-gstabs+', `-gstabs', `-gxcoff+', `-gxcoff', `-gdwarf+', or
  38.      `-gdwarf' (see below).
  39.      Unlike most other C compilers, GNU CC allows you to use `-g' with
  40.      `-O'.  The shortcuts taken by optimized code may occasionally
  41.      produce surprising results: some variables you declared may not
  42.      exist at all; flow of control may briefly move where you did not
  43.      expect it; some statements may not be executed because they
  44.      compute constant results or their values were already at hand;
  45.      some statements may execute in different places because they were
  46.      moved out of loops.
  47.      Nevertheless it proves possible to debug optimized output.  This
  48.      makes it reasonable to use the optimizer for programs that might
  49.      have bugs.
  50.      The following options are useful when GNU CC is generated with the
  51.      capability for more than one debugging format.
  52. `-ggdb'
  53.      Produce debugging information in the native format (if that is
  54.      supported), including GDB extensions if at all possible.
  55. `-gstabs'
  56.      Produce debugging information in stabs format (if that is
  57.      supported), without GDB extensions.  This is the format used by
  58.      DBX on most BSD systems.  On MIPS, Alpha and System V Release 4
  59.      systems this option produces stabs debugging output which is not
  60.      understood by DBX or SDB.  On System V Release 4 systems this
  61.      option requires the GNU assembler.
  62. `-gstabs+'
  63.      Produce debugging information in stabs format (if that is
  64.      supported), using GNU extensions understood only by the GNU
  65.      debugger (GDB).  The use of these extensions is likely to make
  66.      other debuggers crash or refuse to read the program.
  67. `-gcoff'
  68.      Produce debugging information in COFF format (if that is
  69.      supported).  This is the format used by SDB on most System V
  70.      systems prior to System V Release 4.
  71. `-gxcoff'
  72.      Produce debugging information in XCOFF format (if that is
  73.      supported).  This is the format used by the DBX debugger on IBM
  74.      RS/6000 systems.
  75. `-gxcoff+'
  76.      Produce debugging information in XCOFF format (if that is
  77.      supported), using GNU extensions understood only by the GNU
  78.      debugger (GDB).  The use of these extensions is likely to make
  79.      other debuggers crash or refuse to read the program.
  80. `-gdwarf'
  81.      Produce debugging information in DWARF format (if that is
  82.      supported).  This is the format used by SDB on most System V
  83.      Release 4 systems.
  84. `-gdwarf+'
  85.      Produce debugging information in DWARF format (if that is
  86.      supported), using GNU extensions understood only by the GNU
  87.      debugger (GDB).  The use of these extensions is likely to make
  88.      other debuggers crash or refuse to read the program.
  89. `-gLEVEL'
  90. `-ggdbLEVEL'
  91. `-gstabsLEVEL'
  92. `-gcoffLEVEL'
  93. `-gxcoffLEVEL'
  94. `-gdwarfLEVEL'
  95.      Request debugging information and also use LEVEL to specify how
  96.      much information.  The default level is 2.
  97.      Level 1 produces minimal information, enough for making backtraces
  98.      in parts of the program that you don't plan to debug.  This
  99.      includes descriptions of functions and external variables, but no
  100.      information about local variables and no line numbers.
  101.      Level 3 includes extra information, such as all the macro
  102.      definitions present in the program.  Some debuggers support macro
  103.      expansion when you use `-g3'.
  104.      Generate extra code to write profile information suitable for the
  105.      analysis program `prof'.  You must use this option when compiling
  106.      the source files you want data about, and you must also use it when
  107.      linking.
  108. `-pg'
  109.      Generate extra code to write profile information suitable for the
  110.      analysis program `gprof'.  You must use this option when compiling
  111.      the source files you want data about, and you must also use it when
  112.      linking.
  113.      Generate extra code to write profile information for basic blocks,
  114.      which will record the number of times each basic block is
  115.      executed, the basic block start address, and the function name
  116.      containing the basic block.  If `-g' is used, the line number and
  117.      filename of the start of the basic block will also be recorded.
  118.      If not overridden by the machine description, the default action is
  119.      to append to the text file `bb.out'.
  120.      This data could be analyzed by a program like `tcov'.  Note,
  121.      however, that the format of the data is not what `tcov' expects.
  122.      Eventually GNU `gprof' should be extended to process this data.
  123. `-dLETTERS'
  124.      Says to make debugging dumps during compilation at times specified
  125.      by LETTERS.  This is used for debugging the compiler.  The file
  126.      names for most of the dumps are made by appending a word to the
  127.      source file name (e.g.  `foo.c.rtl' or `foo.c.jump').  Here are the
  128.      possible letters for use in LETTERS, and their meanings:
  129.     `M'
  130.           Dump all macro definitions, at the end of preprocessing, and
  131.           write no output.
  132.     `N'
  133.           Dump all macro names, at the end of preprocessing.
  134.     `D'
  135.           Dump all macro definitions, at the end of preprocessing, in
  136.           addition to normal output.
  137.     `y'
  138.           Dump debugging information during parsing, to standard error.
  139.     `r'
  140.           Dump after RTL generation, to `FILE.rtl'.
  141.     `x'
  142.           Just generate RTL for a function instead of compiling it.
  143.           Usually used with `r'.
  144.     `j'
  145.           Dump after first jump optimization, to `FILE.jump'.
  146.     `s'
  147.           Dump after CSE (including the jump optimization that sometimes
  148.           follows CSE), to `FILE.cse'.
  149.     `L'
  150.           Dump after loop optimization, to `FILE.loop'.
  151.     `t'
  152.           Dump after the second CSE pass (including the jump
  153.           optimization that sometimes follows CSE), to `FILE.cse2'.
  154.     `f'
  155.           Dump after flow analysis, to `FILE.flow'.
  156.     `c'
  157.           Dump after instruction combination, to the file
  158.           `FILE.combine'.
  159.     `S'
  160.           Dump after the first instruction scheduling pass, to
  161.           `FILE.sched'.
  162.     `l'
  163.           D