[Dwarf-Discuss] Adding dynamic attribute value to DW_AT_const_value

Kendrick Wong 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:

module m
  type, private :: dt(k,l)
    integer, kind :: k
    integer, len :: l
    integer(k) :: arr_comp(l)
  end type
  type(dt(4,:)), pointer :: t
end module

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.

Kendrick Wong 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dwarfstd.org/private.cgi/dwarf-discuss-dwarfstd.org/attachments/20101207/61fbb8c7/attachment-0001.htm>

More information about the Dwarf-Discuss mailing list