[RFA/DWARF] Add DW_AT_GNAT_descriptive_type support
Tom Tromey
tromey@redhat.com
Tue Jan 5 20:12:00 GMT 2010
>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:
Joel> I have taken the time to order the patches to follow the same order
Joel> as if I was to write the patch all over again (gdbtypes updates,
Joel> dwarf2read updates, etc). Hopefully this will help reading it.
Thanks... though I don't really want to encourage this sort of thing,
because it will mean people will start expect it from me ;-)
This patch seems pretty reasonable.
Joel> There are still a couple of things that are worth discussing:
Joel> (a) You'll see that I put a FIXME after modifying the
Joel> TYPE_CPLUS_SPECIFIC macro. The comment says it all. I think
Joel> that the fix is fine; in fact, we could generalize this approach
Joel> to all the accessor macros for the type-specific union - I
Joel> wouldn't see a problem with that, and would make the code more
Joel> resilient to incorrect field access. For now, I opted for just
Joel> fixing this one macro, since C is usually the "universal" "bare"
Joel> language. Ada or C++ might be less so: Who would want to use
Joel> C++ or Ada to display a Fortran array? :-)
The modified macro uses the default if Gnat aux info is available. It
seem to me that the check should instead be to see if the C++ info is
not available.
Joel> (b) We need to determine how GCC will tell GDB that it uses the
Joel> DW_AT_GNAT_descriptive_type attribute.
[...]
Joel> What's the best way for GCC to tell GDB? At AdaCore, we relied
Joel> on a hack, where we parsed a special marker in the CU producer
Joel> attribute. It's kind of gross, but it served us well. Any
Joel> suggestion?
How about a new GNU extension attribute in the CU DIE?
Joel> + if (! HAVE_CPLUS_STRUCT (type))
Joel> + n_base_classes = 0;
Joel> + else
Joel> + n_base_classes = TYPE_N_BASECLASSES (type);
This seems a little weird to me.
Do we need this everywhere we use TYPE_N_BASECLASSES?
Tom
More information about the Gdb-patches
mailing list