[RFA] comdat types

Doug Evans dje@google.com
Fri Jun 26 00:54:00 GMT 2009


On Thu, Jun 25, 2009 at 5:01 PM, Cary Coutant<ccoutant@google.com> wrote:
>> 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.

I looked back, and apparently it there's by request of the dwarf committee.
Since it's there I made use of it, but that can change of course.



More information about the Gdb-patches mailing list