* i387-tdep.c (i387_supply_fsave, i387_supply_fxsave): Add

regcache argument and reverse the order of the other two
arguments.  Remove local regcache variable.  Determine
architecture from REGCACHE.  Update comments.
* x86-64-tdep.c (x86_64_supply_fxsave): Add regcache argument and
reverse the order of the other two arguments.  Remove local
regcache variable.  Determine architecture from REGCACHE.  Update
comments.
* i387-tdep.h (i387_supply_fsave, i387_supply_fxsave): Adjust
prototypes.  Update comments.
* x86-64-tdep.c (x86_64_supply_fxsave): Adjust prototype.  Adjust
comment.
* amd64fbsd-nat.c (supply_fpregset, fetch_inferior_registers):
Update.
* go32-nat.c (fetch_register, go32_fetch_registers): Update.
* i386-interix-nat.c (supply_fpregset): Update.
* i386-linux-nat.c (supply_fpregset, supply_fpxregset): Update.
* i386-nto-tdep.c (i386nto_supply_fpregset): Update.
* i386gnu-nat.c (fetch_fpregs, supply_fpregset): Update.
* i386bsd-nat.c (supply_fpregset, fetch_inferior_registers): Update.
* i386nbsd-tdep.c (fetch_core_registers, fetch_elfcore_registers):
Update.
* i386obsd-tdep.c (fetch_core_registers): Update.
* i386v4-nat.c (supply_fpregset): Update.
* x86-64-linux-nat.c (supply_fpregset): Update.
* x86-64-linux-tdep.c (fetch_core_registers): Update.
This commit is contained in:
Mark Kettenis 2003-09-28 13:35:44 +00:00
parent 84138122ac
commit 41d041d671
17 changed files with 87 additions and 46 deletions

View File

@ -1,3 +1,32 @@
2003-09-28 Mark Kettenis <kettenis@gnu.org>
* i387-tdep.c (i387_supply_fsave, i387_supply_fxsave): Add
regcache argument and reverse the order of the other two
arguments. Remove local regcache variable. Determine
architecture from REGCACHE. Update comments.
* x86-64-tdep.c (x86_64_supply_fxsave): Add regcache argument and
reverse the order of the other two arguments. Remove local
regcache variable. Determine architecture from REGCACHE. Update
comments.
* i387-tdep.h (i387_supply_fsave, i387_supply_fxsave): Adjust
prototypes. Update comments.
* x86-64-tdep.c (x86_64_supply_fxsave): Adjust prototype. Adjust
comment.
* amd64fbsd-nat.c (supply_fpregset, fetch_inferior_registers):
Update.
* go32-nat.c (fetch_register, go32_fetch_registers): Update.
* i386-interix-nat.c (supply_fpregset): Update.
* i386-linux-nat.c (supply_fpregset, supply_fpxregset): Update.
* i386-nto-tdep.c (i386nto_supply_fpregset): Update.
* i386gnu-nat.c (fetch_fpregs, supply_fpregset): Update.
* i386bsd-nat.c (supply_fpregset, fetch_inferior_registers): Update.
* i386nbsd-tdep.c (fetch_core_registers, fetch_elfcore_registers):
Update.
* i386obsd-tdep.c (fetch_core_registers): Update.
* i386v4-nat.c (supply_fpregset): Update.
* x86-64-linux-nat.c (supply_fpregset): Update.
* x86-64-linux-tdep.c (fetch_core_registers): Update.
2003-09-27 Mark Kettenis <kettenis@gnu.org>
* i386-tdep.h: Put opaque declarations in alphabetical

View File

