]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* config/vax/tm-vax.h (INVALID_FLOAT): Move macro from here...
authorAndrew Cagney <cagney@redhat.com>
Tue, 29 Jan 2002 03:08:28 +0000 (03:08 +0000)
committerAndrew Cagney <cagney@redhat.com>
Tue, 29 Jan 2002 03:08:28 +0000 (03:08 +0000)
* vax-tdep.c (INVALID_FLOAT): To here.  Document why it is broken.

* rs6000-tdep.c (rs6000_do_registers_info): Delete code wrapped in
#ifdef INVALID_FLOAT.
* infcmd.c (do_registers_info): Ditto.
* values.c (unpack_double): Ditto.  Add comment.

* config/ns32k/tm-umax.h (INVALID_FLOAT): Delete macro that was
already commented out.

gdb/ChangeLog
gdb/config/ns32k/tm-umax.h
gdb/config/vax/tm-vax.h
gdb/infcmd.c
gdb/rs6000-tdep.c
gdb/values.c
gdb/vax-tdep.c

index 9f2daf7b1a9537f92a3939dfad8aecfafdc7d1de..de8d50be04a2375e9b922658d66a2ab8c27d3665 100644 (file)
@@ -1,3 +1,16 @@
+2002-01-28  Andrew Cagney  <ac131313@redhat.com>
+
+       * config/vax/tm-vax.h (INVALID_FLOAT): Move macro from here...
+       * vax-tdep.c (INVALID_FLOAT): To here.  Document why it is broken.
+
+       * rs6000-tdep.c (rs6000_do_registers_info): Delete code wrapped in
+       #ifdef INVALID_FLOAT.
+       * infcmd.c (do_registers_info): Ditto.
+       * values.c (unpack_double): Ditto.  Add comment.
+
+       * config/ns32k/tm-umax.h (INVALID_FLOAT): Delete macro that was
+       already commented out.
+
 2002-01-26  Andreas Schwab  <schwab@suse.de>
 
        * config/m68k/nm-linux.h (FETCH_INFERIOR_REGISTERS): Define.
index 9f1fb31eb24ec4dbaed8f3e7ecdbdea8ed758a9f..c09f53513d47c93e93e76babac38a966c4fa99a8 100644 (file)
@@ -68,21 +68,6 @@ extern CORE_ADDR umax_skip_prologue (CORE_ADDR);
 
 #define DECR_PC_AFTER_BREAK 0
 
-#if 0                          /* Disable until fixed *correctly*.  */
-#ifndef INVALID_FLOAT
-#ifndef NaN
-#include <nan.h>
-#endif /* NaN */
-
-/* Return 1 if P points to an invalid floating point value.  */
-/* Surely wrong for cross-debugging.  */
-#define INVALID_FLOAT(p, s) \
-        ((s == sizeof (float))?        \
-               NaF (*(float *) p) :    \
-               NaD (*(double *) p))
-#endif /* INVALID_FLOAT */
-#endif
-
 /* Say how long (ordinary) registers are.  This is a piece of bogosity
    used in push_word and a few other places; REGISTER_RAW_SIZE is the
    real way to know how big a register is.  */
index 65f8d7048ea472c7842639ff5613f387e8135cd8..0fe507facff1e96f506663719f66265fcf32e4cf 100644 (file)
@@ -65,11 +65,6 @@ extern CORE_ADDR vax_skip_prologue (CORE_ADDR);
 
 #define DECR_PC_AFTER_BREAK 0
 
-/* Return 1 if P points to an invalid floating point value.
-   LEN is the length in bytes -- not relevant on the Vax.  */
-
-#define INVALID_FLOAT(p, len) ((*(short *) p & 0xff80) == 0x8000)
-
 /* Say how long (ordinary) registers are.  This is a piece of bogosity
    used in push_word and a few other places; REGISTER_RAW_SIZE is the
    real way to know how big a register is.  */
