* hppa-tdep.c (pa_print_registers), monitor.c: Use
extract_unsigned_integer and friends, not SWAP_TARGET_AND_HOST. * defs.h, findvar.c: Move SWAP_TARGET_AND_HOST back to findvar.c. Rename it to SWAP_FLOATING to make it clear it is no longer for integers.
This commit is contained in:
parent
66aa7cf935
commit
bc28e68dad
3 changed files with 34 additions and 8 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
Tue Feb 28 22:55:47 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
|
||||||
|
|
||||||
|
* hppa-tdep.c (pa_print_registers), monitor.c: Use
|
||||||
|
extract_unsigned_integer and friends, not SWAP_TARGET_AND_HOST.
|
||||||
|
* defs.h, findvar.c: Move SWAP_TARGET_AND_HOST back to findvar.c.
|
||||||
|
Rename it to SWAP_FLOATING to make it clear it is no longer for
|
||||||
|
integers.
|
||||||
|
|
||||||
Tue Feb 28 14:38:39 1995 Kung Hsu <kung@mexican.cygnus.com>
|
Tue Feb 28 14:38:39 1995 Kung Hsu <kung@mexican.cygnus.com>
|
||||||
|
|
||||||
* defs.h (SWAP_TARGET_AND_HOST): check endianess at runtime not
|
* defs.h (SWAP_TARGET_AND_HOST): check endianess at runtime not
|
||||||
|
|
|
@ -187,9 +187,27 @@ store_address (addr, len, val)
|
||||||
store_unsigned_integer (addr, len, (LONGEST)val);
|
store_unsigned_integer (addr, len, (LONGEST)val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Swap LEN bytes at BUFFER between target and host byte-order. */
|
||||||
|
#define SWAP_FLOATING(buffer,len) \
|
||||||
|
do \
|
||||||
|
{ \
|
||||||
|
if (TARGET_BYTE_ORDER != HOST_BYTE_ORDER) \
|
||||||
|
{ \
|
||||||
|
char tmp; \
|
||||||
|
char *p = (char *)(buffer); \
|
||||||
|
char *q = ((char *)(buffer)) + len - 1; \
|
||||||
|
for (; p < q; p++, q--) \
|
||||||
|
{ \
|
||||||
|
tmp = *q; \
|
||||||
|
*q = *p; \
|
||||||
|
*p = tmp; \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
while (0)
|
||||||
|
|
||||||
/* There are many problems with floating point cross-debugging
|
/* There are various problems with the extract_floating and store_floating
|
||||||
in macro SWAP_TARGET_AND_HOST().
|
routines.
|
||||||
|
|
||||||
1. These routines only handle byte-swapping, not conversion of
|
1. These routines only handle byte-swapping, not conversion of
|
||||||
formats. So if host is IEEE floating and target is VAX floating,
|
formats. So if host is IEEE floating and target is VAX floating,
|
||||||
|
@ -213,14 +231,14 @@ extract_floating (addr, len)
|
||||||
{
|
{
|
||||||
float retval;
|
float retval;
|
||||||
memcpy (&retval, addr, sizeof (retval));
|
memcpy (&retval, addr, sizeof (retval));
|
||||||
SWAP_TARGET_AND_HOST (&retval, sizeof (retval));
|
SWAP_FLOATING (&retval, sizeof (retval));
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
else if (len == sizeof (double))
|
else if (len == sizeof (double))
|
||||||
{
|
{
|
||||||
double retval;
|
double retval;
|
||||||
memcpy (&retval, addr, sizeof (retval));
|
memcpy (&retval, addr, sizeof (retval));
|
||||||
SWAP_TARGET_AND_HOST (&retval, sizeof (retval));
|
SWAP_FLOATING (&retval, sizeof (retval));
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -238,12 +256,12 @@ store_floating (addr, len, val)
|
||||||
if (len == sizeof (float))
|
if (len == sizeof (float))
|
||||||
{
|
{
|
||||||
float floatval = val;
|
float floatval = val;
|
||||||
SWAP_TARGET_AND_HOST (&floatval, sizeof (floatval));
|
SWAP_FLOATING (&floatval, sizeof (floatval));
|
||||||
memcpy (addr, &floatval, sizeof (floatval));
|
memcpy (addr, &floatval, sizeof (floatval));
|
||||||
}
|
}
|
||||||
else if (len == sizeof (double))
|
else if (len == sizeof (double))
|
||||||
{
|
{
|
||||||
SWAP_TARGET_AND_HOST (&val, sizeof (val));
|
SWAP_FLOATING (&val, sizeof (val));
|
||||||
memcpy (addr, &val, sizeof (val));
|
memcpy (addr, &val, sizeof (val));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -1652,8 +1652,8 @@ pa_print_registers (raw_regs, regnum, fpregs)
|
||||||
{
|
{
|
||||||
for (j = 0; j < 4; j++)
|
for (j = 0; j < 4; j++)
|
||||||
{
|
{
|
||||||
val = *(int *)(raw_regs + REGISTER_BYTE (i+(j*18)));
|
val =
|
||||||
SWAP_TARGET_AND_HOST (&val, 4);
|
extract_signed_integer (raw_regs + REGISTER_BYTE (i+(j*18)), 4);
|
||||||
printf_unfiltered ("%8.8s: %8x ", reg_names[i+(j*18)], val);
|
printf_unfiltered ("%8.8s: %8x ", reg_names[i+(j*18)], val);
|
||||||
}
|
}
|
||||||
printf_unfiltered ("\n");
|
printf_unfiltered ("\n");
|
||||||
|
|
Loading…
Add table
Reference in a new issue