This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] add option to eliminate unused types in dwarf2 output(v2)
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: Daniel Jacobowitz <drow at mvista dot com>
- Cc: Scott Snyder <snyder at fnal dot gov>, <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 4 Jul 2002 21:19:32 -0400 (EDT)
- Subject: Re: [PATCH] add option to eliminate unused types in dwarf2 output(v2)
On Thu, 4 Jul 2002, Daniel Jacobowitz wrote:
> On Thu, Jul 04, 2002 at 09:00:22PM -0400, Daniel Jacobowitz wrote:
> > I've got a couple of comments about your choices here.
>
> And one more...
>
> > These, on the other hand, are very different. If you describe the type
> > of a class, you need to describe it correctly. GDB has no business
> > assuming that different definitions should be "merged". It should
> > instead assume that they represent two different classes, which is
> > obviously untrue. I believe that any referenced class should have all
> > of its debugging information included, and any called function should
> > also have its debugging information present even if the function
> > definition is in another CU - say, off in a stripped libc!
> >
> > There's no point in including incorrect debug information; its affect
> > on the GDB testsuite is the important ruler for this.
>
> I should add that the correct way to implement this space savings is to
> support creating inter-CU references properly and eliminating them at
> link time. Dan Berlin has and/or committed most of the appropriate
> code to make GCC generate these things, probably on a branch.
It was present in GCC, but GDB never supported it, so it languished.
The code is there, just bitrotten.
They way it was done required no linker support, because it's
difficult to do it in LD.
It was done with linkonce sections and inter-cu references.
This of course, gave a space penalty, and we could eliminate that by doing
it at link time, but nobody has successfully done it in BFD yet. I tried
once, but gave up after a few weeks.
> GDB
> doesn't yet read them and I'm not sure of the state of linker support.
Wake me back up when GDB reads them, and i'll work on it again.
On a somewhat related subject, the cfg-branch can generate dwarf2 location
lists for variables that move around due to optimization.
Wake me up when GDB supports that, and i'll move it to the mainline.
--Dan