This is the mail archive of the gdb-patches@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]

Re: [Patch v2 01/10] vla: introduce new bound type abstraction adapt uses


>>>>> "Sanimir" == Sanimir Agovic <sanimir.agovic@intel.com> writes:

Sanimir> The rational behind this patch is to get started to implement
Sanimir> the feature described in dwarf4 standard (2.19) Static and
Sanimir> Dynamic Values of Attributes.  It adds new DWARF2_PROP to store
Sanimir> either a constant, exprloc, or reference to describe an
Sanimir> upper-/lower bound of a subrange. Other than that no new
Sanimir> features are introduce.

Thanks.

I have one nit and one more serious question.

Sanimir> +    low.data.const_val =
Sanimir> +      dwarf2_get_attr_constant_value (attr, low.data.const_val);

Split before the "=", not after.

Sanimir> +struct type *
Sanimir> +create_range_type_1 (struct type *result_type, struct type *index_type,
Sanimir> +		     const struct dwarf2_prop *low_bound,
Sanimir> +		     const struct dwarf2_prop *high_bound)
[...]

Sanimir>  create_range_type (struct type *result_type, struct type *index_type,
Sanimir>  		   LONGEST low_bound, LONGEST high_bound)
Sanimir>  {
[...]
Sanimir> +  result_type = create_range_type_1 (result_type, index_type,
Sanimir> +				     &low, &high);
 
Sanimir>    if (low_bound >= 0)
Sanimir>      TYPE_UNSIGNED (result_type) = 1;

I wonder why the TYPE_UNSIGNED setting is in create_range_type but not
in create_range_type_1.  It seems like this would cause a change in
semantics in dwarf2read, which now calls the new function.

Tom


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