index 5b8d1f21fd83704868a7d6cf06bdc9b9ff672e5b..d5e18eccafd6ef89687014e7d55b370471ae1919 100644 (file)
@@ -1613,13 +1613,8 @@ do_registers_info (int regnum, int fpregs)
        {
          register int j;
 
-#ifdef INVALID_FLOAT
-         if (INVALID_FLOAT (virtual_buffer, REGISTER_VIRTUAL_SIZE (i)))
-           printf_filtered ("<invalid float>");
-         else
-#endif
-           val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
-                      gdb_stdout, 0, 1, 0, Val_pretty_default);
+         val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
+                    gdb_stdout, 0, 1, 0, Val_pretty_default);
 
          printf_filtered ("\t(raw 0x");
          for (j = 0; j < REGISTER_RAW_SIZE (i); j++)
index 29180c3606f16ccdef9ae93f95448089f3d506f7..be8c5956c63664be2ba17c8e8e942bff270d3df7 100644 (file)
@@ -1763,13 +1763,8 @@ rs6000_do_registers_info (int regnum, int fpregs)
         {
           register int j;
 
-#ifdef INVALID_FLOAT
-          if (INVALID_FLOAT (virtual_buffer, REGISTER_VIRTUAL_SIZE (i)))
-            printf_filtered ("<invalid float>");
-          else
-#endif
-            val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
-                       gdb_stdout, 0, 1, 0, Val_pretty_default);
+         val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
+                    gdb_stdout, 0, 1, 0, Val_pretty_default);
 
           printf_filtered ("\t(raw 0x");
           for (j = 0; j < REGISTER_RAW_SIZE (i); j++)
index 68230e621edc7530d2e37e18d24dd62d1f89eeef..9445d9c456116d3c4b36614b43182afa2324dc5e 100644 (file)
@@ -742,13 +742,22 @@ unpack_double (struct type *type, char *valaddr, int *invp)
   nosign = TYPE_UNSIGNED (type);
   if (code == TYPE_CODE_FLT)
     {
-#ifdef INVALID_FLOAT
-      if (INVALID_FLOAT (valaddr, len))
-       {
-         *invp = 1;
-         return 1.234567891011121314;
-       }
-#endif
+      /* NOTE: cagney/2002-02-19: There was a test here to see if the
+        floating-point value was valid (using the macro
+        INVALID_FLOAT).  That test/macro have been removed.
+
+        It turns out that only the VAX defined this macro and then
+        only in a non-portable way.  Fixing the portability problem
+        wouldn't help since the VAX floating-point code is also badly
+        bit-rotten.  The target needs to add definitions for the
+        methods TARGET_FLOAT_FORMAT and TARGET_DOUBLE_FORMAT - these
+        exactly describe the target floating-point format.  The
+        problem here is that the corresponding floatformat_vax_f and
+        floatformat_vax_d values these methods should be set to are
+        also not defined either.  Oops!
+
+         Hopefully someone will add both the missing floatformat
+         definitions and floatformat_is_invalid() function.  */
       return extract_typed_floating (valaddr, type);
     }
   else if (nosign)
index 9a53df0b711bf3616f0f665a1fd408c2d48fe190..a5fbe3a9d7227cf41f2c43a4bd2016298950ce52 100644 (file)
 #include "frame.h"
 #include "value.h"
 
+/* Return 1 if P points to an invalid floating point value.
+   LEN is the length in bytes -- not relevant on the Vax.  */
+
+/* FIXME: cagney/2002-01-19: The macro below was originally defined in
+   tm-vax.h and used in values.c.  Two problems.  Firstly this is a
+   very non-portable and secondly it is wrong.  The VAX should be
+   using floatformat and associated methods to identify and handle
+   invalid floating-point values.  Adding to the poor target's woes
+   there is no floatformat_vax_{f,d} and no TARGET_FLOAT_FORMAT
+   et.al..  */
+
+/* FIXME: cagney/2002-01-19: It turns out that the only thing that
+   uses this macro is the vax disassembler code (so how old is this
+   target?).  This target should instead be using the opcodes
+   disassembler.  That allowing the macro to be eliminated.  */
+
+#define INVALID_FLOAT(p, len) ((*(short *) p & 0xff80) == 0x8000)
+
 /* Vax instructions are never longer than this.  */
 #define MAXLEN 62