http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48229
--- Comment #5 from Jan Kratochvil <jan.kratochvil at redhat dot com> 2011-03-28 09:12:20 UTC --- Created attachment 23788 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23788 GDB patch attempt with ptype regressions. (In reply to comment #4) > Still I believe DW_TAG_type_unit should have DW_AT_producer as it is a > standalone entity - but currently it is not. I guess I have to implement your > described althorithm into GDB instead. It cannot work as GDB often looks up the type without any referrer from DW_TAG_compile_unit, such as during the `ptype' GDB command. A draft patch thus has many regressions such as: -PASS: gdb.base/nofield.exp: ptype struct not_empty +FAIL: gdb.base/nofield.exp: ptype struct not_empty (GDB internal error) This means GDB will have to start full read (like -readnow) of CUs till it finds some CU referencing the specific type to find its DW_AT_producer. During scan of .debug_info for GDB partial symbols GDB currently skips over subtrees of DIEs which reference the type signature for performance reasons, it no longer can. With .gdb_index there is no GDB partial symbols scan but .gdb_index also indexes types by their name and there is no referrer ever seen during the `ptype' GDB command. So it means performance regression for non-.gdb_index case and a possible new extension/version of .gdb_index to handle it.