@ -129,7 +129,7 @@ fill_gregset (gregset_t *gregsetp, int regnum)
void
supply_fpregset (fpregset_t *fpregsetp)
{
x86_64_supply_fxsave ((const char *) fpregsetp, -1);
x86_64_supply_fxsave (current_regcache, -1, fpregsetp);
}
/* Fill register REGNUM (if it is a floating-point register) in
@ -169,7 +169,7 @@ fetch_inferior_registers (int regnum)
(PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
perror_with_name ("Couldn't get floating point status");
x86_64_supply_fxsave ((const char *) &fpregs, -1);
x86_64_supply_fxsave (current_regcache, -1, &fpregs);
}
}

View File

@ -468,7 +468,7 @@ fetch_register (int regno)
if (regno < FP0_REGNUM)
supply_register (regno, (char *) &a_tss + regno_mapping[regno].tss_ofs);
else if (i386_fp_regnum_p (regno) || i386_fpc_regnum_p (regno))
i387_supply_fsave ((const char *) &npx, regno);
i387_supply_fsave (current_regcache, regno, &npx);
else
internal_error (__FILE__, __LINE__,
"Invalid register no. %d in fetch_register.", regno);
@ -483,7 +483,7 @@ go32_fetch_registers (int regno)
{
for (regno = 0; regno < FP0_REGNUM; regno++)
fetch_register (regno);
i387_supply_fsave ((const char *) &npx, -1);
i387_supply_fsave (current_regcache, -1, &npx);
}
}

View File

@ -80,7 +80,7 @@ fill_gregset (gregset_t *gregsetp, int regno)
void
supply_fpregset (fpregset_t *fpregsetp)
{
i387_supply_fsave ((const char *) fpregsetp, -1);
i387_supply_fsave (current_regcache, -1, fpregsetp);
}
/* Given a pointer to a floating point register set in (fpregset_t *)

View File

@ -320,7 +320,7 @@ static void store_regs (int tid, int regno) {}
void
supply_fpregset (elf_fpregset_t *fpregsetp)
{
i387_supply_fsave ((const char *) fpregsetp, -1);
i387_supply_fsave (current_regcache, -1, fpregsetp);
dummy_sse_values ();
}
@ -385,7 +385,7 @@ static void store_fpregs (int tid, int regno) {}
void
supply_fpxregset (elf_fpxregset_t *fpxregsetp)
{
i387_supply_fxsave ((const char *) fpxregsetp, -1);
i387_supply_fxsave (current_regcache, -1, fpxregsetp);
}
/* Fill register REGNO (if it is a floating-point or SSE register) in

View File

@ -87,9 +87,9 @@ static void
i386nto_supply_fpregset (char *fpregs)
{
if (nto_cpuinfo_valid && nto_cpuinfo_flags | X86_CPU_FXSR)
i387_supply_fxsave (fpregs, -1);
i387_supply_fxsave (current_regcache, -1, fpregs);
else
i387_supply_fsave (fpregs, -1);
i387_supply_fsave (current_regcache, -1, fpregs);
}
static void

View File

@ -157,7 +157,7 @@ fill_gregset (gregset_t *gregsetp, int regno)
void
supply_fpregset (fpregset_t *fpregsetp)
{
i387_supply_fsave ((const char *) fpregsetp, -1);
i387_supply_fsave (current_regcache, -1, fpregsetp);
}
/* Fill register REGNO (if it is a floating-point register) in
@ -200,7 +200,7 @@ fetch_inferior_registers (int regno)
(PTRACE_ARG3_TYPE) xmmregs, 0) == 0)
{
have_ptrace_xmmregs = 1;
i387_supply_fxsave (xmmregs, -1);
i387_supply_fxsave (current_regcache, -1, xmmregs);
}
else
{
@ -208,14 +208,14 @@ fetch_inferior_registers (int regno)
(PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
perror_with_name ("Couldn't get floating point status");
i387_supply_fsave ((const char *) &fpregs, -1);
i387_supply_fsave (current_regcache, -1, &fpregs);
}
#else
if (ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
(PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
perror_with_name ("Couldn't get floating point status");
i387_supply_fsave ((const char *) &fpregs, -1);
i387_supply_fsave (current_regcache, -1, &fpregs);
#endif
}
}

View File

@ -89,7 +89,7 @@ fetch_fpregs (struct proc *thread)
}
/* Supply the floating-point registers. */
i387_supply_fsave (state.hw_state, -1);
i387_supply_fsave (current_regcache, -1, state.hw_state);
}
#ifdef HAVE_SYS_PROCFS_H
@ -106,7 +106,7 @@ supply_gregset (gdb_gregset_t *gregs)
void
supply_fpregset (gdb_fpregset_t *fpregs)
{
i387_supply_fsave ((const char *) fpregs, -1);
i387_supply_fsave (current_regcache, -1, fpregs);
}
#endif

