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 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 very much for working on this.

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

This line is too long and should be wrapped.

 
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> +{

This needs an introductory comment.

Sanimir> +/* Used to store bound information for a type.  */
Sanimir> +
Sanimir> +struct dwarf2_prop
Sanimir> +{
Sanimir> +  /* Determine which field of the union dwarf2_prop.data is used.  */
Sanimir> +  enum
Sanimir> +  {
Sanimir> +    DWARF_CONST,
Sanimir> +    DWARF_LOCEXPR,
Sanimir> +    DWARF_LOCLIST
Sanimir> +  } kind;
Sanimir> +
Sanimir> +  /* Stores information as location expression, location list,
Sanimir> +     or constant value.  */
Sanimir> +  union data
Sanimir> +  {
Sanimir> +    LONGEST const_val;
Sanimir> +    struct dwarf2_locexpr_baton *locexpr;
Sanimir> +    struct dwarf2_loclist_baton *loclist;
Sanimir> +  } data;
Sanimir> +};

Sanimir> @@ -589,11 +612,11 @@ struct main_type
Sanimir>      {
Sanimir>        /* Low bound of range.  */
 
Sanimir> -      LONGEST low;
Sanimir> +      struct dwarf2_prop low;
 
Sanimir>        /* High bound of range.  */
 
Sanimir> -      LONGEST high;
Sanimir> +      struct dwarf2_prop high;
 

Just after this hunk of "struct range_bounds" is this code:

      /* Flags indicating whether the values of low and high are
         valid.  When true, the respective range value is
         undefined.  Currently used only for FORTRAN arrays.  */
           
      char low_undefined;
      char high_undefined;

It seems to me that it would be cleanest to make this a new value of the
enum you introduced, like "DWARF_UNDEFINED", and update a few macros to
follow.  What do you think?

Tom


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