This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


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

Re: stabs vs. dwarf-2 for C programs


Eli Zaretskii <eliz@delorie.com> writes:

> > From: Daniel Berlin <dan@cgsoftware.com>
> > Date: 12 Apr 2001 22:54:44 -0400
> > 
> > jtc@redback.com (J.T. Conklin) writes:
> > 
> > > In general, are there any advantages for using dwarf-2 over 
> > > stabs debugging symbols for C (not C++) programs?
> > 
> > Unless you want optimized code debugging, only space savings
> > (theoretical, of course, right now. For C, anyway).
> 
> I _always_ debug optimized code (I think doing otherwise is not wise,
> to put it gently).  What are the advantages of dwarf2 for debugging
> optimized C code?

Any variable, not optimized out (excluding interprocedural
optimizations that cause very weird things, like a variable to be
split into two different object file sections, also known as
discontiguous scopes, which won't be
supported until DWARF 2.1), can be viewed just fine.

When I get done teaching GDB a little more, you'll not be able to
notice the difference between inline functions, and non-inline
ones. We can present them to the user as if they weren't inlined (IE
having their own frame, being able to breakpoint in them, etc), without any trouble.

Lots of other stuff too.

I know of a few compilers/debuggers that use DWARF2 to it's fullest
abilities to describe optimized code, and you can't tell the
difference between debugging a program compiled with optimization, and
without.

-- 
I love to go shopping.  I love to freak out salespeople.  They
ask me if they can help me, and I say, "Have you got anything
I'd like?"  Then they ask me what size I need, and I say, "Extra
medium."


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