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 2/3] fort_dyn_array: Support evaluation of dynamic elements inside arrays.


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 (éå)


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