This is the mail archive of the gcc-patches@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: patch to improve i386 epilogue (version 4)


>>>>> "Jeffrey" == Jeffrey A Law <law@cygnus.com> writes:

    Jeffrey>   In message
    Jeffrey> <199810081857.LAA07960@smtp.earthlink.net>you write:
    >> Which brings us back to a question I raised quite some time
    >> ago.  On Linux/GNU, compiling -ggdb generates DWARF2, while -g
    >> generates stabs.
    >> 
    >> The GCC documentation says:
    >> 
    >> `-g' Produce debugging information in the operating system's
    >> native format (stabs, COFF, XCOFF, or DWARF).  GDB can work
    >> with this debugging information.
    >> 
    >> Since GDB is the native debugger on Linux, I think the present
    >> situation is inconsistent.  (This situation probably exists on
    >> other x86 systems that ship with GDB, but I'm not as familiar
    >> with them.)

    Jeffrey> Why is it inconsistent?  As long as gcc uses stabs, the
    Jeffrey> native format for Linux is stabs.  This is quite
    Jeffrey> different than (for example) gcc on x86-solaris where the
    Jeffrey> system has a native format that is not controlled by gcc.

It's not the fact that -g generates stabs per se that is
inconsistent.  It is the fact that -g generates stabs while -ggdb
generates DWARF2 that is odd.  They should, IMO, generate the same
thing, since GDB is the native debugger.

In other words, on some system X you might use -g to get debug
information to use with the vendor debugger, and -ggdb to get debug
information to use with GDB.  But, on Linux/GNU you never face this
conundrum, so why should the switches do different things?

    Jeffrey> I can see the *potential* for improvements using the
    Jeffrey> dwarf2 format, but at the current time neither gcc nor
    Jeffrey> gdb are set up to take advantage of the richer debug
    Jeffrey> format provided by dwarf2 (in some cases the debugger
    Jeffrey> needs updating, in others the compiler, in a few, both).

That's a good argument.  I have no knowledge as to the current state
of the debugger or debug-generation code; my impression was that
DWARF2 support was reasonably mature.  (After all, we use it on at
least some systems where that is the vendor default format.)

-- 
Mark Mitchell 			mark@markmitchell.com
Mark Mitchell Consulting	http://www.markmitchell.com


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