+2014-05-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
+
+ * regset.h (struct regset): Remove gdbarch field.
+ * regset.c (regset_alloc): Drop initialization of gdbarch field.
+ * nios2-linux-tdep.c (nios2_core_regset): Likewise.
+ * ppcfbsd-tdep.c (ppc32_fbsd_gregset, ppc64_fbsd_gregset):
+ Likewise.
+ * ppc-linux-tdep.c (ppc32_linux_gregset, ppc64_linux_gregset)
+ (ppc32_linux_fpregset, ppc32_linux_vrregset)
+ (ppc32_linux_vsxregset): Likewise.
+ * i386obsd-tdep.c (i386obsd_aout_supply_regset): Get the gdbarch
+ via the regcache instead of the regset.
+ * i386-tdep.c (i386_supply_gregset, i386_collect_gregset)
+ (i386_supply_fpregset, i386_collect_fpregset): Likewise.
+ * amd64obsd-tdep.c (amd64obsd_supply_regset): Likewise.
+ * amd64-tdep.c (amd64_supply_fpregset, amd64_collect_fpregset):
+ Likewise.
+
2014-05-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
* alpha-linux-tdep.c (alpha_linux_gregset, alpha_linux_fpregset):
amd64_supply_fpregset (const struct regset *regset, struct regcache *regcache,
int regnum, const void *fpregs, size_t len)
{
- const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch);
+ struct gdbarch *gdbarch = get_regcache_arch (regcache);
+ const struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
gdb_assert (len == tdep->sizeof_fpregset);
amd64_supply_fxsave (regcache, regnum, fpregs);
const struct regcache *regcache,
int regnum, void *fpregs, size_t len)
{
- const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch);
+ struct gdbarch *gdbarch = get_regcache_arch (regcache);
+ const struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
gdb_assert (len == tdep->sizeof_fpregset);
amd64_collect_fxsave (regcache, regnum, fpregs);
struct regcache *regcache, int regnum,
const void *regs, size_t len)
{
- const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch);
+ struct gdbarch *gdbarch = get_regcache_arch (regcache);
+ const struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
gdb_assert (len >= tdep->sizeof_gregset + I387_SIZEOF_FXSAVE);
i386_supply_gregset (const struct regset *regset, struct regcache *regcache,
int regnum, const void *gregs, size_t len)
{
- const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch);
+ struct gdbarch *gdbarch = get_regcache_arch (regcache);
+ const struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
const gdb_byte *regs = gregs;
int i;
const struct regcache *regcache,
int regnum, void *gregs, size_t len)
{
- const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch);
+ struct gdbarch *gdbarch = get_regcache_arch (regcache);
+ const struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
gdb_byte *regs = gregs;
int i;
i386_supply_fpregset (const struct regset *regset, struct regcache *regcache,
int regnum, const void *fpregs, size_t len)
{
- const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch);
+ struct gdbarch *gdbarch = get_regcache_arch (regcache);
+ const struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (len == I387_SIZEOF_FXSAVE)
{
const struct regcache *regcache,
int regnum, void *fpregs, size_t len)
{
- const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch);
+ struct gdbarch *gdbarch = get_regcache_arch (regcache);
+ const struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (len == I387_SIZEOF_FXSAVE)
{
struct regcache *regcache, int regnum,
const void *regs, size_t len)
{
- const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch);
+ struct gdbarch *gdbarch = get_regcache_arch (regcache);
+ const struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
const gdb_byte *gregs = regs;
gdb_assert (len >= tdep->sizeof_gregset + I387_SIZEOF_FSAVE);
NULL,
nios2_supply_gregset,
NULL,
- NULL
};
/* Implement the regset_from_core_section gdbarch method. */
static const struct regset ppc32_linux_gregset = {
&ppc32_linux_reg_offsets,
ppc_linux_supply_gregset,
- ppc_linux_collect_gregset,
- NULL
+ ppc_linux_collect_gregset
};
static const struct regset ppc64_linux_gregset = {
&ppc64_linux_reg_offsets,
ppc_linux_supply_gregset,
- ppc_linux_collect_gregset,
- NULL
+ ppc_linux_collect_gregset
};
static const struct regset ppc32_linux_fpregset = {
&ppc32_linux_reg_offsets,
ppc_supply_fpregset,
- ppc_collect_fpregset,
- NULL
+ ppc_collect_fpregset
};
static const struct regset ppc32_linux_vrregset = {
&ppc32_linux_reg_offsets,
ppc_supply_vrregset,
- ppc_collect_vrregset,
- NULL
+ ppc_collect_vrregset
};
static const struct regset ppc32_linux_vsxregset = {
&ppc32_linux_reg_offsets,
ppc_supply_vsxregset,
- ppc_collect_vsxregset,
- NULL
+ ppc_collect_vsxregset
};
const struct regset *
static const struct regset ppc32_fbsd_gregset = {
&ppc32_fbsd_reg_offsets,
ppc_supply_gregset,
- ppc_collect_gregset,
- NULL
+ ppc_collect_gregset
};
/* 64-bit general-purpose register set. */
static const struct regset ppc64_fbsd_gregset = {
&ppc64_fbsd_reg_offsets,
ppc_supply_gregset,
- ppc_collect_gregset,
- NULL
+ ppc_collect_gregset
};
/* 32-/64-bit floating-point register set. */
{
struct regset *regset = GDBARCH_OBSTACK_ZALLOC (arch, struct regset);
- regset->arch = arch;
regset->supply_regset = supply_regset;
regset->collect_regset = collect_regset;
/* Function collecting values in a register set from a register cache. */
collect_regset_ftype *collect_regset;
-
- /* Architecture associated with the register set. */
- struct gdbarch *arch;
};
/* Allocate a fresh 'struct regset' whose supply_regset function is