DWARF 2[/3] the most advanced debugging format?

Michael Eager eager at eagercon.com
Mon Jul 21 17:58:43 UTC 2008


Les wrote:
> On Sat, 2008-07-19 at 11:51 -0700, Michael Eager wrote:
>> Robert P. J. Day wrote:
>>>   a friend who's just getting into development on linux was reading
>>> the gcc manual and ran across the variety of available debugging
>>> formats here:
>>>
>>> http://gcc.gnu.org/onlinedocs/gcc-4.3.0/gcc/Debugging-Options.html
>>>
>>> and asked me, out of all those formats, which was the "best" one to
>>> start working with.
>>>
>>>   i suggested he'd be best off getting familiar with the DWARF 2
>>> format, since fedora already comes with a yum-installable "dwarves"
>>> package containing various DWARF-related examination utilities.
>>>
>>>   that seemed like an easy answer at the time, but is there a better
>>> choice?  i realize stabs is still common but, in terms of being
>>> technically advanced, is DWARF 2 the most informative and most useful
>>> of the formats?  thanks.
>> Well, DWARF version 3 was released a few years ago.  :-)
>>
>> DWARF is an extensible, block structured debugging format.  It has
>> a significant user community which is involved in upgrading and
>> extending it.  Other formats, such as stabs or coff debug, are either
>> not block structured, difficult to extend, limited to specific
>> architectures, poorly documented, antiquated, or moribund.
>>
>> DWARF is the default debugging format for most GCC compilers,
>> including those on Linux on x86 and PowerPC.  Linux migrated away
>> from stabs some time ago.
>>
>> You can find an Introduction to DWARF article which I wrote a
>> couple years ago on the DWARF website:  http://dwarfstd.org
>>
>> -- 
>> Michael Eager	 Chair, DWARF Standards Committee   eager at eagercon.com
>> 1960 Park Blvd., Palo Alto, CA 94306  650-325-8077
>>
> Thank you Michael, For a very well written paper.  I had dug into COFF
> before, but had stumbled upon some of its limitations.  DWARF seems very
> well thought out.  Do you think it will become as widely implemented as
> COFF?

COFF is an object file format which incidentally includes debugging info.
COFF is no longer widely used, for a variety of reasons.

The ELF object file format is much more widely used than COFF, which is
only used on a few older architectures for mostly historical reasons.
(COFF was the object format for Unix System V Release 3, but was replaced
by ELF in Release 4.  Systems derived from SVR3 might use COFF instead
of ELF.)

Microsoft adopted a modified version of COFF as the PE or PE-COFF object
file format for Windows NT, but they use an entirely different (and mostly
undocumented) debugging format.

> Which debuggers use it effectively?

GDB and a number of commercial debuggers, such as TotalView.

-- 
Michael Eager	 eager at eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077




More information about the fedora-list mailing list