This is the mail archive of the
mailing list for the GCC project.
debug/8095: missing dwarf info for parent class
- From: tom dot horsley at ccur dot com
- To: gcc-gnats at gcc dot gnu dot org
- Date: 30 Sep 2002 12:45:44 -0000
- Subject: debug/8095: missing dwarf info for parent class
- Reply-to: tom dot horsley at ccur dot com
>Synopsis: missing dwarf info for parent class
>Arrival-Date: Mon Sep 30 05:46:05 PDT 2002
>Release: gcc 3.2
redhat linux null beta
I get the impression that g++ probably attempts to optimize the dwarf it generates to avoid generating masses of debug info for types that are not referenced in a compilation unit.
That is all well and good, but it appears to go too far,
leaving out parent classes even when it does generate the info for a derived class.
If a type is "used", parent classes of that type should also be counted as "used".
Any old C++ program with more than one level of class heirarchy will demonstrate this. Declare some instances of the most derived class, but never refer to the base class in the source code any place other than the derviced class declaration. The resulting dwarf will have no information about the members of the parent class.
There is some chance you can find the parent definition in another compilation unit if it happens to be used there, but there are no guarantees you'll be able to find it anywhere. This makes symbolic debugging a bit difficult if you actually want to look at the base class members.