diff options
author | Ken Werner <ken.werner@de.ibm.com> | 2010-11-03 14:06:27 +0000 |
---|---|---|
committer | Ken Werner <ken.werner@de.ibm.com> | 2010-11-03 14:06:27 +0000 |
commit | 120bd36024971107c9f5dce6882e343c836a6402 (patch) | |
tree | 30540b525cde8e6b84e8bb78a4cfa77ab9acddc5 /gdb/valops.c | |
parent | c37f7098e9cb05b2574cf82e6ae299530ed407ba (diff) | |
download | gdb-120bd36024971107c9f5dce6882e343c836a6402.zip gdb-120bd36024971107c9f5dce6882e343c836a6402.tar.gz gdb-120bd36024971107c9f5dce6882e343c836a6402.tar.bz2 |
gdb:
* valarith.c (value_pos, value_neg, value_complement): Handle
vector types.
* valops.c (value_one): Likewise.
gdb/testsuite:
* gdb.base/gnu_vector.exp: Add unary operator tests.
Diffstat (limited to 'gdb/valops.c')
-rw-r--r-- | gdb/valops.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gdb/valops.c b/gdb/valops.c index 07b62a1..22ba54a 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -871,6 +871,20 @@ value_one (struct type *type, enum lval_type lv) { val = value_from_longest (type, (LONGEST) 1); } + else if (TYPE_CODE (type1) == TYPE_CODE_ARRAY && TYPE_VECTOR (type1)) + { + struct type *eltype = check_typedef (TYPE_TARGET_TYPE (type1)); + int i, n = TYPE_LENGTH (type1) / TYPE_LENGTH (eltype); + struct value *tmp; + + val = allocate_value (type); + for (i = 0; i < n; i++) + { + tmp = value_one (eltype, lv); + memcpy (value_contents_writeable (val) + i * TYPE_LENGTH (eltype), + value_contents_all (tmp), TYPE_LENGTH (eltype)); + } + } else { error (_("Not a numeric type.")); |