[Dwarf-Discuss] Adding dynamic attribute value to DW_AT_const_value
kendrick at ca.ibm.com
Tue Dec 7 10:04:59 PST 2010
According to 2.19, "Static and Dynamic Values of Attributes":
Some attributes that apply to types specify a property (such as the lower
bound of an array) that is an integer value, where the value may be known
during compilation or may be computed dynamically during execution.
Whether an attribute value can be dynamic depends on the rules of the
applicable programming language.
The spec then lists a few attributes which fall under this category (i.e.
DW_AT_upper_bound, DW_AT_bytes_stride, etc..) DW_AT_const_value does not
currently fall under this category, however, base on the wordings above,
is the producer free to add an exprloc form to this attribute as long as
it makes sense to the language? In my case, I plan to use it to describe
Fortran 2003 derived type:
type, private :: dt(k,l)
integer, kind :: k
integer, len :: l
integer(k) :: arr_comp(l)
type(dt(4,:)), pointer :: t
The parameter k and l can be described via
DW_TAG_template_value_parameter, and their values described by
DW_AT_const_value. In this example, l is only known at runtime, so it
would make sense for DW_AT_const_value to have an exprloc form.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Dwarf-Discuss