aboutsummaryrefslogtreecommitdiff
path: root/gdb/eval.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2008-09-11 14:12:15 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2008-09-11 14:12:15 +0000
commitc806c55a0672b52f228ce56f5bf57f065c447506 (patch)
tree1ba1bd00de1325503ac16e28493fec8e1d0ef10a /gdb/eval.c
parentfbb06eb1ba120adde645d64133f5a9bbf2d62ec7 (diff)
downloadgdb-c806c55a0672b52f228ce56f5bf57f065c447506.zip
gdb-c806c55a0672b52f228ce56f5bf57f065c447506.tar.gz
gdb-c806c55a0672b52f228ce56f5bf57f065c447506.tar.bz2
* expression.h (enum exp_opcode): Document OP_COMPLEX to take
a type parameter as expression element. * eval.c (evaluate_subexp_standard) [OP_COMPLEX]: Retrieve result type as expression element. * f-exp.y: Pass in type when buildin OP_COMPLEX expression. * parse.c (operator_length_standard): Update length of OP_COMPLEX.
Diffstat (limited to 'gdb/eval.c')
-rw-r--r--gdb/eval.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/eval.c b/gdb/eval.c
index 9086e1b..92b2d72 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -1369,10 +1369,11 @@ evaluate_subexp_standard (struct type *expect_type,
case OP_COMPLEX:
/* We have a complex number, There should be 2 floating
point numbers that compose it */
+ (*pos) += 2;
arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- return value_literal_complex (arg1, arg2, builtin_type_f_complex_s16);
+ return value_literal_complex (arg1, arg2, exp->elts[pc + 1].type);
case STRUCTOP_STRUCT:
tem = longest_to_int (exp->elts[pc + 1].longconst);