+2007-05-06 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * alpha-tdep.c (alpha_supply_int_regs, alpha_fill_int_regs,
+ alpha_supply_fp_regs, alpha_fill_fp_regs): Add REGCACHE parameter,
+ use it instead of current_regcache.
+ * alpha-tdep.h (struct regcache): Add forward declaration.
+ (alpha_supply_int_regs, alpha_fill_int_regs, alpha_supply_fp_regs,
+ alpha_fill_fp_regs): Update prototypes.
+
+ * alpha-nat.c: (supply_gregset, fill_gregset, supply_fpregset,
+ fill_fpregset): Pass current_regcache to alpha_supply/fill_ routines.
+ * alpha-linux-nat.c: Include "regcache.h".
+ (supply_gregset, fill_gregset, supply_fpregset, fill_fpregset): Pass
+ current_regcache to alpha_supply/fill_ routines.
+
+ * alphabsd-tdep.c: Include "regcache.h".
+ (alphabsd_supply_reg, alphabsd_supply_fpreg): Add REGCACHE paramter,
+ pass it to alpha_supply_ routines. Make REGS const.
+ (alphabsd_fill_reg, alphabsd_fill_fpreg): Add REGCACHE parameter,
+ pass it to alpha_fill_ routines.
+ * alphabsd-tdep.h (struct regcache): Add forward declaration.
+ (alphabsd_supply_reg, alphabsd_fill_reg, alphabsd_supply_fpreg,
+ alphabsd_fill_fpreg): Update prototypes.
+
+ * alphanbsd-nat.c (supply_gregset, fill_gregset, supply_fpregset,
+ fill_fpregset, alphabsd_fetch_inferior_registers,
+ alphabsd_store_inferior_registers): Pass current_regcache to
+ alphabsd_supply/fill_ routines.
+
+ * Makefile.in (alpha-linux-nat.o, alphabsd-tdep.o): Update
+ dependencies.
+
2007-05-06 Ulrich Weigand <uweigand@de.ibm.com>
* aix-thread.c (supply_gprs64, supply_reg32, supply_fprs,
alphabsd-nat.o: alphabsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
$(alpha_tdep_h) $(alphabsd_tdep_h) $(inf_ptrace_h) $(gregset_h) \
$(bsd_kvm_h)
-alphabsd-tdep.o: alphabsd-tdep.c $(defs_h) $(alpha_tdep_h) \
+alphabsd-tdep.o: alphabsd-tdep.c $(defs_h) $(regcache_h) $(alpha_tdep_h) \
$(alphabsd_tdep_h)
alphafbsd-tdep.o: alphafbsd-tdep.c $(defs_h) $(value_h) $(osabi_h) \
$(alpha_tdep_h) $(solib_svr4_h)
-alpha-linux-nat.o: alpha-linux-nat.c $(defs_h) $(target_h) $(linux_nat_h) \
- $(alpha_tdep_h) $(gregset_h)
+alpha-linux-nat.o: alpha-linux-nat.c $(defs_h) $(target_h) $(regcache_h) \
+ $(linux_nat_h) $(alpha_tdep_h) $(gregset_h)
alpha-linux-tdep.o: alpha-linux-tdep.c $(defs_h) $(frame_h) $(gdb_assert_h) \
$(gdb_string_h) $(osabi_h) $(solib_svr4_h) $(symtab_h) $(regset_h) \
$(regcache_h) $(alpha_tdep_h)
#include "defs.h"
#include "target.h"
+#include "regcache.h"
#include "linux-nat.h"
#include "alpha-tdep.h"
long *regp = (long *)gregsetp;
/* PC is in slot 32, UNIQUE is in slot 33. */
- alpha_supply_int_regs (-1, regp, regp + 31, regp + 32);
+ alpha_supply_int_regs (current_regcache, -1, regp, regp + 31, regp + 32);
}
void
long *regp = (long *)gregsetp;
/* PC is in slot 32, UNIQUE is in slot 33. */
- alpha_fill_int_regs (regno, regp, regp + 31, regp + 32);
+ alpha_fill_int_regs (current_regcache, regno, regp, regp + 31, regp + 32);
}
/*
long *regp = (long *)fpregsetp;
/* FPCR is in slot 32. */
- alpha_supply_fp_regs (-1, regp, regp + 31);
+ alpha_supply_fp_regs (current_regcache, -1, regp, regp + 31);
}
void
long *regp = (long *)fpregsetp;
/* FPCR is in slot 32. */
- alpha_fill_fp_regs (regno, regp, regp + 31);
+ alpha_fill_fp_regs (current_regcache, regno, regp, regp + 31);
}
long *regp = gregsetp->regs;
/* PC is in slot 32. */
- alpha_supply_int_regs (-1, regp, regp + 31, NULL);
+ alpha_supply_int_regs (current_regcache, -1, regp, regp + 31, NULL);
}
void
long *regp = gregsetp->regs;
/* PC is in slot 32. */
- alpha_fill_int_regs (regno, regp, regp + 31, NULL);
+ alpha_fill_int_regs (current_regcache, regno, regp, regp + 31, NULL);
}
/*
long *regp = fpregsetp->regs;
/* FPCR is in slot 32. */
- alpha_supply_fp_regs (-1, regp, regp + 31);
+ alpha_supply_fp_regs (current_regcache, -1, regp, regp + 31);
}
void
long *regp = fpregsetp->regs;
/* FPCR is in slot 32. */
- alpha_fill_fp_regs (regno, regp, regp + 31);
+ alpha_fill_fp_regs (current_regcache, regno, regp, regp + 31);
}
#endif
\f
targets don't supply this value in their core files. */
void
-alpha_supply_int_regs (int regno, const void *r0_r30,
- const void *pc, const void *unique)
+alpha_supply_int_regs (struct regcache *regcache, int regno,
+ const void *r0_r30, const void *pc, const void *unique)
{
const gdb_byte *regs = r0_r30;
int i;
for (i = 0; i < 31; ++i)
if (regno == i || regno == -1)
- regcache_raw_supply (current_regcache, i, regs + i * 8);
+ regcache_raw_supply (regcache, i, regs + i * 8);
if (regno == ALPHA_ZERO_REGNUM || regno == -1)
- regcache_raw_supply (current_regcache, ALPHA_ZERO_REGNUM, NULL);
+ regcache_raw_supply (regcache, ALPHA_ZERO_REGNUM, NULL);
if (regno == ALPHA_PC_REGNUM || regno == -1)
- regcache_raw_supply (current_regcache, ALPHA_PC_REGNUM, pc);
+ regcache_raw_supply (regcache, ALPHA_PC_REGNUM, pc);
if (regno == ALPHA_UNIQUE_REGNUM || regno == -1)
- regcache_raw_supply (current_regcache, ALPHA_UNIQUE_REGNUM, unique);
+ regcache_raw_supply (regcache, ALPHA_UNIQUE_REGNUM, unique);
}
void
-alpha_fill_int_regs (int regno, void *r0_r30, void *pc, void *unique)
+alpha_fill_int_regs (const struct regcache *regcache,
+ int regno, void *r0_r30, void *pc, void *unique)
{
gdb_byte *regs = r0_r30;
int i;
for (i = 0; i < 31; ++i)
if (regno == i || regno == -1)
- regcache_raw_collect (current_regcache, i, regs + i * 8);
+ regcache_raw_collect (regcache, i, regs + i * 8);
if (regno == ALPHA_PC_REGNUM || regno == -1)
- regcache_raw_collect (current_regcache, ALPHA_PC_REGNUM, pc);
+ regcache_raw_collect (regcache, ALPHA_PC_REGNUM, pc);
if (unique && (regno == ALPHA_UNIQUE_REGNUM || regno == -1))
- regcache_raw_collect (current_regcache, ALPHA_UNIQUE_REGNUM, unique);
+ regcache_raw_collect (regcache, ALPHA_UNIQUE_REGNUM, unique);
}
void
-alpha_supply_fp_regs (int regno, const void *f0_f30, const void *fpcr)
+alpha_supply_fp_regs (struct regcache *regcache, int regno,
+ const void *f0_f30, const void *fpcr)
{
const gdb_byte *regs = f0_f30;
int i;
for (i = ALPHA_FP0_REGNUM; i < ALPHA_FP0_REGNUM + 31; ++i)
if (regno == i || regno == -1)
- regcache_raw_supply (current_regcache, i,
+ regcache_raw_supply (regcache, i,
regs + (i - ALPHA_FP0_REGNUM) * 8);
if (regno == ALPHA_FPCR_REGNUM || regno == -1)
- regcache_raw_supply (current_regcache, ALPHA_FPCR_REGNUM, fpcr);
+ regcache_raw_supply (regcache, ALPHA_FPCR_REGNUM, fpcr);
}
void
-alpha_fill_fp_regs (int regno, void *f0_f30, void *fpcr)
+alpha_fill_fp_regs (const struct regcache *regcache,
+ int regno, void *f0_f30, void *fpcr)
{
gdb_byte *regs = f0_f30;
int i;
for (i = ALPHA_FP0_REGNUM; i < ALPHA_FP0_REGNUM + 31; ++i)
if (regno == i || regno == -1)
- regcache_raw_collect (current_regcache, i,
+ regcache_raw_collect (regcache, i,
regs + (i - ALPHA_FP0_REGNUM) * 8);
if (regno == ALPHA_FPCR_REGNUM || regno == -1)
- regcache_raw_collect (current_regcache, ALPHA_FPCR_REGNUM, fpcr);
+ regcache_raw_collect (regcache, ALPHA_FPCR_REGNUM, fpcr);
}
\f
#ifndef ALPHA_TDEP_H
#define ALPHA_TDEP_H
+struct regcache;
+
/* Say how long (ordinary) registers are. This is a piece of bogosity
used in push_word and a few other places; register_size() is the
real way to know how big a register is. */
extern void alpha_mdebug_init_abi (struct gdbarch_info, struct gdbarch *);
extern void alpha_dwarf2_init_abi (struct gdbarch_info, struct gdbarch *);
-extern void alpha_supply_int_regs (int, const void *, const void *,
- const void *);
-extern void alpha_fill_int_regs (int, void *, void *, void *);
-extern void alpha_supply_fp_regs (int, const void *, const void *);
-extern void alpha_fill_fp_regs (int, void *, void *);
+extern void alpha_supply_int_regs (struct regcache *, int, const void *,
+ const void *, const void *);
+extern void alpha_fill_int_regs (const struct regcache *, int,
+ void *, void *, void *);
+extern void alpha_supply_fp_regs (struct regcache *, int,
+ const void *, const void *);
+extern void alpha_fill_fp_regs (const struct regcache *,
+ int, void *, void *);
#endif /* ALPHA_TDEP_H */
void
supply_gregset (gregset_t *gregsetp)
{
- alphabsd_supply_reg ((char *) gregsetp, -1);
+ alphabsd_supply_reg (current_regcache, (char *) gregsetp, -1);
}
void
fill_gregset (gregset_t *gregsetp, int regno)
{
- alphabsd_fill_reg ((char *) gregsetp, regno);
+ alphabsd_fill_reg (current_regcache, (char *) gregsetp, regno);
}
void
supply_fpregset (fpregset_t *fpregsetp)
{
- alphabsd_supply_fpreg ((char *) fpregsetp, -1);
+ alphabsd_supply_fpreg (current_regcache, (char *) fpregsetp, -1);
}
void
fill_fpregset (fpregset_t *fpregsetp, int regno)
{
- alphabsd_fill_fpreg ((char *) fpregsetp, regno);
+ alphabsd_fill_fpreg (current_regcache, (char *) fpregsetp, regno);
}
\f
/* Determine if PT_GETREGS fetches this register. */
(PTRACE_TYPE_ARG3) &gregs, 0) == -1)
perror_with_name (_("Couldn't get registers"));
- alphabsd_supply_reg ((char *) &gregs, regno);
+ alphabsd_supply_reg (current_regcache, (char *) &gregs, regno);
if (regno != -1)
return;
}
(PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
perror_with_name (_("Couldn't get floating point status"));
- alphabsd_supply_fpreg ((char *) &fpregs, regno);
+ alphabsd_supply_fpreg (current_regcache, (char *) &fpregs, regno);
}
}
(PTRACE_TYPE_ARG3) &gregs, 0) == -1)
perror_with_name (_("Couldn't get registers"));
- alphabsd_fill_reg ((char *) &gregs, regno);
+ alphabsd_fill_reg (current_regcache, (char *) &gregs, regno);
if (ptrace (PT_SETREGS, PIDGET (inferior_ptid),
(PTRACE_TYPE_ARG3) &gregs, 0) == -1)
(PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
perror_with_name (_("Couldn't get floating point status"));
- alphabsd_fill_fpreg ((char *) &fpregs, regno);
+ alphabsd_fill_fpreg (current_regcache, (char *) &fpregs, regno);
if (ptrace (PT_SETFPREGS, PIDGET (inferior_ptid),
(PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
Boston, MA 02110-1301, USA. */
#include "defs.h"
+#include "regcache.h"
#include "alpha-tdep.h"
#include "alphabsd-tdep.h"
ptrace register structure used by BSD on Alpha. */
void
-alphabsd_supply_reg (char *regs, int regno)
+alphabsd_supply_reg (struct regcache *regcache, const char *regs, int regno)
{
/* PC is at slot 32; UNIQUE not present. */
- alpha_supply_int_regs (regno, regs, regs + 31 * 8, NULL);
+ alpha_supply_int_regs (regcache, regno, regs, regs + 31 * 8, NULL);
}
void
-alphabsd_fill_reg (char *regs, int regno)
+alphabsd_fill_reg (const struct regcache *regcache, char *regs, int regno)
{
/* PC is at slot 32; UNIQUE not present. */
- alpha_fill_int_regs (regno, regs, regs + 31 * 8, NULL);
+ alpha_fill_int_regs (regcache, regno, regs, regs + 31 * 8, NULL);
}
void
-alphabsd_supply_fpreg (char *fpregs, int regno)
+alphabsd_supply_fpreg (struct regcache *regcache, const char *fpregs, int regno)
{
/* FPCR is at slot 33; slot 32 unused. */
- alpha_supply_fp_regs (regno, fpregs, fpregs + 32 * 8);
+ alpha_supply_fp_regs (regcache, regno, fpregs, fpregs + 32 * 8);
}
void
-alphabsd_fill_fpreg (char *fpregs, int regno)
+alphabsd_fill_fpreg (const struct regcache *regcache, char *fpregs, int regno)
{
/* FPCR is at slot 33; slot 32 unused. */
- alpha_fill_fp_regs (regno, fpregs, fpregs + 32 * 8);
+ alpha_fill_fp_regs (regcache, regno, fpregs, fpregs + 32 * 8);
}
#ifndef ALPHABSD_TDEP_H
#define ALPHABSD_TDEP_H
-void alphabsd_supply_reg (char *, int);
-void alphabsd_fill_reg (char *, int);
+struct regcache;
-void alphabsd_supply_fpreg (char *, int);
-void alphabsd_fill_fpreg (char *, int);
+void alphabsd_supply_reg (struct regcache *, const char *, int);
+void alphabsd_fill_reg (const struct regcache *, char *, int);
+
+void alphabsd_supply_fpreg (struct regcache *, const char *, int);
+void alphabsd_fill_fpreg (const struct regcache *, char *, int);
\f
/* Functions exported from alphanbsd-tdep.c. */