* 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.
This commit is contained in:
Andrew Cagney 2002-01-29 03:08:28 +00:00
parent 806dedcd0c
commit 75bc7ddf1b
7 changed files with 51 additions and 41 deletions

View 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.

View 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. */

View 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. */

View 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++)

View 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++)

View 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)

View File

@ -26,6 +26,24 @@
#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