[Dwarf-Discuss] About self-referencial sized types

Pierre-Marie de Rodat derodat@adacore.com
Fri Aug 29 09:03:46 GMT 2014


Hi,

For the record, here is a status update on this issue:

On 06/10/2014 11:30 AM, Pierre-Marie de Rodat wrote:
> Unfortunately, we do not store the value of the upper bounds in the
> record (nor anywhere else): the only way to get it at runtime is to
> compute it from the discriminants.

After more investigation, we eventually realized that defining the lower 
and upper bounds directly as discriminant values (and thus as references 
to DW_TAG_member DIEs) is actually perfectly fine for the debugger.

It is also more correct from the point of view of the Ada standard: 
getting the bounds at runtime (thanks to the Array_Object'First and 
'Last constructs) must yield the discriminants.

The original issue may still be there for other languages, but since 
it's not legal to write the following in Ada:

    type Record_Type (N : Integer) is record
       S : String (1 .. N + 1);
    end record;

Bounds are precisely discriminants or aren't based on them at all. So 
the current DWARF specification is expressive enough to describe Ada 
arrays bounds in type info.

Many thanks to everyone who participated in this interesting discussion! :-)

-- 
Pierre-Marie de Rodat



More information about the Dwarf-discuss mailing list