summaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
diff options
context:
space:
mode:
authorThiago Jung Bauermann <bauerman@br.ibm.com>2007-10-25 17:57:34 +0000
committerThiago Jung Bauermann <bauerman@br.ibm.com>2007-10-25 17:57:34 +0000
commitbebcf92a4127f21ef28a926f7656c55e7b9ce292 (patch)
tree8823026e10d1ff573212e091b5b50266001c0529 /gdb/dwarf2read.c
parent4b6f5649fb3872af8e18d148d135f644298697f3 (diff)
downloadgdb-bebcf92a4127f21ef28a926f7656c55e7b9ce292.tar.gz
2007-10-25 Wu Zhou <woodzltc@cn.ibm.com>
Thiago Jung Bauermann <bauerman@br.ibm.com> * c-lang.c (c_create_fundamental_type): Create fundamental types for DFP. * c-typeprint.c (c_type_print_varspec_prefix): Add TYPE_CODE_DECFLOAT to no prefix needed case. (c_type_print_varspec_suffix): Add TYPE_CODE_DECFLOAT to no suffix needed case. * c-valprint.c (c_val_print): Call print_decimal_floating to print DFP values. * dwarf2read.c (read_base_type): Read DW_ATE_decimal_float attribute code and return TYPE_CODE_DECFLOAT. (dwarf_base_type): Set dwarf2_fundamental_type for DFP values. * gdbtypes.c (gdbtypes_post_init): Initialize builtin_decfloat, builtin_decdouble and builtin_declong. * gdbtypes.h (enum type_code): Add TYPE_CODE_DECFLOAT as a type code for DFP. (FT_DECFLOAT, FT_DBL_PREC_DECFLOAT, FT_EXT_PREC_DECFLOAT): New types, for decimal floating point. (FT_NUM_MEMBERS): Increment, new types added. (struct builtin_type): Add builtin_decfloat, builtin_decdouble and builtin_declong. * valprint.c (print_decimal_floating): New function to print DFP values. * value.h (print_decimal_floating): Prototype.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r--gdb/dwarf2read.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index a5fdbee8df5..5d855195675 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -4865,6 +4865,9 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu)
case DW_ATE_complex_float:
code = TYPE_CODE_COMPLEX;
break;
+ case DW_ATE_decimal_float:
+ code = TYPE_CODE_DECFLOAT;
+ break;
case DW_ATE_float:
code = TYPE_CODE_FLT;
break;
@@ -7751,6 +7754,14 @@ dwarf_base_type (int encoding, int size, struct dwarf2_cu *cu)
type = dwarf2_fundamental_type (objfile, FT_FLOAT, cu);
}
return type;
+ case DW_ATE_decimal_float:
+ if (size == 16)
+ type = dwarf2_fundamental_type (objfile, FT_DBL_PREC_DECFLOAT, cu);
+ else if (size == 8)
+ type = dwarf2_fundamental_type (objfile, FT_EXT_PREC_DECFLOAT, cu);
+ else
+ type = dwarf2_fundamental_type (objfile, FT_DECFLOAT, cu);
+ return type;
case DW_ATE_signed:
switch (size)
{