http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48229
--- Comment #4 from Jan Kratochvil <jan.kratochvil at redhat dot com> 2011-03-23 13:07:02 UTC --- (In reply to comment #3) > I think it is a bad idea to add DW_AT_producer to .debug_type units. Making > each .debug_types addition 4 bytes longer is bad for debug info size, we might > have many thousands DW_TAG_type_units for each source. > I think you can safely use referring DW_TAG_compile_unit's DW_AT_producer for > your purposes. While it is true that .debug_types sections in the end comes > from different *.o file and be produced by different compiler, it will be > referenced by the current CU only if it hashes the same, thus has the same > content (disregarding hash collisions, in which case you are in very bad > trouble, but you are in that very bad trouble no matter whether you just > want to make sure it was produced by the same or compatible producer - when > hash collision happens, it might refer to completely unrelated type). I guess there cannot be two struct/class definitions with different fields accessibility accidentally matching each other due to ODR. 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. Dodji, thanks and sorry for the patch.