summaryrefslogtreecommitdiff
path: root/gdb/eval.c
diff options
context:
space:
mode:
authorThiago Jung Bauermann <bauerman@br.ibm.com>2007-10-25 18:01:58 +0000
committerThiago Jung Bauermann <bauerman@br.ibm.com>2007-10-25 18:01:58 +0000
commitd4252fb7dc571f6fe3bc5d9def88aceee59f2da3 (patch)
treeebd9a237398067ae26ac43cd49bc5e5b7bfee66f /gdb/eval.c
parentbebcf92a4127f21ef28a926f7656c55e7b9ce292 (diff)
downloadgdb-d4252fb7dc571f6fe3bc5d9def88aceee59f2da3.tar.gz
2007-10-25 Wu Zhou <woodzltc@cn.ibm.com>
Thiago Jung Bauermann <bauerman@br.ibm.com> * c-exp.y (YYSTYPE): Add typed_val_decfloat for decimal floating point in YYSTYPE union. (DECFLOAT) Add token and expression element handling code. (parse_number): Parse DFP constants, which end with suffix 'df', 'dd' or 'dl'. Return DECFLOAT. * eval.c (evaluate_subexp_standard): Call value_from_decfloat to handle OP_DECFLOAT. * expression.h (enum exp_opcode): Add an opcode (OP_DECFLOAT) for DFP constants. (union exp_element): Add decfloatconst to represent DFP elements, which is 16 bytes by default. * parse.c (write_exp_elt_decfloatcst): New function to write a decimal float const into the expression. (operator_length_standard): Set operator length for OP_DECFLOAT to 4. * parser-defs.h (write_exp_elt_decfloatcst): Prototype. * valarith.c (value_neg): Add code to handle the negation operation of DFP values. * value.c (value_from_decfloat): New function to get the value from a decimal floating point. * value.h (value_from_decfloat): Prototype.
Diffstat (limited to 'gdb/eval.c')
-rw-r--r--gdb/eval.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gdb/eval.c b/gdb/eval.c
index ee1ac589ee2..2e6a8325ad5 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -456,6 +456,11 @@ evaluate_subexp_standard (struct type *expect_type,
return value_from_double (exp->elts[pc + 1].type,
exp->elts[pc + 2].doubleconst);
+ case OP_DECFLOAT:
+ (*pos) += 3;
+ return value_from_decfloat (expect_type, exp->elts[pc + 1].type,
+ exp->elts[pc + 2].decfloatconst);
+
case OP_VAR_VALUE:
(*pos) += 3;
if (noside == EVAL_SKIP)