Initialize the TYPE_FLOATFORMAT field of the h/w floating-point
authorAndrew Cagney <cagney@redhat.com>
Tue, 22 Jan 2002 19:57:40 +0000 (19:57 +0000)
committerAndrew Cagney <cagney@redhat.com>
Tue, 22 Jan 2002 19:57:40 +0000 (19:57 +0000)
builtin types.

gdb/ChangeLog
gdb/doublest.c
gdb/gdbtypes.c

index 73476591a7eceb386f083a4139d0f85cf6647d5c..5243c91dedc52c6769b4c00eb9b03568d915e614 100644 (file)
@@ -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
index 2b606573610683fe3948ac0c2ceafd9daa5251c2..93e4a7eb25f98e7f6030f56a6c0476b438a953fd 100644 (file)
@@ -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;
index 23b18646603fe688926dbc26f428f90c3c6139c9..b6de34c26ef504936569755bf3aae50352ac6af9 100644 (file)
@@ -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,