mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 01:07:52 +00:00
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.
This commit is contained in:
13
gdb/parse.c
13
gdb/parse.c
@@ -247,6 +247,18 @@ write_exp_elt_dblcst (DOUBLEST expelt)
|
||||
write_exp_elt (tmp);
|
||||
}
|
||||
|
||||
void
|
||||
write_exp_elt_decfloatcst (gdb_byte expelt[16])
|
||||
{
|
||||
union exp_element tmp;
|
||||
int index;
|
||||
|
||||
for (index = 0; index < 16; index++)
|
||||
tmp.decfloatconst[index] = expelt[index];
|
||||
|
||||
write_exp_elt (tmp);
|
||||
}
|
||||
|
||||
void
|
||||
write_exp_elt_type (struct type *expelt)
|
||||
{
|
||||
@@ -718,6 +730,7 @@ operator_length_standard (struct expression *expr, int endpos,
|
||||
|
||||
case OP_LONG:
|
||||
case OP_DOUBLE:
|
||||
case OP_DECFLOAT:
|
||||
case OP_VAR_VALUE:
|
||||
oplen = 4;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user