This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: -g and -ggdb



>>>>> "H" == H J Lu <hjl@lucon.org> writes:

    >> However, on Linux, the "vendor" toolchain is GNU.  So, the
    >> usual debugger is gdb.  So, the "native format" should be
    >> whatever works best with gdb, IMO.  That's what -ggdb.  At
    >> present, on Linux, egcs -g generates stabs, while -ggdb
    >> generates DWARF2.
    >> 
    >> I claim that this situation makes no sense.  In particular, if
    >> GDB is the usual debugger, then -g should be the same as -ggdb,
    >> so either -g or -ggdb is currently doing the wrong thing.
    >> 
    >> But, perhaps I'm missing something: what do you mean that stabs
    >> are the native format on Linux?  Is there a meaning of native
    >> other than the one I'm thinking of?

    H> When we started working on ELF and gdb, DWARF2 was not an
    H> option since gcc didn't support it as good as stabs. So we
    H> chose stabs as the native format for Linux. I just saw a DWARF2
    H> bug reported a few days ago.

If DWARF2 support is truly busted, then -ggdb should generate stabs,
not DWARF2.  (If I really want DWARF2, I could always use -gdwarf-2.)

The point is simply that -g and -ggdb should be the same on Linux,
since GDB is the native debugger.  I propose that either we change
-ggdb to generate stabs, or -g to generate dwarf.  I was very
surprised to find that the two switches did different things.

    H> -- H.J. Lu (hjl@gnu.org)

-- 
Mark Mitchell		mmitchell@usa.net
Stanford University	http://www.stanford.edu



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]