This is the mail archive of the gdb@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]

RE: how to support C type qualifiers applied to arrays?


Jim Wilson wrote (in part):
> This seems to answer the question I asked long ago.  Why are we trying
> to put back qualifiers from the decl?  Because gen_type_die stripped
> them off.  This seems wrong.
>

It seems that the use of type_main_variant()
dates back to the original port of the DWARF 1 generator
to the DWARF 2 implementation.  I didn't try understanding the
DWARF 1 generator in detail, but it seemed that the use of the
type's main variant helped limit the number of unique type dies
that were generated.  In any event, it doesn't appear that there
is a compelling reason to continue to use the type_main_variant()
for DWARF 2 generatiion, especially in light of the fact that
in some cases the DWARF 2 information is incorrect in the current
implmentation.

There are of course the risks that you mentioned
in your reply that there may now be implicit assumptions made
by the various clients (C, C++, Fortran, Ada, for example)
regarding dependencies upon the type_main_variant(), but we
may have to deal with those issues as they arise.
 
> If we fix gen_type_die to stop calling type_main_variant, and 
> if we fix
> gen_variable_die to stop adding back the type qualifiers, 
> then I get the
> right result.  So I think I was on the right track before, we 
> just need
> another little change to gen_type_die in addition to what I already
> described.

I'll give this a try, and follow up.


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