aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@cygnus>1994-07-13 22:38:03 +0000
committerKen Raeburn <raeburn@cygnus>1994-07-13 22:38:03 +0000
commit60a70a7b0ebe4e30a99f1a3154ff445c5926b834 (patch)
tree56e34b7cc701b0b9aa6fd71745797bbe2b385cc3
parent69bb683c6d92c902ab614222712d4716c15e7758 (diff)
downloadgdb-60a70a7b0ebe4e30a99f1a3154ff445c5926b834.zip
gdb-60a70a7b0ebe4e30a99f1a3154ff445c5926b834.tar.gz
gdb-60a70a7b0ebe4e30a99f1a3154ff445c5926b834.tar.bz2
ns32k-dis.c (invalid_float): Changed to take char* argument, and test for
explicitly specified sizes, instead of using sizeof() on host CPU types. (INVALID_FLOAT): Cast first argument.
-rw-r--r--opcodes/ChangeLog5
-rw-r--r--opcodes/ns32k-dis.c22
2 files changed, 15 insertions, 12 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 0cb8a6d..abaa9a2 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -2,7 +2,10 @@ Wed Jul 13 18:01:58 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
* ns32k-dis.c: Deleted all code in "#ifdef GDB".
(invalid_float): Enabled general version, doesn't require running
- on ns32k host.
+ on ns32k host. Changed to take char* argument, and test for
+ explicitly specified sizes, instead of using sizeof() on host CPU
+ types.
+ (INVALID_FLOAT): Cast first argument.
Sun Jul 10 00:27:47 1994 Ian Dall (dall@hfrd.dsto.gov.au)
diff --git a/opcodes/ns32k-dis.c b/opcodes/ns32k-dis.c
index 1cacee4..808fdd2 100644
--- a/opcodes/ns32k-dis.c
+++ b/opcodes/ns32k-dis.c
@@ -32,7 +32,7 @@ static disassemble_info *dis_info;
* Hacks to get it to compile <= READ THESE AS FIXES NEEDED
*/
#define CORE_ADDR unsigned long
-#define INVALID_FLOAT(val, size) invalid_float(val, size)
+#define INVALID_FLOAT(val, size) invalid_float((char *)val, size)
static long read_memory_integer(addr, nr)
unsigned char *addr;
@@ -801,20 +801,20 @@ get_displacement (buffer, aoffsetp)
#if 1 /* a version that should work on ns32k f's&d's on any machine */
int invalid_float(p, len)
- register union { double d; float f; } *p;
+ register char *p;
register int len;
{
register val;
- if ( len == sizeof (float) )
- val = (bit_extract(&p.f, 23, 8)/*exponent*/ == 0xff
- || (bit_extract(&p, 23, 8)/*exponent*/ == 0 &&
- bit_extract(&p, 0, 23)/*mantisa*/ != 0));
- else if ( len == sizeof (double) )
- val = (bit_extract(&p.d, 52, 11)/*exponent*/ == 0x7ff
- || (bit_extract(&p, 52, 11)/*exponent*/ == 0
- && (bit_extract(&p, 0, 32)/*low mantisa*/ != 0
- || bit_extract(&p, 32, 20)/*high mantisa*/ != 0)));
+ if ( len == 4 )
+ val = (bit_extract(p, 23, 8)/*exponent*/ == 0xff
+ || (bit_extract(p, 23, 8)/*exponent*/ == 0 &&
+ bit_extract(p, 0, 23)/*mantisa*/ != 0));
+ else if ( len == 8 )
+ val = (bit_extract(p, 52, 11)/*exponent*/ == 0x7ff
+ || (bit_extract(p, 52, 11)/*exponent*/ == 0
+ && (bit_extract(p, 0, 32)/*low mantisa*/ != 0
+ || bit_extract(p, 32, 20)/*high mantisa*/ != 0)));
else
val = 1;
return (val);