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]

[Ada/dwarf] New DW_AT_GNAT_descriptive_type DWARF attribute...


GDB developers,

For debugging Ada, part of the information that we need is stored
in symbol names following a specific encoding.  This encoding is
documented in the GCC sources, file exp_dbug.ads. The reason behind
this encoding is that older debugging info formats such as stabs
were too limited to express some of the Ada features: variant records
(structs whose definition and size may change depending on context),
renamings, etc.

DWARF comes much closer to allowing us to express those features.
There are still a few unknowns that we haven't quite resolved yet,
but it's close.  However, as much as I would personally like to see
stabs disappear, it's still there, so we have to continue to support
AdaCore's encoding.  Similarly, we haven't had time to look into
reducing the use of the encoding when using DWARF.

A few years ago, we introduced a new attribute named
DW_AT_GNAT_descriptive_type, whose purpose was to provide a direct
link from a type to its parallel type.  For instance, for certain
array types, the array bounds are expressed through a parallel
type whose name is the same as the array type, but with an extra
___XA suffix. What GDB needs to do, then, is search all the types
to see if it can find a type with that ___XA suffix. The new
attribute makes that search instantaneous.

At the time, we had hoped that this would be a temporary, local
change, until we find the time to work on generating pure DWARF.
But the reality is that we don't see this happening in the near
future. As we've come to accept this fact, we at AdaCore think
that it would be useful to others to be able to take advantage
of this attribute.

The changes in GDB are relatively small, I think - at least in
the DWARF reader part. We added a field in the gnat_specific part
of struct type, and I can see how it could trigger some protests.
But we can discuss the specifics of the patch if there are no
objections to this new attribute.

-- 
Joel


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