diff options
-rw-r--r-- | gdb/ChangeLog | 15 | ||||
-rw-r--r-- | gdb/doublest.c | 5 | ||||
-rw-r--r-- | gdb/gdbtypes.c | 14 |
3 files changed, 33 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 73476591a7e..5243c91dedc 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,18 @@ +2002-01-22 Andrew Cagney <ac131313@redhat.com> + + * doublest.c (floatformat_is_negative): Assert FMT is non NULL. + (floatformat_is_nan, floatformat_mantissa): Ditto. + + * gdbtypes.c (_initialize_gdbtypes): Initialize TYPE_FLOATFORMAT + for builtin_type_ieee_single_little, builtin_type_ieee_double_big, + builtin_type_ieee_double_little, + builtin_type_ieee_double_littlebyte_bigword, + builtin_type_m68881_ext, builtin_type_i960_ext, + builtin_type_m88110_ext, builtin_type_m88110_harris_ext, + builtin_type_arm_ext_big, builtin_type_arm_ext_littlebyte_bigword, + builtin_type_ia64_spill_big, builtin_type_ia64_spill_little and + builtin_type_ia64_quad_big, builtin_type_ia64_quad_little. + 2002-01-22 Corinna Vinschen <vinschen@redhat.com> * xstormy16-tdep.c (xstormy16_scan_prologue): Add frameless diff --git a/gdb/doublest.c b/gdb/doublest.c index 2b606573610..93e4a7eb25f 100644 --- a/gdb/doublest.c +++ b/gdb/doublest.c @@ -439,7 +439,7 @@ int floatformat_is_negative (const struct floatformat *fmt, char *val) { unsigned char *uval = (unsigned char *) val; - + gdb_assert (fmt != NULL); return get_field (uval, fmt->byteorder, fmt->totalsize, fmt->sign_start, 1); } @@ -454,6 +454,8 @@ floatformat_is_nan (const struct floatformat *fmt, char *val) unsigned int mant_bits, mant_off; int mant_bits_left; + gdb_assert (fmt != NULL); + if (! fmt->exp_nan) return 0; @@ -503,6 +505,7 @@ floatformat_mantissa (const struct floatformat *fmt, char *val) char buf[9]; /* Make sure we have enough room to store the mantissa. */ + gdb_assert (fmt != NULL); gdb_assert (sizeof res > ((fmt->man_len + 7) / 8) * 2); mant_off = fmt->man_start; diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 23b18646603..b6de34c26ef 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -3328,15 +3328,19 @@ _initialize_gdbtypes (void) builtin_type_ieee_single_little = init_type (TYPE_CODE_FLT, floatformat_ieee_single_little.totalsize / 8, 0, "builtin_type_ieee_single_little", NULL); + TYPE_FLOATFORMAT (builtin_type_ieee_single_little) = &floatformat_ieee_single_little; builtin_type_ieee_double_big = init_type (TYPE_CODE_FLT, floatformat_ieee_double_big.totalsize / 8, 0, "builtin_type_ieee_double_big", NULL); + TYPE_FLOATFORMAT (builtin_type_ieee_double_big) = &floatformat_ieee_double_big; builtin_type_ieee_double_little = init_type (TYPE_CODE_FLT, floatformat_ieee_double_little.totalsize / 8, 0, "builtin_type_ieee_double_little", NULL); + TYPE_FLOATFORMAT (builtin_type_ieee_double_little) = &floatformat_ieee_double_little; builtin_type_ieee_double_littlebyte_bigword = init_type (TYPE_CODE_FLT, floatformat_ieee_double_littlebyte_bigword.totalsize / 8, 0, "builtin_type_ieee_double_littlebyte_bigword", NULL); + TYPE_FLOATFORMAT (builtin_type_ieee_double_littlebyte_bigword) = &floatformat_ieee_double_littlebyte_bigword; builtin_type_i387_ext = init_type (TYPE_CODE_FLT, floatformat_i387_ext.totalsize / 8, 0, "builtin_type_i387_ext", NULL); @@ -3344,33 +3348,43 @@ _initialize_gdbtypes (void) builtin_type_m68881_ext = init_type (TYPE_CODE_FLT, floatformat_m68881_ext.totalsize / 8, 0, "builtin_type_m68881_ext", NULL); + TYPE_FLOATFORMAT (builtin_type_m68881_ext) = &floatformat_m68881_ext; builtin_type_i960_ext = init_type (TYPE_CODE_FLT, floatformat_i960_ext.totalsize / 8, 0, "builtin_type_i960_ext", NULL); + TYPE_FLOATFORMAT (builtin_type_i960_ext) = &floatformat_i960_ext; builtin_type_m88110_ext = init_type (TYPE_CODE_FLT, floatformat_m88110_ext.totalsize / 8, 0, "builtin_type_m88110_ext", NULL); + TYPE_FLOATFORMAT (builtin_type_m88110_ext) = &floatformat_m88110_ext; builtin_type_m88110_harris_ext = init_type (TYPE_CODE_FLT, floatformat_m88110_harris_ext.totalsize / 8, 0, "builtin_type_m88110_harris_ext", NULL); + TYPE_FLOATFORMAT (builtin_type_m88110_harris_ext) = &floatformat_m88110_harris_ext; builtin_type_arm_ext_big = init_type (TYPE_CODE_FLT, floatformat_arm_ext_big.totalsize / 8, 0, "builtin_type_arm_ext_big", NULL); + TYPE_FLOATFORMAT (builtin_type_arm_ext_big) = &floatformat_arm_ext_big; builtin_type_arm_ext_littlebyte_bigword = init_type (TYPE_CODE_FLT, floatformat_arm_ext_littlebyte_bigword.totalsize / 8, 0, "builtin_type_arm_ext_littlebyte_bigword", NULL); + TYPE_FLOATFORMAT (builtin_type_arm_ext_littlebyte_bigword) = &floatformat_arm_ext_littlebyte_bigword; builtin_type_ia64_spill_big = init_type (TYPE_CODE_FLT, floatformat_ia64_spill_big.totalsize / 8, 0, "builtin_type_ia64_spill_big", NULL); + TYPE_FLOATFORMAT (builtin_type_ia64_spill_big) = &floatformat_ia64_spill_big; builtin_type_ia64_spill_little = init_type (TYPE_CODE_FLT, floatformat_ia64_spill_little.totalsize / 8, 0, "builtin_type_ia64_spill_little", NULL); + TYPE_FLOATFORMAT (builtin_type_ia64_spill_little) = &floatformat_ia64_spill_little; builtin_type_ia64_quad_big = init_type (TYPE_CODE_FLT, floatformat_ia64_quad_big.totalsize / 8, 0, "builtin_type_ia64_quad_big", NULL); + TYPE_FLOATFORMAT (builtin_type_ia64_quad_big) = &floatformat_ia64_quad_big; builtin_type_ia64_quad_little = init_type (TYPE_CODE_FLT, floatformat_ia64_quad_little.totalsize / 8, 0, "builtin_type_ia64_quad_little", NULL); + TYPE_FLOATFORMAT (builtin_type_ia64_quad_little) = &floatformat_ia64_quad_little; add_show_from_set ( add_set_cmd ("overload", no_class, var_zinteger, (char *) &overload_debug, |