From c369b6a32f2d629c4ed70850adf20ec4057e84f5 Mon Sep 17 00:00:00 2001 From: John Gilmore Date: Tue, 11 Jan 1994 08:59:41 +0000 Subject: [PATCH] * sparc-nat.c (fetch_inferior_registers, store_inferior_registers): Read and write the fsr (float status register) to/from the child process. This avoids random float exceptions when running under GDB, and probably obsoletes Peter Schauer's change of May 24 '93 (which remains for safety). --- gdb/ChangeLog | 8 ++++++++ gdb/sparc-nat.c | 12 +++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1a06726878e..2303918173b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +Tue Jan 11 00:53:46 1994 John Gilmore (gnu@cygnus.com) + + * sparc-nat.c (fetch_inferior_registers, store_inferior_registers): + Read and write the fsr (float status register) to/from the child + process. This avoids random float exceptions when running under + GDB, and probably obsoletes Peter Schauer's change of May 24 '93 + (which remains for safety). + Mon Jan 10 23:16:42 1994 John Gilmore (gnu@cygnus.com) * a29k-tdep.c (examine_prologue): Don't worry if the ASGEQ diff --git a/gdb/sparc-nat.c b/gdb/sparc-nat.c index e1f0235f675..5fcdb92aad2 100644 --- a/gdb/sparc-nat.c +++ b/gdb/sparc-nat.c @@ -98,9 +98,9 @@ fetch_inferior_registers (regno) perror("ptrace_getfpregs"); memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers, sizeof inferior_fp_registers.fpu_fr); - /* memcpy (®isters[REGISTER_BYTE (FPS_REGNUM)], + memcpy (®isters[REGISTER_BYTE (FPS_REGNUM)], &inferior_fp_registers.Fpu_fsr, - sizeof (FPU_FSR_TYPE)); FIXME??? -- gnu@cyg */ + sizeof (FPU_FSR_TYPE)); for (i = FP0_REGNUM; i <= FP0_REGNUM+31; i++) register_valid[i] = 1; register_valid[FPS_REGNUM] = 1; @@ -223,17 +223,19 @@ store_inferior_registers (regno) { if (!register_valid[FP0_REGNUM+9]) abort(); /* Initialize inferior_fp_registers members that gdb doesn't set - by reading them from the inferior. */ + by reading them from the inferior. This may not be needed + any more, now that we set Fpu_fsr. */ if (0 != ptrace (PTRACE_GETFPREGS, inferior_pid, (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0)) perror("ptrace_getfpregs"); + memcpy (&inferior_fp_registers, ®isters[REGISTER_BYTE (FP0_REGNUM)], sizeof inferior_fp_registers.fpu_fr); -/* memcpy (&inferior_fp_registers.Fpu_fsr, + memcpy (&inferior_fp_registers.Fpu_fsr, ®isters[REGISTER_BYTE (FPS_REGNUM)], sizeof (FPU_FSR_TYPE)); -****/ + if (0 != ptrace (PTRACE_SETFPREGS, inferior_pid, (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0)) -- 2.30.2