This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug python/10953] gdb.Type does not give access to Base classes


------- Additional Comments From dodji at redhat dot com  2009-11-18 08:08 -------
The short story is that the "Derived" type is considered "not complete" by GCC -
in the compilation unit main.cpp - so, no debug info is emitted for its
*definition*, in that compilation unit. The DIE describing "Derived" then has a
DW_AT_declaration set. So GDB has to go lookup the DIE of the *definitin* of
"Derived" in another compilation unit.

Now I guess the outstanding question is "why is Derived considered not complete?".
GCC implements a scheme to reduce debug info size. In that scheme, when a type
has as virtual table (like Derived, because it has a virtual destructor
declared), GCC only emits full debug info for said type _only_ if the virtual
table is emitted. In this case, as the virtual destructor of Derived is not
*defined* in main.cpp, no virtual table is emitted in that compilation unit. I
guess the virtual table for Derived will be emitted in another compilation unit
where the virtual destructor would be emitted.

To wrap things up in another way, no virtual destructor defined in current CU =>
no vtable emitted for Derived in current CU => no full debug info for Derived in
current CU => GDB has to fetch the full debug info for Derived in another CU.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=10953

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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