This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA/DWARF] Add DW_AT_GNAT_descriptive_type support
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 24 Dec 2009 20:39:48 +0100
- Subject: Re: [RFA/DWARF] Add DW_AT_GNAT_descriptive_type support
- References: <20091224180657.GV5942@adacore.com>
Hi Joel,
On Thu, 24 Dec 2009 19:06:57 +0100, Joel Brobecker wrote:
> Quick summary: The debugging info for Ada code follows an encoding
> (document in exp_dbug.ads in the GCC sources) which requires
http://gcc.gnu.org/viewcvs/trunk/gcc/ada/exp_dbug.ads?view=co
Record Types with Variable-Length Fields
> "parallel lookups". For instance, a record type with variable-size
> fields will see a parallel type named type___XVE being generated
> by the compiler. The debugger is supposed to look this type up
> in order to obtain some info necessary to decode the type.
>
> The new DW_AT_GNAT_descriptive_type attribute allows us to speed up
> this lookup when using DWARF,
DWARF provides DW_FORM_block* for such varying types. Such DW_FORM_block*
producer is implemented in gfortran upstream and it is implemented as the VLA
patchset (currently waiting on a discussion + resubmit from me) for GDB:
http://gcc.gnu.org/ml/gcc-patches/2007-11/msg00612.html
http://sourceware.org/gdb/wiki/ArcherBranchManagement - archer-jankratochvil-vla
It is true such DW_FORM_block* bytecode is not available for STABS.
But such DWARF-specific DW_AT_GNAT_descriptive_type attribute would exist in
DWARF only to unify debuginfo producer/consumer with less featureful STABS.
While it may make sense from the practical point of view I would like a clear
statement this is the reason for this "gross" DW_AT_GNAT_descriptive_type code.
With properly implemented DWARF-only DW_FORM_block* producer for GNAT the GDB
consumer would be IMO some small extension of dynamic types (to accept
DW_FORM_block* for several more DW_AT_* attributes and reuse the existing
dynamic->static converting code in check_typedef).
Regards,
Jan