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


Geoff Keating <geoffk@geoffk.org> writes:

> > From: jtc@redback.com (J.T. Conklin)
> > Date: 12 Apr 2001 19:13:26 -0700
> 
> > In general, are there any advantages for using dwarf-2 over 
> > stabs debugging symbols for C (not C++) programs?
> 
> In general, dwarf-2 is much more expressive and can deal better
> with some of the more complex optimisations that gcc can do.
> (I don't know if this actually works yet.)

I just got it, building on the location list patch i submitted
yesterday, to track the splitting of iv's that occurs during loop
unrolling. Works great.  It turns out most of the live_range stuff in
the fsf tree that were from the Cygnus live range implementation,
isn't needed. (We really only need the start/end of the range, and a
mapping of old->new registers.  It used to have all kinds of info in
there to pass to the register allocator, since live range splitting
was a seperate pass.)
The new register allocator also needs the location lists because it
does all kinds of live range splitting, rematerialization, etc. 

Unfortunately, even the live range hacks to stabs can't support this
kind of thing (they were limited to simple splitting of registers,
etc), but that's life. STABS never could support optimized 
code debugging at all anyway. I'll probably just implement a simple
linear scan allocator for unoptimized code generation.


> 
> > I did a quick test of rebuilding our system with dwarf-2 debug
> > symbols, and found that the image file grew from 35MB to 167MB 
> > and link times nearly quadrupled, so dwarf-2 isn't looking so 
> > good so far.  If I had to guess, it looks like duplicate debug
> > info (from headers, etc.) isn't being eliminated as is done 
> > for stabs.
> 
> Yes, no-one has yet taught the linker how to eliminate all the
> duplicates.

And me being lazy, i taught the compiler how to do it instead, since
it was easier, and i didn't feel like the 3 days i spent doing it were
as wasted as the 3 weeks i spent trying to do it in LD.
Sometime this summer, i'll probably spend the 7 days to do it as a
linker prepass, called by ld.



> 
> -- 
> - Geoffrey Keating <geoffk@geoffk.org>

-- 
There was a power outage at a department store yesterday.
Twenty people were trapped on the escalators.


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