View File

@ -89,7 +89,7 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
i386nbsd_supply_reg (regs, -1);
/* Floating point registers. */
i387_supply_fsave (fsave, -1);
i387_supply_fsave (current_regcache, -1, fsave);
}
static void
@ -109,7 +109,7 @@ fetch_elfcore_registers (char *core_reg_sect, unsigned core_reg_size,
if (core_reg_size != 108)
warning ("Wrong size FP register set in core file.");
else
i387_supply_fsave (core_reg_sect, -1);
i387_supply_fsave (current_regcache, -1, core_reg_sect);
break;
case 3: /* "Extended" floating point registers. This is gdb-speak
@ -117,7 +117,7 @@ fetch_elfcore_registers (char *core_reg_sect, unsigned core_reg_size,
if (core_reg_size != 512)
warning ("Wrong size XMM register set in core file.");
else
i387_supply_fxsave (core_reg_sect, -1);
i387_supply_fxsave (current_regcache, -1, core_reg_sect);
break;
default:

View File

@ -66,7 +66,7 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
i386obsd_supply_reg (regs, -1);
/* Floating point registers. */
i387_supply_fsave (fsave, -1);
i387_supply_fsave (current_regcache, -1, fsave);
}
static struct core_fns i386obsd_core_fns =

View File

