Issue 160811.1: Allow reference class for DW_AT_string_length attribute

Author: Jakub Jelinek
Champion: Jakub Jelinek
Date submitted: 2016-08-11
Date revised:
Date closed:
Type: Enhancement
Status: Accepted
DWARF Version: 5

Section 5.11, pg 117

While for most of the type attributes with integral value (see 2.19 section Static and Dynamic Value of Attributes) the attribute can be constant class, exprloc or reference (the last one reference to another DIE that provides the integral value in its DW_AT_location), DW_AT_string_length only allows exprloc or loclistptr.

constant class isn't needed for it, because constant string length is expressed by DW_AT_byte_size, but it would be nice to just point to a DIE of the var holding the string length, without having to worry to propagate its location back to the DW_AT_string_length attribute (and especially hard if the types are emitted earlier by separate compilation step). Using DW_OP_call4 in the DW_AT_string_length works for this purpose only if the variable is going to have DWARF expression in its DW_AT_location, but not if it is a location description (DW_OP_stack_value ending, DW_OP_reg*, etc.).


12/06/2016 -- Accepted.