aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote-nindy.c
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1993-10-29 18:16:33 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1993-10-29 18:16:33 +0000
commitbf5c0d644899aa224fcac5eb0b5dff2002d6448c (patch)
treec10acbcabf8139066784b8d7f465617b458dee71 /gdb/remote-nindy.c
parente1ec9f078ff7293455d25741056f3fa633deaebf (diff)
downloadgdb-bf5c0d644899aa224fcac5eb0b5dff2002d6448c.zip
gdb-bf5c0d644899aa224fcac5eb0b5dff2002d6448c.tar.gz
gdb-bf5c0d644899aa224fcac5eb0b5dff2002d6448c.tar.bz2
* defs.h, findvar.c (extract_floating, store_floating): New functions.
* Move SWAP_TARGET_AND_HOST from defs.h to findvar.c because it is now used only by extract_floating and store_floating. * valprint.c (print_floating): Use unsigned arithmetic. Use extract_unsigned_integer instead of SWAP_TARGET_AND_HOST. Change sizeof (float) to 4 and sizeof (double) to 8 (those are always the relevant sizes for this code, which is in #ifdef IEEE_FLOAT). * values.c (unpack_long, unpack_double, value_from_double), valarith.c (value_binop), stabsread.c (define_symbol): Use extract_floating and store_floating instead of SWAP_TARGET_AND_HOST. * config/m68k/tm-m68k.h, config/i960/tm-i960.h (REGISTER_CONVERT_*): Use extract_floating and store_floating. * config/m88k/tm-m88k.h: Add comments (it should be doing the same). * i386-tdep.c (i386_extract_return_value), * remote-nindy.c (nindy_store_registers): Use store_floating.
Diffstat (limited to 'gdb/remote-nindy.c')
-rw-r--r--gdb/remote-nindy.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/gdb/remote-nindy.c b/gdb/remote-nindy.c
index 72dcfdd..4050ff4 100644
--- a/gdb/remote-nindy.c
+++ b/gdb/remote-nindy.c
@@ -472,7 +472,7 @@ nindy_store_registers(regno)
int regno;
{
struct nindy_regs nindy_regs;
- int regnum, inv;
+ int regnum;
double dub;
memcpy (nindy_regs.local_regs, &registers[REGISTER_BYTE (R0_REGNUM)], 16*4);
@@ -480,18 +480,14 @@ nindy_store_registers(regno)
memcpy (nindy_regs.pcw_acw, &registers[REGISTER_BYTE (PCW_REGNUM)], 2*4);
memcpy (nindy_regs.ip, &registers[REGISTER_BYTE (IP_REGNUM)], 1*4);
memcpy (nindy_regs.tcw, &registers[REGISTER_BYTE (TCW_REGNUM)], 1*4);
- /* Float regs. Only works on IEEE_FLOAT hosts. FIXME! */
- for (regnum = FP0_REGNUM; regnum < FP0_REGNUM + 4; regnum++) {
- ieee_extended_to_double (&ext_format_i960,
- &registers[REGISTER_BYTE (regnum)], &dub);
- /* dub now in host byte order */
- /* FIXME-someday, the arguments to unpack_double are backward.
- It expects a target double and returns a host; we pass the opposite.
- This mostly works but not quite. */
- dub = unpack_double (builtin_type_double, (char *)&dub, &inv);
- /* dub now in target byte order */
- memcpy (&nindy_regs.fp_as_double[8 * (regnum - FP0_REGNUM)], &dub, 8);
- }
+ for (regnum = FP0_REGNUM; regnum < FP0_REGNUM + 4; regnum++)
+ {
+ ieee_extended_to_double (&ext_format_i960,
+ &registers[REGISTER_BYTE (regnum)], &dub);
+ store_floating (&nindy_regs.fp_as_double[8 * (regnum - FP0_REGNUM)],
+ REGISTER_VIRTUAL_SIZE (regnum),
+ dub);
+ }
immediate_quit++;
ninRegsPut( (char *) &nindy_regs );