This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [commit] Fix set $ev0.vec_f[0] = 1
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Andrew Cagney <ac131313 at redhat dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Sat, 8 Mar 2003 20:40:58 -0500
- Subject: Re: [commit] Fix set $ev0.vec_f[0] = 1
- References: <3E6A43E0.7040904@redhat.com>
On Sat, Mar 08, 2003 at 02:26:24PM -0500, Andrew Cagney wrote:
> Hello,
>
> The attached fixes the code that handles `set variable $ev0.vec_f[0] =
> 1'. i.e., assignment to a vector element of a vector register.
>
> The problem was two fold:
>
> - the code handling the subscripting of register and builtin variables
> never thought to set VALUE_REGNO(), leaving it with a value of -1.
>
> - the code handling register assignments was recently revamped (fixing
> bugs), but in the process started assuming that VALUE_REGNO() field of a
> destination value was valid.
>
> This patch fixes the subscript code so that the register number is valid.
>
> committed,
> Andrew
>
> PS: Elena's e500 tests, that I just posted, tickle this bug.
This patch is the same as the unreviewed pending/973 from Klee, by the
way. He also fixed a related comment; should that go in too?
> 2003-03-08 Andrew Cagney <cagney at redhat dot com>
>
> * valarith.c (value_subscripted_rvalue): Copy the array's REGNO to
> the result.
>
> Index: valarith.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/valarith.c,v
> retrieving revision 1.18
> diff -u -r1.18 valarith.c
> --- valarith.c 14 Jan 2003 00:49:04 -0000 1.18
> +++ valarith.c 8 Mar 2003 19:18:45 -0000
> @@ -276,6 +276,7 @@
> else
> VALUE_LVAL (v) = VALUE_LVAL (array);
> VALUE_ADDRESS (v) = VALUE_ADDRESS (array);
> + VALUE_REGNO (v) = VALUE_REGNO (array);
> VALUE_OFFSET (v) = VALUE_OFFSET (array) + elt_offs;
> return v;
> }
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer