This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/3] fort_dyn_array: Support evaluation of dynamic elements inside arrays.
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: Bernhard Heckel <bernhard dot heckel at intel dot com>
- Cc: brobecker at adacore dot com, gdb-patches at sourceware dot org
- Date: Mon, 04 Apr 2016 14:41:59 +0100
- Subject: Re: [PATCH 2/3] fort_dyn_array: Support evaluation of dynamic elements inside arrays.
- Authentication-results: sourceware.org; auth=none
- References: <1458204189-13267-1-git-send-email-bernhard dot heckel at intel dot com> <1458204189-13267-3-git-send-email-bernhard dot heckel at intel dot com>
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 (éå)