From 27bc4d809ea2b4a3e4833806494db3a2fee83c64 Mon Sep 17 00:00:00 2001 From: Thiago Jung Bauermann Date: Thu, 25 Oct 2007 18:01:58 +0000 Subject: 2007-10-25 Wu Zhou Thiago Jung Bauermann * 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. --- gdb/expression.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gdb/expression.h') diff --git a/gdb/expression.h b/gdb/expression.h index fb4ecac..01ddc05 100644 --- a/gdb/expression.h +++ b/gdb/expression.h @@ -328,6 +328,11 @@ enum exp_opcode /* A F90 array range operator (for "exp:exp", "exp:", ":exp" and ":"). */ OP_F90_RANGE, + /* OP_DECFLOAT is followed by a type pointer in the next exp_element + and a dec long constant value in the following exp_element. + Then comes another OP_DECFLOAT. */ + OP_DECFLOAT, + /* First extension operator. Individual language modules define extra operators they need as constants with values OP_LANGUAGE_SPECIFIC0 + k, for k >= 0, using a separate @@ -355,6 +360,7 @@ union exp_element struct symbol *symbol; LONGEST longconst; DOUBLEST doubleconst; + gdb_byte decfloatconst[16]; /* Really sizeof (union exp_element) characters (or less for the last element of a string). */ char string; -- cgit v1.1