-/* Functions specific to running gdb native on a Sun 4 running sunos4.
- Copyright (C) 1989, 1992, Free Software Foundation, Inc.
+/* Functions specific to running gdb native on a SPARC running SunOS4.
+ Copyright 1989, 1992, 1993, 1994 Free Software Foundation, Inc.
This file is part of GDB.
all the regs every time it is called! FIXME. */
register_valid[WIM_REGNUM] = 1; /* Not true yet, FIXME */
register_valid[TBR_REGNUM] = 1; /* Not true yet, FIXME */
- register_valid[FPS_REGNUM] = 1; /* Not true yet, FIXME */
register_valid[CPS_REGNUM] = 1; /* Not true yet, FIXME */
}
/* Floating point registers */
- if (regno == -1 || (regno >= FP0_REGNUM && regno <= FP0_REGNUM + 31))
+ if (regno == -1 ||
+ regno == FPS_REGNUM ||
+ (regno >= FP0_REGNUM && regno <= FP0_REGNUM + 31))
{
if (0 != ptrace (PTRACE_GETFPREGS, inferior_pid,
(PTRACE_ARG3_TYPE) &inferior_fp_registers,
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;
CORE_ADDR sp = *(CORE_ADDR*)®isters[REGISTER_BYTE (SP_REGNUM)];
i = REGISTER_BYTE (regno);
if (register_valid[regno])
- printf("register %d valid and read\n", regno);
+ printf_unfiltered("register %d valid and read\n", regno);
target_xfer_memory (sp + i - REGISTER_BYTE (L0_REGNUM),
®isters[i], REGISTER_RAW_SIZE (regno), 0);
register_valid[regno] = 1;
wanna_store = INT_REGS + STACK_REGS;
else if (regno < L0_REGNUM || regno > I7_REGNUM)
wanna_store = INT_REGS;
+ else if (regno == FPS_REGNUM)
+ wanna_store = FP_REGS;
else
wanna_store = STACK_REGS;
}
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. */
- 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))
if (0 != target_read_memory (sp, ®isters[REGISTER_BYTE (L0_REGNUM)],
16 * REGISTER_RAW_SIZE (L0_REGNUM)))
{
- /* fprintf so user can still use gdb */
- fprintf (stderr,
+ /* fprintf_unfiltered so user can still use gdb */
+ fprintf_unfiltered (gdb_stderr,
"Couldn't read input and local registers from core file\n");
}
}
sizeof (FPU_FSR_TYPE));
}
else
- fprintf (stderr, "Couldn't read float regs from core file\n");
+ fprintf_unfiltered (gdb_stderr, "Couldn't read float regs from core file\n");
}
}