This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 01/10] vla: introduce new bound type abstraction adapt uses
- From: Tom Tromey <tromey at redhat dot com>
- To: Sanimir Agovic <sanimir dot agovic at intel dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 07 Nov 2013 11:01:31 -0700
- Subject: Re: [PATCH 01/10] vla: introduce new bound type abstraction adapt uses
- Authentication-results: sourceware.org; auth=none
- References: <1382366424-21010-1-git-send-email-sanimir dot agovic at intel dot com> <1382366424-21010-2-git-send-email-sanimir dot agovic at intel dot com>
>>>>> "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