Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Berlin <dan@cgsoftware.com>
To: jtc@redback.com
Cc: gdb@sourceware.cygnus.com, binutils@sourceware.cygnus.com
Subject: Re: stabs vs. dwarf-2 for C programs
Date: Thu, 12 Apr 2001 19:55:00 -0000	[thread overview]
Message-ID: <m2y9t5y0ej.fsf@dynamic-addr-83-177.resnet.rochester.edu> (raw)
In-Reply-To: <5mwv8pzgvt.fsf@jtc.redback.com>

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

Sounds right, link time is dominated by disk i/o. The file got 4 times
bigger, the link takes 4 times longer. :)
> 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.

Correct.
I added support for this to gcc 3.0. It's not currently the default
because gdb, whose dwarf2 reader, being based on
the dwarf1 reader, was wholly unprepared to handle it (It assumes to
only have to process one CU at a time, and only see things inside that
CU. So when you do elimination, and end up with references into other
CU's, it barfs).  I've rewritten large parts of the dwarf2 reader to
support it, and hopefully, will submit the work sometime next week,
after i finish adding a few features.

If you want to get an idea of space savings, use -feliminate-dwarf2-dups.

However, it's meant for C++, mainly, i doubt it'll do much for C, if
anything at all.

It's mainly handling the case of duplication caused by real code in
header files, which can't occur in C.

Doing more space saving than that requires implementing the elimination in the
linker, or using a lot of space for labels and whatnot.  I tried this
once, but because of how LD works, it's impossible (we don't have
access to the labels offsets and whatnot we need. STABS, has support built
into the format for this type of thing. We don't, and thus, can't
leave these things lying around in the object files, unless we are
guaranteed GNU LD.)  It would need to be done as a pre-linker pass run
by ld or something. 

> 
>         --jtc
> 
> -- 
> J.T. Conklin
> RedBack Networks

-- 
Under my bed I have shoe box full of telephone rings.  Whenever
I get lonely I open it up just a bit and I get a call.  One time
I dropped the box all over the floor and the phone wouldn't stop
ringing, so I had it disconnected.  I bought a new phone though.
I didn't have much money so I had to buy an irregular phone --
it had no number 5 on it.  I saw a close friend of mine the
other day...  He said, "Steven, why haven't you called me?"  I
said, "I can't call everyone I want.  My new phone has no five
on it."  He said, "How long have you had it?"  I said, "I don't
know...  My calendar has no sevens on it."


  parent reply	other threads:[~2001-04-12 19:55 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-12 19:13 J.T. Conklin
2001-04-12 19:17 ` Christopher Faylor
2001-04-12 19:31   ` J.T. Conklin
2001-04-12 19:59     ` Daniel Berlin
2001-04-13  7:13       ` John Haller
2001-04-13  8:09         ` Daniel Berlin
2001-04-13 16:18           ` Ian Lance Taylor
2001-04-13 18:39             ` Daniel Berlin
2001-04-13 20:22               ` Ian Lance Taylor
2001-04-13 22:01                 ` Daniel Berlin
2001-04-13 22:19                   ` Ian Lance Taylor
2001-04-13 22:37                     ` DJ Delorie
2001-04-13 23:31                     ` Daniel Berlin
2001-04-13 23:47                       ` Daniel Berlin
2001-04-13 23:51                       ` Ian Lance Taylor
2001-04-13 22:56                   ` Daniel Berlin
2001-04-13 23:40                     ` Ian Lance Taylor
2001-04-13 23:55                   ` Todd Whitesel
2001-04-12 19:55 ` Daniel Berlin [this message]
2001-04-12 23:37   ` Eli Zaretskii
2001-04-13  8:13     ` Daniel Berlin
2001-04-12 22:00 ` Geoff Keating
2001-04-12 22:37   ` Daniel Berlin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2y9t5y0ej.fsf@dynamic-addr-83-177.resnet.rochester.edu \
    --to=dan@cgsoftware.com \
    --cc=binutils@sourceware.cygnus.com \
    --cc=gdb@sourceware.cygnus.com \
    --cc=jtc@redback.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox