diff options
author | Ken Werner <ken.werner@de.ibm.com> | 2010-07-14 14:54:58 +0000 |
---|---|---|
committer | Ken Werner <ken.werner@de.ibm.com> | 2010-07-14 14:54:58 +0000 |
commit | 3cbaedfff7a843d64792766c0322ea3a66ef6cb2 (patch) | |
tree | 9dc5bdb9dd1757d262d786b089b6e19d68bfa793 | |
parent | c932f1bef204df484f5dcbc2206ec26f62bcddff (diff) | |
download | gdb-3cbaedfff7a843d64792766c0322ea3a66ef6cb2.zip gdb-3cbaedfff7a843d64792766c0322ea3a66ef6cb2.tar.gz gdb-3cbaedfff7a843d64792766c0322ea3a66ef6cb2.tar.bz2 |
gdb/ChangeLog:* valops.c (value_assign): Do not call to value_coerce_to_target.(value_must_coerce_to_target): Return 0 in case of TYPE_VECTOR.gdb/testsuite/ChangeLog:* gdb.arch/altivec-abi.exp: New tests.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.arch/altivec-abi.exp | 10 | ||||
-rw-r--r-- | gdb/valops.c | 6 |
4 files changed, 21 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 334e7b0..1cfa87d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2010-07-14 Ken Werner <ken.werner@de.ibm.com> + * valops.c (value_assign): Do not call to value_coerce_to_target. + (value_must_coerce_to_target): Return 0 in case of TYPE_VECTOR. + +2010-07-14 Ken Werner <ken.werner@de.ibm.com> + * MAINTAINERS: Add myself for write after approval privileges. 2010-07-13 Emmanuel Thomé <Emmanuel.Thome@gmail.com> diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 6b52dbb..e657676 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2010-07-14 Ken Werner <ken.werner@de.ibm.com> + + * gdb.arch/altivec-abi.exp: New tests. + 2010-07-13 Tom Tromey <tromey@redhat.com> * gdb.python/py-prettyprint.c (struct arraystruct): New struct. diff --git a/gdb/testsuite/gdb.arch/altivec-abi.exp b/gdb/testsuite/gdb.arch/altivec-abi.exp index dc9a22c..907257a 100644 --- a/gdb/testsuite/gdb.arch/altivec-abi.exp +++ b/gdb/testsuite/gdb.arch/altivec-abi.exp @@ -98,6 +98,16 @@ proc altivec_abi_tests { extra_flags force_abi } { gdb_test "p vec_func(vshort_d,vushort_d,vint_d,vuint_d,vchar_d,vuchar_d,vfloat_d,x_d,y_d,a_d,b_d,c_d,intv_on_stack_d)" \ ".\[0-9\]+ = .0, 0, 0, 0." "call inferior function with vectors (2)" + # Attempt to take address of the return value of vec_func. + gdb_test "p &vec_func(vshort,vushort,vint,vuint,vchar,vuchar,vfloat,x,y,a,b,c,intv_on_stack)" \ + "Attempt to take address of value not located in memory." \ + "Attempt to take address of the return value of vec_func" + + # Attempt to assing a value to the return value of vec_func. + gdb_test "set variable vec_func(vshort,vushort,vint,vuint,vchar,vuchar,vfloat,x,y,a,b,c,intv_on_stack) = {0,1,2,3}" \ + "Left operand of assignment is not an lvalue." \ + "Attempt to assing a value to the return value of vec_func" + # Let's step into the function, to see if the args are printed correctly. gdb_test "step" \ $pattern1 \ diff --git a/gdb/valops.c b/gdb/valops.c index 7fbad10..8150d7e 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -1079,10 +1079,7 @@ value_assign (struct value *toval, struct value *fromval) type = value_type (toval); if (VALUE_LVAL (toval) != lval_internalvar) - { - toval = value_coerce_to_target (toval); - fromval = value_cast (type, fromval); - } + fromval = value_cast (type, fromval); else { /* Coerce arrays and functions to pointers, except for arrays @@ -1427,6 +1424,7 @@ value_must_coerce_to_target (struct value *val) switch (TYPE_CODE (valtype)) { case TYPE_CODE_ARRAY: + return TYPE_VECTOR (valtype) ? 0 : 1; case TYPE_CODE_STRING: return 1; default: |