@ -139,7 +139,7 @@ supply_fpregset (fpregset_t *fpregsetp)
if (FP0_REGNUM == 0)
return;
i387_supply_fsave ((const char *) fpregsetp, -1);
i387_supply_fsave (current_regcache, -1, fpregsetp);
}
/* Fill register REGNO (if it is a floating-point register) in

View File

@ -378,15 +378,14 @@ static int fsave_offset[] =
(fsave + fsave_offset[regnum - I387_ST0_REGNUM])
/* Fill register REGNUM in GDB's register cache with the appropriate
value from *FSAVE. This function masks off any of the reserved
bits in *FSAVE. */
/* Fill register REGNUM in REGCACHE with the appropriate value from
*FSAVE. This function masks off any of the reserved bits in
*FSAVE. */
void
i387_supply_fsave (const void *fsave, int regnum)
i387_supply_fsave (struct regcache *regcache, int regnum, const void *fsave)
{
struct regcache *regcache = current_regcache;
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
struct gdbarch_tdep *tdep = gdbarch_tdep (get_regcache_arch (regcache));
const char *regs = fsave;
int i;
@ -524,15 +523,14 @@ static int fxsave_offset[] =
static int i387_tag (const unsigned char *raw);
/* Fill register REGNUM in GDB's register cache with the appropriate
/* Fill register REGNUM in REGCACHE with the appropriate
floating-point or SSE register value from *FXSAVE. This function
masks off any of the reserved bits in *FXSAVE. */
void
i387_supply_fxsave (const void *fxsave, int regnum)
i387_supply_fxsave (struct regcache *regcache, int regnum, const void *fxsave)
{
struct regcache *regcache = current_regcache;
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
struct gdbarch_tdep *tdep = gdbarch_tdep (get_regcache_arch (regcache));
const char *regs = fxsave;
int i;

View File

@ -23,9 +23,10 @@
#define I387_TDEP_H
struct gdbarch;
struct ui_file;
struct frame_info;
struct regcache;
struct type;
struct ui_file;
/* Because the number of general-purpose registers is different for
AMD64, the floating-point registers and SSE registers get shifted.
@ -73,11 +74,12 @@ extern void i387_value_to_register (struct frame_info *frame, int regnum,
#define I387_SIZEOF_FSAVE 108
#define I387_SIZEOF_FXSAVE 512
/* Fill register REGNUM in GDB's register cache with the appropriate
value from *FSAVE. This function masks off any of the reserved
bits in *FSAVE. */
/* Fill register REGNUM in REGCACHE with the appropriate value from
*FSAVE. This function masks off any of the reserved bits in
*FSAVE. */
extern void i387_supply_fsave (const void *fsave, int regnum);
extern void i387_supply_fsave (struct regcache *regcache, int regnum,
const void *fsave);
/* Fill register REGNUM (if it is a floating-point register) in *FSAVE
with the value in GDB's register cache. If REGNUM is -1, do this
@ -86,11 +88,12 @@ extern void i387_supply_fsave (const void *fsave, int regnum);
extern void i387_fill_fsave (void *fsave, int regnum);
/* Fill register REGNUM in GDB's register cache with the appropriate
/* Fill register REGNUM in REGCACHE with the appropriate
floating-point or SSE register value from *FXSAVE. This function
masks off any of the reserved bits in *FXSAVE. */
extern void i387_supply_fxsave (const void *fxsave, int regnum);
extern void i387_supply_fxsave (struct regcache *regcache, int regnum,
const void *fxsave);
/* Fill register REGNUM (if it is a floating-point or SSE register) in
*FXSAVE with the value in GDB's register cache. If REGNUM is -1, do

View File

@ -166,7 +166,7 @@ store_regs (int tid, int regnum)
void
supply_fpregset (elf_fpregset_t *fpregsetp)
{
x86_64_supply_fxsave ((const char *) fpregsetp, -1);
x86_64_supply_fxsave (current_regcache, -1, fpregsetp);
}
/* Fill register REGNUM (if it is a floating-point or SSE register) in

View File

@ -123,7 +123,7 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
if (core_reg_size != 512)
warning ("Wrong size XMM register set in core file.");
else
x86_64_supply_fxsave (core_reg_sect, -1);
x86_64_supply_fxsave (current_regcache, -1, core_reg_sect);
break;
default:

View File

@ -1289,22 +1289,32 @@ x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
bits of these pointers (instead of just the 16-bits of the segment
selector). */
/* Fill register REGNUM in GDB's register cache with the appropriate
/* The 64-bit FXSAVE format differs from the 32-bit format in the
sense that the instruction pointer and data pointer are simply
64-bit offsets into the code segment and the data segment instead
of a selector offset pair. The functions below store the upper 32
bits of these pointers (instead of just the 16-bits of the segment
selector). */
/* Fill register REGNUM in REGCACHE with the appropriate
floating-point or SSE register value from *FXSAVE. If REGNUM is
-1, do this for all registers. This function masks off any of the
reserved bits in *FXSAVE. */
void
x86_64_supply_fxsave (const char *fxsave, int regnum)
x86_64_supply_fxsave (struct regcache *regcache, int regnum,
const void *fxsave)
{
i387_supply_fxsave (fxsave, regnum);
i387_supply_fxsave (regcache, regnum, fxsave);
if (fxsave)
{
const char *regs = fxsave;
if (regnum == -1 || regnum == I387_FISEG_REGNUM)
supply_register (I387_FISEG_REGNUM, fxsave + 12);
regcache_raw_supply (regcache, I387_FISEG_REGNUM, regs + 12);
if (regnum == -1 || regnum == I387_FOSEG_REGNUM)
supply_register (I387_FOSEG_REGNUM, fxsave + 20);
regcache_raw_supply (regcache, I387_FOSEG_REGNUM, regs + 20);
}
}

View File

@ -48,12 +48,13 @@ struct frame_info;
void x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch);
/* Fill register REGNUM in GDB's register cache with the appropriate
/* Fill register REGNUM in REGCACHE with the appropriate
floating-point or SSE register value from *FXSAVE. If REGNUM is
-1, do this for all registers. This function masks off any of the
reserved bits in *FXSAVE. */
void x86_64_supply_fxsave (const char *fxsave, int regnum);
extern void x86_64_supply_fxsave (struct regcache *regcache, int regnum,
const void *fxsave);
/* Fill register REGNUM (if it is a floating-point or SSE register) in
*FXSAVE with the value in GDB's register cache. If REGNUM is -1, do