typedef struct fpreg fpregset_t;
#endif
+#include "gregset.h"
+\f
+
/* In older BSD versions we cannot get at some of the segment
registers. FreeBSD for example didn't support the %fs and %gs
registers until the 3.0 release. We have autoconf checks for their
/* Registers we shouldn't try to store. */
#if !defined (CANNOT_STORE_REGISTER)
-#define CANNOT_STORE_REGISTER(regno) CANNOT_FETCH_REGISTER (regno)
+#define CANNOT_STORE_REGISTER(regno) cannot_fetch_register (regno)
#endif
/* Offset to the gregset_t location where REG is stored. */
REG_OFFSET (r_ss),
REG_OFFSET (r_ds),
REG_OFFSET (r_es),
-#ifdef HAVE_R_FS
+#ifdef HAVE_STRUCT_REG_R_FS
REG_OFFSET (r_fs),
#else
-1,
#endif
-#ifdef HAVE_R_GS
+#ifdef HAVE_STRUCT_REG_R_GS
REG_OFFSET (r_gs)
#else
-1
/* Transfering the registers between GDB, inferiors and core files. */
-/* Fill GDB's register array with the genereal-purpose register values
+/* Fill GDB's register array with the general-purpose register values
in *GREGSETP. */
void
supply_gregset (gregset_t *gregsetp)
{
- char buf[MAX_REGISTER_RAW_SIZE];
int i;
for (i = 0; i < NUM_GREGS; i++)
{
if (CANNOT_FETCH_REGISTER (i))
- {
- memset (buf, 0, REGISTER_RAW_SIZE (i));
- supply_register (i, buf);
- }
+ supply_register (i, NULL);
else
supply_register (i, REG_ADDR (gregsetp, i));
}
for (i = 0; i < NUM_GREGS; i++)
if ((regno == -1 || regno == i) && ! CANNOT_STORE_REGISTER (i))
- memcpy (REG_ADDR (gregsetp, i), ®isters[REGISTER_BYTE (regno)],
+ memcpy (REG_ADDR (gregsetp, i), ®isters[REGISTER_BYTE (i)],
REGISTER_RAW_SIZE (i));
}
supply_fpregset (&fpregs);
}
-}
+}
/* Store register REGNO back into the inferior. If REGNO is -1, do
this for all registers (including the floating point registers). */