This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Small fix for assigning values to vectors
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: ken at linux dot vnet dot ibm dot com (Ken Werner), dan at codesourcery dot com
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 7 Jul 2010 19:50:14 +0200 (CEST)
- Subject: Re: [patch] Small fix for assigning values to vectors
Ken Werner wrote:
> As can be seen the GDB behaves incorrect for vector types. A quick look to the
> valops.c:value_assign function shows that value_coerce_to_target creates a
> value with lval set to lval_memory for array types (including vectors). The
> code was introduced with the following patch: http://sourceware.org/ml/gdb-
> patches/2008-03/msg00079.html. I have to admit that I do not entirely
> understand why value_coerce_to_target is called here.
Dan, do you recall why you added a value_coerce_to_target for the *destination*
of an assignment? It seems this shouldn't really be necessary ...
> @@ -1424,6 +1424,9 @@ value_must_coerce_to_target (struct valu
>
> valtype = check_typedef (value_type (val));
>
> + if (TYPE_VECTOR (valtype))
> + return 0;
> +
> switch (TYPE_CODE (valtype))
> {
> case TYPE_CODE_ARRAY:
Ken, this doesn't look quite right: the TYPE_VECTOR flag is defined only for
TYPE_CODE_ARRAY types; you should never look at TYPE_VECTOR for any other type.
Otherwise, this looks reasonable to me ...
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com