This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

[RFA/DWARF2] Add DW_AT_GNAT_descriptive_type attribute


Hello,

I am about to send a patch to gdb-patches that will make use of a new
attribute DW_AT_GNAT_descriptive_type.  This attribute was introduced
at AdaCore a few years ago as a way for improving debugging performance.

Executive summary:
The debugging information produced by GNAT follows an encoding which
relies on "parallel types". See exp_dbug.ads for a complete spect of
the encoding used by GNAT. But a typical use of parallel types can be
found with dynamic types such as record types containing variable-length
fields: The compiler creates parallel types whose name is type___XVE.
When handling these types, the debugger needs to perform a global lookup
by name in order to find the parallel type.  This becomes a performance
issue with large applications.

The idea is that the compiler already knows the link between the dynamic
type and its parallel-type (I think that's gigi who does all this work).
This attribute provides a way for the compiler to store that link in
the debugging info.

DW_AT_GNAT_descriptive_type is an attribute which points to the DIE
of the associated parallel type.

Right now, I am mostly working on the debugger side, as I am extra
motivated in seeing the FSF GDB debug Ada apps well.  The rest of
the GDB maintainers have accepted the concept of this attribute, and
I have a patch that takes advantage of it.  The idea is that, once
the GDB patch is accepted, I send bribes and sweets to Eric Botcazou,
our debug info engineer extraordinaire, asking him to contribute
the associated compiler changes.

2009-12-24  Joel Brobecker  <brobecker@adacore.com>

        * dwarf2.h (enum dwarf_attribute): Add DW_AT_GNAT_descriptive_type.

Tested by rebuilding GDB.  OK to checkin?

Thanks,
-- 
Joel
commit 6556fbd588fec6a2db1ae98847ddb11df68cd71f
Author: Joel Brobecker <brobecker@adacore.com>
Date:   Tue Sep 29 10:57:00 2009 -0700

    include/
            * dwarf2.h (enum dwarf_attribute): Add DW_AT_GNAT_descriptive_type.
    
diff --git a/include/dwarf2.h b/include/dwarf2.h
index 559b82d..4971c41 100644
--- a/include/dwarf2.h
+++ b/include/dwarf2.h
@@ -425,6 +425,8 @@ enum dwarf_attribute
     DW_AT_GNU_template_name = 0x2110,
     /* VMS extensions.  */
     DW_AT_VMS_rtnbeg_pd_address = 0x2201,
+    /* GNAT extensions.  */
+    DW_AT_GNAT_descriptive_type	= 0x2302,
     /* UPC extension.  */
     DW_AT_upc_threads_scaled = 0x3210,
     /* PGI (STMicroelectronics) extensions.  */

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