aboutsummaryrefslogtreecommitdiff
path: root/gdb/sun3-nat.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2000-05-10 17:38:16 +0000
committerMichael Snyder <msnyder@vmware.com>2000-05-10 17:38:16 +0000
commit60054393321258d1acc88f65169fb60589cb4b41 (patch)
tree2e14d4aa8da30649e52937f14b5da33bcc4f42e5 /gdb/sun3-nat.c
parent598ca718d00001789f64d2669c56f87acea2b3ca (diff)
downloadgdb-60054393321258d1acc88f65169fb60589cb4b41.zip
gdb-60054393321258d1acc88f65169fb60589cb4b41.tar.gz
gdb-60054393321258d1acc88f65169fb60589cb4b41.tar.bz2
2000-05-08 Michael Snyder <msnyder@seadog.cygnus.com>
* gdbarch.sh: Add FP0_REGNUM to list of multi-arched register numbers. * gdbarch.c, gdbarch.h: Regenerate. * core-regset.c: Change FP0_REGNUM to a runtime test. * procfs.c: Ditto. * sun3-nat.c: Ditto. * sparc-tdep.c: Ditto. * i386mach-nat.c: Remove unnecessary ifdef for FP0_REGNUM. * ptx4-nat.c: Ditto. * sol-thread.c (sol_thread_create_inferior): only add the thread to the thread list if it is not already in there. (prototypes for thread_db func ptrs): pretty up formatting.
Diffstat (limited to 'gdb/sun3-nat.c')
-rw-r--r--gdb/sun3-nat.c77
1 files changed, 37 insertions, 40 deletions
diff --git a/gdb/sun3-nat.c b/gdb/sun3-nat.c
index 1e878ca..8e5e16f 100644
--- a/gdb/sun3-nat.c
+++ b/gdb/sun3-nat.c
@@ -33,31 +33,29 @@ fetch_inferior_registers (regno)
int regno;
{
struct regs inferior_registers;
-#ifdef FP0_REGNUM
struct fp_status inferior_fp_registers;
-#endif
registers_fetched ();
ptrace (PTRACE_GETREGS, inferior_pid,
(PTRACE_ARG3_TYPE) & inferior_registers);
-#ifdef FP0_REGNUM
- ptrace (PTRACE_GETFPREGS, inferior_pid,
- (PTRACE_ARG3_TYPE) & inferior_fp_registers);
-#endif
+
+ if (FP0_REGNUM >= 0)
+ ptrace (PTRACE_GETFPREGS, inferior_pid,
+ (PTRACE_ARG3_TYPE) & inferior_fp_registers);
memcpy (registers, &inferior_registers, 16 * 4);
-#ifdef FP0_REGNUM
- memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers,
- sizeof inferior_fp_registers.fps_regs);
-#endif
+ if (FP0_REGNUM >= 0)
+ memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers,
+ sizeof inferior_fp_registers.fps_regs);
+
*(int *) &registers[REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps;
*(int *) &registers[REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc;
-#ifdef FP0_REGNUM
- memcpy (&registers[REGISTER_BYTE (FPC_REGNUM)],
- &inferior_fp_registers.fps_control,
- sizeof inferior_fp_registers - sizeof inferior_fp_registers.fps_regs);
-#endif
+ if (FP0_REGNUM >= 0)
+ memcpy (&registers[REGISTER_BYTE (FPC_REGNUM)],
+ &inferior_fp_registers.fps_control,
+ sizeof inferior_fp_registers -
+ sizeof inferior_fp_registers.fps_regs);
}
/* Store our register values back into the inferior.
@@ -69,30 +67,27 @@ store_inferior_registers (regno)
int regno;
{
struct regs inferior_registers;
-#ifdef FP0_REGNUM
struct fp_status inferior_fp_registers;
-#endif
memcpy (&inferior_registers, registers, 16 * 4);
-#ifdef FP0_REGNUM
- memcpy (&inferior_fp_registers, &registers[REGISTER_BYTE (FP0_REGNUM)],
- sizeof inferior_fp_registers.fps_regs);
-#endif
+ if (FP0_REGNUM >= 0)
+ memcpy (&inferior_fp_registers, &registers[REGISTER_BYTE (FP0_REGNUM)],
+ sizeof inferior_fp_registers.fps_regs);
+
inferior_registers.r_ps = *(int *) &registers[REGISTER_BYTE (PS_REGNUM)];
inferior_registers.r_pc = *(int *) &registers[REGISTER_BYTE (PC_REGNUM)];
-#ifdef FP0_REGNUM
- memcpy (&inferior_fp_registers.fps_control,
- &registers[REGISTER_BYTE (FPC_REGNUM)],
- sizeof inferior_fp_registers - sizeof inferior_fp_registers.fps_regs);
-#endif
+ if (FP0_REGNUM >= 0)
+ memcpy (&inferior_fp_registers.fps_control,
+ &registers[REGISTER_BYTE (FPC_REGNUM)],
+ sizeof inferior_fp_registers -
+ sizeof inferior_fp_registers.fps_regs);
ptrace (PTRACE_SETREGS, inferior_pid,
(PTRACE_ARG3_TYPE) & inferior_registers);
-#if FP0_REGNUM
- ptrace (PTRACE_SETFPREGS, inferior_pid,
- (PTRACE_ARG3_TYPE) & inferior_fp_registers);
-#endif
+ if (FP0_REGNUM >= 0)
+ ptrace (PTRACE_SETFPREGS, inferior_pid,
+ (PTRACE_ARG3_TYPE) & inferior_fp_registers);
}
@@ -125,18 +120,20 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
if (core_reg_size >= sizeof (struct fpu))
{
-#ifdef FP0_REGNUM
- memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)],
- fpustruct->f_fpstatus.fps_regs,
- sizeof fpustruct->f_fpstatus.fps_regs);
- memcpy (&registers[REGISTER_BYTE (FPC_REGNUM)],
- &fpustruct->f_fpstatus.fps_control,
- sizeof fpustruct->f_fpstatus -
- sizeof fpustruct->f_fpstatus.fps_regs);
-#endif
+ if (FP0_REGNUM >= 0)
+ {
+ memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)],
+ fpustruct->f_fpstatus.fps_regs,
+ sizeof fpustruct->f_fpstatus.fps_regs);
+ memcpy (&registers[REGISTER_BYTE (FPC_REGNUM)],
+ &fpustruct->f_fpstatus.fps_control,
+ sizeof fpustruct->f_fpstatus -
+ sizeof fpustruct->f_fpstatus.fps_regs);
+ }
}
else
- fprintf_unfiltered (gdb_stderr, "Couldn't read float regs from core file\n");
+ fprintf_unfiltered (gdb_stderr,
+ "Couldn't read float regs from core file\n");
}
}