This is the mail archive of the
mailing list for the GDB project.
Re: [RFA] comdat types
> I'm curious about one thing on this page, and I thought I'd take the
> opportunity to ask. ?DW_TAG_type_unit may have a DW_AT_language child.
> But, the language is not mentioned in the suggested method for
> computing a type's signature. ?This seems strange to me: either the
> language matters (in which case, it seems like it ought to be in the
> signature); or the language does not matter, in which case, why
> mention it?
DW_AT_language was a late addition, and if I recall correctly, it was
at Doug's request because there were still some places in gdb where
the language mattered. It's an attribute of the type_unit (just like
it is of the compile_unit), not of the type itself, so it's not
involved in computing the type signature. Theoretically, if two type
definitions from different languages generate the same signature,
they're still the same type, and should be merged together. On the
other hand, if the language really does matter to gdb, maybe they
shouldn't be merged. I'm not sure it's likely enough to matter much,
although I think it would be desirable for a C type and the same type
in C++ to have the same signature. I had the impression that the
dependence on language was a wart, and that ideally, it really
shouldn't be necessary, so the language attribute is there only as
helpful extra information.
> One concern I have is whether there is any chance that the
> specification will change between now and when DWARF-4 is published.
The DWARF proposal (after a long drawn-out process to finalize the
details of the signature computation) is final, and is being
incorporated into the next draft specification. The editor has
promised me that the new DW_TAG and DW_AT codes are cast in stone.
DWARF-4 is closed to new issues now, and I think the chances of any
changes are virtually nil.