Re: [PATCH 2/3] fort_dyn_array: Support evaluation of dynamic elements inside arrays.

Yao Qi
2016-04-04T13:42:20Z

Bernhard Heckel <bernhard.heckel@intel.com> writes:

> +# Check allocation status of dynamic array and it's dynamic members

s/it's/its/

> diff --git a/gdb/valarith.c b/gdb/valarith.c
> index 7959f3b..62d0e30 100644
> --- a/gdb/valarith.c
> +++ b/gdb/valarith.c
> @@ -207,6 +207,15 @@ value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound)
> error (_("no such vector element"));
> }
>
> + if (is_dynamic_type (elt_type))
> + {
> + gdb_byte *valaddr = NULL;
> + CORE_ADDR address;
> +
> + address = value_address (array) + elt_offs;
> + elt_type = resolve_dynamic_type (elt_type, valaddr, address);

Pass NULL to resolve_dynamic_type, so valaddr can be removed.

> + }
> +
> if (VALUE_LVAL (array) == lval_memory && value_lazy (array))
> v = allocate_value_lazy (elt_type);
> else

Patch looks good to me, otherwise.

--
Yao (齐尧)