From c6d8db406c2feb5b7482347df566b708d911e734 Mon Sep 17 00:00:00 2001 From: John Gilmore Date: Tue, 11 Jan 1994 09:13:25 +0000 Subject: [PATCH] [Revise prev change -- this is how it's been running at Adobe, and it works there.] * sparc-tdep.c (sparc_pop_frame): Pop the fsr and csr (float and coprocessor status regs) when popping a frame. This fixes float exceptions that occur after calling inferior functions. * sparc-nat.c (fetch_inferior_registers, store_inferior_registers): Read and write the fsr (float status register) to/from the child process along with the float regs. Remove Peter Schauer's change of May 24 '93, which has higher overhead and doesn't solve the real problem (which was that FSR wasn't being set). --- gdb/ChangeLog | 10 +++++++--- gdb/sparc-nat.c | 10 ---------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2303918173b..cd947ff0722 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,10 +1,14 @@ Tue Jan 11 00:53:46 1994 John Gilmore (gnu@cygnus.com) + * sparc-tdep.c (sparc_pop_frame): Pop the fsr and csr (float and + coprocessor status regs) when popping a frame. This fixes + float exceptions that occur after calling inferior functions. + * 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). + process along with the float regs. Remove Peter Schauer's change + of May 24 '93, which has higher overhead and doesn't solve the + real problem (which was that FSR wasn't being set). Mon Jan 10 23:16:42 1994 John Gilmore (gnu@cygnus.com) diff --git a/gdb/sparc-nat.c b/gdb/sparc-nat.c index 5fcdb92aad2..735f3db8104 100644 --- a/gdb/sparc-nat.c +++ b/gdb/sparc-nat.c @@ -222,20 +222,10 @@ store_inferior_registers (regno) if (wanna_store & FP_REGS) { if (!register_valid[FP0_REGNUM+9]) abort(); - /* Initialize inferior_fp_registers members that gdb doesn't set - 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, ®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