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

Nifty Fedora Mitch niftyfedora at niftyegg.com
Tue Jul 22 03:29:02 UTC 2008


On Sat, Jul 19, 2008 at 11:13:34AM -0400, 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.

What development is he looking at "getting into"?
   Programming language...
   hardware target...
   OS target...

In general the debugger hooks are transparent unless you 
are writing a debugger/ compiler.   Other issues apply to
embedded development and the kernel itself.

Your URL has a big HINT.

    -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.

You want the most supported format you can get.   It does not matter
if formatA is better if it is not well supported top to bottom.

Missing in this is the power of the compiler itself.  In debugging it can 
prove helpful to have a second or third compiler.  Look into compilers
like the Intel compiler (free to students last I checked) and another good compiler
is the Pathscale compiler (generated Fortran code is wonderful) and also
the PGI compiler suite.

Various compiler vendors have compile and run time hooks for uninitialized variable triggers
as well as richer static checking so give the man page a full read.

And third party debuggers like ... "Total View" etc. have their place in the mix.
..... depending on the budget.



> 
>   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.
> 
> rday
> --T
> 
> ========================================================================
> Robert P. J. Day
> Linux Consulting, Training and Annoying Kernel Pedantry:
>     Have classroom, will lecture.
> 
> http://crashcourse.ca                          Waterloo, Ontario, CANADA
> ========================================================================
> 
> -- 
> fedora-list mailing list
> fedora-list at redhat.com
> To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list

-- 
	T o m  M i t c h e l l 
	Looking for a place to hang my hat :-(




More information about the fedora-list mailing list