Split size in regset section iterators
In the existing code, when using the regset section iteration functions, the size parameter is used in different ways. With collect, size is used to create the buffer in which to write the regset. (see linux-tdep.c::linux_collect_regset_section_cb). With supply, size is used to confirm the existing regset is the correct size. If REGSET_VARIABLE_SIZE is set then the regset can be bigger than size. Effectively, size is the minimum possible size of the regset. (see corelow.c::get_core_register_section). There are currently no targets with both REGSET_VARIABLE_SIZE and a collect function. In SVE, a corefile can contain one of two formats after the header, both of which are different sizes. However, when writing a core file, we always want to write out the full bigger size. To allow support of collects for REGSET_VARIABLE_SIZE we need two sizes. This is done by adding supply_size and collect_size. gdb/ * aarch64-fbsd-tdep.c (aarch64_fbsd_iterate_over_regset_sections): Add supply_size and collect_size. * aarch64-linux-tdep.c (aarch64_linux_iterate_over_regset_sections): Likewise. * alpha-linux-tdep.c (alpha_linux_iterate_over_regset_sections): * alpha-nbsd-tdep.c (alphanbsd_iterate_over_regset_sections): Likewise. * amd64-fbsd-tdep.c (amd64fbsd_iterate_over_regset_sections): Likewise. * amd64-linux-tdep.c (amd64_linux_iterate_over_regset_sections): Likewise. * arm-bsd-tdep.c (armbsd_iterate_over_regset_sections): Likewise. * arm-fbsd-tdep.c (arm_fbsd_iterate_over_regset_sections): Likewise. * arm-linux-tdep.c (arm_linux_iterate_over_regset_sections): Likewise. * corelow.c (get_core_registers_cb): Likewise. (core_target::fetch_registers): Likewise. * fbsd-tdep.c (fbsd_collect_regset_section_cb): Likewise. * frv-linux-tdep.c (frv_linux_iterate_over_regset_sections): Likewise. * gdbarch.h (void): Regenerate. * gdbarch.sh: Add supply_size and collect_size. * hppa-linux-tdep.c (hppa_linux_iterate_over_regset_sections): Likewise. * hppa-nbsd-tdep.c (hppanbsd_iterate_over_regset_sections): Likewise. * hppa-obsd-tdep.c (hppaobsd_iterate_over_regset_sections): Likewise. * i386-fbsd-tdep.c (i386fbsd_iterate_over_regset_sections): Likewise. * i386-linux-tdep.c (i386_linux_iterate_over_regset_sections): Likewise. * i386-tdep.c (i386_iterate_over_regset_sections): Likewise. * ia64-linux-tdep.c (ia64_linux_iterate_over_regset_sections): Likewise. * linux-tdep.c (linux_collect_regset_section_cb): Likewise. * m32r-linux-tdep.c (m32r_linux_iterate_over_regset_sections): Likewise. * m68k-bsd-tdep.c (m68kbsd_iterate_over_regset_sections): Likewise. * m68k-linux-tdep.c (m68k_linux_iterate_over_regset_sections): Likewise. * mips-fbsd-tdep.c (mips_fbsd_iterate_over_regset_sections): Likewise. * mips-linux-tdep.c (mips_linux_iterate_over_regset_sections): Likewise. * mips-nbsd-tdep.c (mipsnbsd_iterate_over_regset_sections): Likewise. * mips64-obsd-tdep.c (mips64obsd_iterate_over_regset_sections): Likewise. * mn10300-linux-tdep.c (am33_iterate_over_regset_sections): Likewise. * nios2-linux-tdep.c (nios2_iterate_over_regset_sections): Likewise. * ppc-fbsd-tdep.c (ppcfbsd_iterate_over_regset_sections): Likewise. * ppc-linux-tdep.c (ppc_linux_iterate_over_regset_sections): Likewise. * ppc-nbsd-tdep.c (ppcnbsd_iterate_over_regset_sections): Likewise. * ppc-obsd-tdep.c (ppcobsd_iterate_over_regset_sections): Likewise. * riscv-linux-tdep.c (riscv_linux_iterate_over_regset_sections): Likewise. * rs6000-aix-tdep.c (rs6000_aix_iterate_over_regset_sections): Likewise. * s390-linux-tdep.c (s390_iterate_over_regset_sections): Likewise. * score-tdep.c (score7_linux_iterate_over_regset_sections): Likewise. * sh-tdep.c (sh_iterate_over_regset_sections): Likewise. * sparc-tdep.c (sparc_iterate_over_regset_sections): Likewise. * tilegx-linux-tdep.c (tilegx_iterate_over_regset_sections): Likewise. * vax-tdep.c (vax_iterate_over_regset_sections): Likewise. * xtensa-tdep.c (xtensa_iterate_over_regset_sections): Likewise.
This commit is contained in:
parent
facbd8bd3d
commit
a616bb9450
|
@ -1,3 +1,61 @@
|
||||||
|
2018-08-13 Alan Hayward <alan.hayward@arm.com>
|
||||||
|
|
||||||
|
* aarch64-fbsd-tdep.c
|
||||||
|
(aarch64_fbsd_iterate_over_regset_sections): Add supply_size and
|
||||||
|
collect_size.
|
||||||
|
* aarch64-linux-tdep.c
|
||||||
|
(aarch64_linux_iterate_over_regset_sections): Likewise.
|
||||||
|
* alpha-linux-tdep.c
|
||||||
|
(alpha_linux_iterate_over_regset_sections):
|
||||||
|
* alpha-nbsd-tdep.c
|
||||||
|
(alphanbsd_iterate_over_regset_sections): Likewise.
|
||||||
|
* amd64-fbsd-tdep.c
|
||||||
|
(amd64fbsd_iterate_over_regset_sections): Likewise.
|
||||||
|
* amd64-linux-tdep.c
|
||||||
|
(amd64_linux_iterate_over_regset_sections): Likewise.
|
||||||
|
* arm-bsd-tdep.c
|
||||||
|
(armbsd_iterate_over_regset_sections): Likewise.
|
||||||
|
* arm-fbsd-tdep.c
|
||||||
|
(arm_fbsd_iterate_over_regset_sections): Likewise.
|
||||||
|
* arm-linux-tdep.c
|
||||||
|
(arm_linux_iterate_over_regset_sections): Likewise.
|
||||||
|
* corelow.c (get_core_registers_cb): Likewise.
|
||||||
|
(core_target::fetch_registers): Likewise.
|
||||||
|
* fbsd-tdep.c (fbsd_collect_regset_section_cb): Likewise.
|
||||||
|
* frv-linux-tdep.c (frv_linux_iterate_over_regset_sections): Likewise.
|
||||||
|
* gdbarch.h (void): Regenerate.
|
||||||
|
* gdbarch.sh: Add supply_size and collect_size.
|
||||||
|
* hppa-linux-tdep.c (hppa_linux_iterate_over_regset_sections): Likewise.
|
||||||
|
* hppa-nbsd-tdep.c (hppanbsd_iterate_over_regset_sections): Likewise.
|
||||||
|
* hppa-obsd-tdep.c (hppaobsd_iterate_over_regset_sections): Likewise.
|
||||||
|
* i386-fbsd-tdep.c (i386fbsd_iterate_over_regset_sections): Likewise.
|
||||||
|
* i386-linux-tdep.c (i386_linux_iterate_over_regset_sections): Likewise.
|
||||||
|
* i386-tdep.c (i386_iterate_over_regset_sections): Likewise.
|
||||||
|
* ia64-linux-tdep.c (ia64_linux_iterate_over_regset_sections): Likewise.
|
||||||
|
* linux-tdep.c (linux_collect_regset_section_cb): Likewise.
|
||||||
|
* m32r-linux-tdep.c (m32r_linux_iterate_over_regset_sections): Likewise.
|
||||||
|
* m68k-bsd-tdep.c (m68kbsd_iterate_over_regset_sections): Likewise.
|
||||||
|
* m68k-linux-tdep.c (m68k_linux_iterate_over_regset_sections): Likewise.
|
||||||
|
* mips-fbsd-tdep.c (mips_fbsd_iterate_over_regset_sections): Likewise.
|
||||||
|
* mips-linux-tdep.c (mips_linux_iterate_over_regset_sections): Likewise.
|
||||||
|
* mips-nbsd-tdep.c (mipsnbsd_iterate_over_regset_sections): Likewise.
|
||||||
|
* mips64-obsd-tdep.c (mips64obsd_iterate_over_regset_sections): Likewise.
|
||||||
|
* mn10300-linux-tdep.c (am33_iterate_over_regset_sections): Likewise.
|
||||||
|
* nios2-linux-tdep.c (nios2_iterate_over_regset_sections): Likewise.
|
||||||
|
* ppc-fbsd-tdep.c (ppcfbsd_iterate_over_regset_sections): Likewise.
|
||||||
|
* ppc-linux-tdep.c (ppc_linux_iterate_over_regset_sections): Likewise.
|
||||||
|
* ppc-nbsd-tdep.c (ppcnbsd_iterate_over_regset_sections): Likewise.
|
||||||
|
* ppc-obsd-tdep.c (ppcobsd_iterate_over_regset_sections): Likewise.
|
||||||
|
* riscv-linux-tdep.c (riscv_linux_iterate_over_regset_sections): Likewise.
|
||||||
|
* rs6000-aix-tdep.c (rs6000_aix_iterate_over_regset_sections): Likewise.
|
||||||
|
* s390-linux-tdep.c (s390_iterate_over_regset_sections): Likewise.
|
||||||
|
* score-tdep.c (score7_linux_iterate_over_regset_sections): Likewise.
|
||||||
|
* sh-tdep.c (sh_iterate_over_regset_sections): Likewise.
|
||||||
|
* sparc-tdep.c (sparc_iterate_over_regset_sections): Likewise.
|
||||||
|
* tilegx-linux-tdep.c (tilegx_iterate_over_regset_sections): Likewise.
|
||||||
|
* vax-tdep.c (vax_iterate_over_regset_sections): Likewise.
|
||||||
|
* xtensa-tdep.c (xtensa_iterate_over_regset_sections): Likewise.
|
||||||
|
|
||||||
2018-08-10 Simon Marchi <simon.marchi@ericsson.com>
|
2018-08-10 Simon Marchi <simon.marchi@ericsson.com>
|
||||||
|
|
||||||
* nat/linux-osdata.c (commandline_from_pid): Replace xstrprintf
|
* nat/linux-osdata.c (commandline_from_pid): Replace xstrprintf
|
||||||
|
|
|
@ -169,10 +169,10 @@ aarch64_fbsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
void *cb_data,
|
void *cb_data,
|
||||||
const struct regcache *regcache)
|
const struct regcache *regcache)
|
||||||
{
|
{
|
||||||
cb (".reg", AARCH64_FBSD_SIZEOF_GREGSET, &aarch64_fbsd_gregset,
|
cb (".reg", AARCH64_FBSD_SIZEOF_GREGSET, AARCH64_FBSD_SIZEOF_GREGSET,
|
||||||
NULL, cb_data);
|
&aarch64_fbsd_gregset, NULL, cb_data);
|
||||||
cb (".reg2", AARCH64_FBSD_SIZEOF_FPREGSET, &aarch64_fbsd_fpregset,
|
cb (".reg2", AARCH64_FBSD_SIZEOF_FPREGSET, AARCH64_FBSD_SIZEOF_FPREGSET,
|
||||||
NULL, cb_data);
|
&aarch64_fbsd_fpregset, NULL, cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Implement the 'init_osabi' method of struct gdb_osabi_handler. */
|
/* Implement the 'init_osabi' method of struct gdb_osabi_handler. */
|
||||||
|
|
|
@ -227,10 +227,10 @@ aarch64_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
void *cb_data,
|
void *cb_data,
|
||||||
const struct regcache *regcache)
|
const struct regcache *regcache)
|
||||||
{
|
{
|
||||||
cb (".reg", AARCH64_LINUX_SIZEOF_GREGSET, &aarch64_linux_gregset,
|
cb (".reg", AARCH64_LINUX_SIZEOF_GREGSET, AARCH64_LINUX_SIZEOF_GREGSET,
|
||||||
NULL, cb_data);
|
&aarch64_linux_gregset, NULL, cb_data);
|
||||||
cb (".reg2", AARCH64_LINUX_SIZEOF_FPREGSET, &aarch64_linux_fpregset,
|
cb (".reg2", AARCH64_LINUX_SIZEOF_FPREGSET, AARCH64_LINUX_SIZEOF_FPREGSET,
|
||||||
NULL, cb_data);
|
&aarch64_linux_fpregset, NULL, cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Implement the "core_read_description" gdbarch method. SVE not yet
|
/* Implement the "core_read_description" gdbarch method. SVE not yet
|
||||||
|
|
|
@ -238,8 +238,8 @@ alpha_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
void *cb_data,
|
void *cb_data,
|
||||||
const struct regcache *regcache)
|
const struct regcache *regcache)
|
||||||
{
|
{
|
||||||
cb (".reg", 32 * 8, &alpha_linux_gregset, NULL, cb_data);
|
cb (".reg", 32 * 8, 32 * 8, &alpha_linux_gregset, NULL, cb_data);
|
||||||
cb (".reg2", 32 * 8, &alpha_linux_fpregset, NULL, cb_data);
|
cb (".reg2", 32 * 8, 32 * 8, &alpha_linux_fpregset, NULL, cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Implementation of `gdbarch_gdb_signal_from_target', as defined in
|
/* Implementation of `gdbarch_gdb_signal_from_target', as defined in
|
||||||
|
|
|
@ -161,8 +161,10 @@ alphanbsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
void *cb_data,
|
void *cb_data,
|
||||||
const struct regcache *regcache)
|
const struct regcache *regcache)
|
||||||
{
|
{
|
||||||
cb (".reg", ALPHANBSD_SIZEOF_GREGS, &alphanbsd_gregset, NULL, cb_data);
|
cb (".reg", ALPHANBSD_SIZEOF_GREGS, ALPHANBSD_SIZEOF_GREGS,
|
||||||
cb (".reg2", ALPHANBSD_SIZEOF_FPREGS, &alphanbsd_fpregset, NULL, cb_data);
|
&alphanbsd_gregset, NULL, cb_data);
|
||||||
|
cb (".reg2", ALPHANBSD_SIZEOF_FPREGS, ALPHANBSD_SIZEOF_FPREGS,
|
||||||
|
&alphanbsd_fpregset, NULL, cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -196,9 +196,11 @@ amd64fbsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
{
|
{
|
||||||
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
||||||
|
|
||||||
cb (".reg", tdep->sizeof_gregset, &i386_gregset, NULL, cb_data);
|
cb (".reg", tdep->sizeof_gregset, tdep->sizeof_gregset, &i386_gregset, NULL,
|
||||||
cb (".reg2", tdep->sizeof_fpregset, &amd64_fpregset, NULL, cb_data);
|
cb_data);
|
||||||
cb (".reg-xstate", X86_XSTATE_SIZE(tdep->xcr0),
|
cb (".reg2", tdep->sizeof_fpregset, tdep->sizeof_fpregset, &amd64_fpregset,
|
||||||
|
NULL, cb_data);
|
||||||
|
cb (".reg-xstate", X86_XSTATE_SIZE (tdep->xcr0), X86_XSTATE_SIZE (tdep->xcr0),
|
||||||
&amd64fbsd_xstateregset, "XSAVE extended state", cb_data);
|
&amd64fbsd_xstateregset, "XSAVE extended state", cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1651,9 +1651,9 @@ amd64_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
{
|
{
|
||||||
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
||||||
|
|
||||||
cb (".reg", 27 * 8, &i386_gregset, NULL, cb_data);
|
cb (".reg", 27 * 8, 27 * 8, &i386_gregset, NULL, cb_data);
|
||||||
cb (".reg2", 512, &amd64_fpregset, NULL, cb_data);
|
cb (".reg2", 512, 512, &amd64_fpregset, NULL, cb_data);
|
||||||
cb (".reg-xstate", X86_XSTATE_SIZE (tdep->xcr0),
|
cb (".reg-xstate", X86_XSTATE_SIZE (tdep->xcr0), X86_XSTATE_SIZE (tdep->xcr0),
|
||||||
&amd64_linux_xstateregset, "XSAVE extended state", cb_data);
|
&amd64_linux_xstateregset, "XSAVE extended state", cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -117,6 +117,8 @@ armbsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
void *cb_data,
|
void *cb_data,
|
||||||
const struct regcache *regcache)
|
const struct regcache *regcache)
|
||||||
{
|
{
|
||||||
cb (".reg", ARMBSD_SIZEOF_GREGS, &armbsd_gregset, NULL, cb_data);
|
cb (".reg", ARMBSD_SIZEOF_GREGS, ARMBSD_SIZEOF_GREGS, &armbsd_gregset, NULL,
|
||||||
cb (".reg2", ARMBSD_SIZEOF_FPREGS, &armbsd_fpregset, NULL, cb_data);
|
cb_data);
|
||||||
|
cb (".reg2", ARMBSD_SIZEOF_FPREGS, ARMBSD_SIZEOF_FPREGS, &armbsd_fpregset,
|
||||||
|
NULL, cb_data);
|
||||||
}
|
}
|
||||||
|
|
|
@ -175,14 +175,15 @@ arm_fbsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
{
|
{
|
||||||
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
||||||
|
|
||||||
cb (".reg", ARM_FBSD_SIZEOF_GREGSET, &arm_fbsd_gregset, NULL, cb_data);
|
cb (".reg", ARM_FBSD_SIZEOF_GREGSET, ARM_FBSD_SIZEOF_GREGSET,
|
||||||
|
&arm_fbsd_gregset, NULL, cb_data);
|
||||||
|
|
||||||
/* While FreeBSD/arm cores do contain a NT_FPREGSET / ".reg2"
|
/* While FreeBSD/arm cores do contain a NT_FPREGSET / ".reg2"
|
||||||
register set, it is not populated with register values by the
|
register set, it is not populated with register values by the
|
||||||
kernel but just contains all zeroes. */
|
kernel but just contains all zeroes. */
|
||||||
if (tdep->vfp_register_count > 0)
|
if (tdep->vfp_register_count > 0)
|
||||||
cb (".reg-arm-vfp", ARM_FBSD_SIZEOF_VFPREGSET, &arm_fbsd_vfpregset,
|
cb (".reg-arm-vfp", ARM_FBSD_SIZEOF_VFPREGSET, ARM_FBSD_SIZEOF_VFPREGSET,
|
||||||
"VFP floating-point", cb_data);
|
&arm_fbsd_vfpregset, "VFP floating-point", cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Lookup a target description from a target's AT_HWCAP auxiliary
|
/* Lookup a target description from a target's AT_HWCAP auxiliary
|
||||||
|
|
|
@ -712,14 +712,15 @@ arm_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
{
|
{
|
||||||
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
||||||
|
|
||||||
cb (".reg", ARM_LINUX_SIZEOF_GREGSET, &arm_linux_gregset, NULL, cb_data);
|
cb (".reg", ARM_LINUX_SIZEOF_GREGSET, ARM_LINUX_SIZEOF_GREGSET,
|
||||||
|
&arm_linux_gregset, NULL, cb_data);
|
||||||
|
|
||||||
if (tdep->vfp_register_count > 0)
|
if (tdep->vfp_register_count > 0)
|
||||||
cb (".reg-arm-vfp", ARM_LINUX_SIZEOF_VFP, &arm_linux_vfpregset,
|
cb (".reg-arm-vfp", ARM_LINUX_SIZEOF_VFP, ARM_LINUX_SIZEOF_VFP,
|
||||||
"VFP floating-point", cb_data);
|
&arm_linux_vfpregset, "VFP floating-point", cb_data);
|
||||||
else if (tdep->have_fpa_registers)
|
else if (tdep->have_fpa_registers)
|
||||||
cb (".reg2", ARM_LINUX_SIZEOF_NWFPE, &arm_linux_fpregset,
|
cb (".reg2", ARM_LINUX_SIZEOF_NWFPE, ARM_LINUX_SIZEOF_NWFPE,
|
||||||
"FPA floating-point", cb_data);
|
&arm_linux_fpregset, "FPA floating-point", cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Determine target description from core file. */
|
/* Determine target description from core file. */
|
||||||
|
|
|
@ -636,12 +636,17 @@ struct get_core_registers_cb_data
|
||||||
register note section. */
|
register note section. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
get_core_registers_cb (const char *sect_name, int size,
|
get_core_registers_cb (const char *sect_name, int supply_size, int collect_size,
|
||||||
const struct regset *regset,
|
const struct regset *regset,
|
||||||
const char *human_name, void *cb_data)
|
const char *human_name, void *cb_data)
|
||||||
{
|
{
|
||||||
auto *data = (get_core_registers_cb_data *) cb_data;
|
auto *data = (get_core_registers_cb_data *) cb_data;
|
||||||
bool required = false;
|
bool required = false;
|
||||||
|
bool variable_size_section = (regset != NULL
|
||||||
|
&& regset->flags & REGSET_VARIABLE_SIZE);
|
||||||
|
|
||||||
|
if (!variable_size_section)
|
||||||
|
gdb_assert (supply_size == collect_size);
|
||||||
|
|
||||||
if (strcmp (sect_name, ".reg") == 0)
|
if (strcmp (sect_name, ".reg") == 0)
|
||||||
{
|
{
|
||||||
|
@ -658,7 +663,8 @@ get_core_registers_cb (const char *sect_name, int size,
|
||||||
/* The 'which' parameter is only used when no regset is provided.
|
/* The 'which' parameter is only used when no regset is provided.
|
||||||
Thus we just set it to -1. */
|
Thus we just set it to -1. */
|
||||||
data->target->get_core_register_section (data->regcache, regset, sect_name,
|
data->target->get_core_register_section (data->regcache, regset, sect_name,
|
||||||
size, -1, human_name, required);
|
supply_size, -1, human_name,
|
||||||
|
required);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the registers out of a core file. This is the machine-
|
/* Get the registers out of a core file. This is the machine-
|
||||||
|
|
|
@ -428,8 +428,8 @@ struct fbsd_collect_regset_section_cb_data
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
fbsd_collect_regset_section_cb (const char *sect_name, int size,
|
fbsd_collect_regset_section_cb (const char *sect_name, int supply_size,
|
||||||
const struct regset *regset,
|
int collect_size, const struct regset *regset,
|
||||||
const char *human_name, void *cb_data)
|
const char *human_name, void *cb_data)
|
||||||
{
|
{
|
||||||
char *buf;
|
char *buf;
|
||||||
|
@ -441,8 +441,8 @@ fbsd_collect_regset_section_cb (const char *sect_name, int size,
|
||||||
|
|
||||||
gdb_assert (regset->collect_regset);
|
gdb_assert (regset->collect_regset);
|
||||||
|
|
||||||
buf = (char *) xmalloc (size);
|
buf = (char *) xmalloc (collect_size);
|
||||||
regset->collect_regset (regset, data->regcache, -1, buf, size);
|
regset->collect_regset (regset, data->regcache, -1, buf, collect_size);
|
||||||
|
|
||||||
/* PRSTATUS still needs to be treated specially. */
|
/* PRSTATUS still needs to be treated specially. */
|
||||||
if (strcmp (sect_name, ".reg") == 0)
|
if (strcmp (sect_name, ".reg") == 0)
|
||||||
|
@ -452,7 +452,7 @@ fbsd_collect_regset_section_cb (const char *sect_name, int size,
|
||||||
else
|
else
|
||||||
data->note_data = (char *) elfcore_write_register_note
|
data->note_data = (char *) elfcore_write_register_note
|
||||||
(data->obfd, data->note_data, data->note_size,
|
(data->obfd, data->note_data, data->note_size,
|
||||||
sect_name, buf, size);
|
sect_name, buf, collect_size);
|
||||||
xfree (buf);
|
xfree (buf);
|
||||||
|
|
||||||
if (data->note_data == NULL)
|
if (data->note_data == NULL)
|
||||||
|
|
|
@ -445,10 +445,10 @@ frv_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
void *cb_data,
|
void *cb_data,
|
||||||
const struct regcache *regcache)
|
const struct regcache *regcache)
|
||||||
{
|
{
|
||||||
cb (".reg", sizeof (frv_elf_gregset_t), &frv_linux_gregset,
|
cb (".reg", sizeof (frv_elf_gregset_t), sizeof (frv_elf_gregset_t),
|
||||||
NULL, cb_data);
|
&frv_linux_gregset, NULL, cb_data);
|
||||||
cb (".reg2", sizeof (frv_elf_fpregset_t), &frv_linux_fpregset,
|
cb (".reg2", sizeof (frv_elf_fpregset_t), sizeof (frv_elf_fpregset_t),
|
||||||
NULL, cb_data);
|
&frv_linux_fpregset, NULL, cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -92,13 +92,15 @@ typedef int (iterate_over_objfiles_in_search_order_cb_ftype)
|
||||||
|
|
||||||
/* Callback type for regset section iterators. The callback usually
|
/* Callback type for regset section iterators. The callback usually
|
||||||
invokes the REGSET's supply or collect method, to which it must
|
invokes the REGSET's supply or collect method, to which it must
|
||||||
pass a buffer with at least the given SIZE. SECT_NAME is a BFD
|
pass a buffer - for collects this buffer will need to be created using
|
||||||
section name, and HUMAN_NAME is used for diagnostic messages.
|
COLLECT_SIZE, for supply the existing buffer being read from should
|
||||||
CB_DATA should have been passed unchanged through the iterator. */
|
be at least SUPPLY_SIZE. SECT_NAME is a BFD section name, and HUMAN_NAME
|
||||||
|
is used for diagnostic messages. CB_DATA should have been passed
|
||||||
|
unchanged through the iterator. */
|
||||||
|
|
||||||
typedef void (iterate_over_regset_sections_cb)
|
typedef void (iterate_over_regset_sections_cb)
|
||||||
(const char *sect_name, int size, const struct regset *regset,
|
(const char *sect_name, int supply_size, int collect_size,
|
||||||
const char *human_name, void *cb_data);
|
const struct regset *regset, const char *human_name, void *cb_data);
|
||||||
|
|
||||||
|
|
||||||
/* The following are pre-initialized by GDBARCH. */
|
/* The following are pre-initialized by GDBARCH. */
|
||||||
|
|
|
@ -1316,13 +1316,15 @@ typedef int (iterate_over_objfiles_in_search_order_cb_ftype)
|
||||||
|
|
||||||
/* Callback type for regset section iterators. The callback usually
|
/* Callback type for regset section iterators. The callback usually
|
||||||
invokes the REGSET's supply or collect method, to which it must
|
invokes the REGSET's supply or collect method, to which it must
|
||||||
pass a buffer with at least the given SIZE. SECT_NAME is a BFD
|
pass a buffer - for collects this buffer will need to be created using
|
||||||
section name, and HUMAN_NAME is used for diagnostic messages.
|
COLLECT_SIZE, for supply the existing buffer being read from should
|
||||||
CB_DATA should have been passed unchanged through the iterator. */
|
be at least SUPPLY_SIZE. SECT_NAME is a BFD section name, and HUMAN_NAME
|
||||||
|
is used for diagnostic messages. CB_DATA should have been passed
|
||||||
|
unchanged through the iterator. */
|
||||||
|
|
||||||
typedef void (iterate_over_regset_sections_cb)
|
typedef void (iterate_over_regset_sections_cb)
|
||||||
(const char *sect_name, int size, const struct regset *regset,
|
(const char *sect_name, int supply_size, int collect_size,
|
||||||
const char *human_name, void *cb_data);
|
const struct regset *regset, const char *human_name, void *cb_data);
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# function typedef's
|
# function typedef's
|
||||||
|
|
|
@ -479,9 +479,9 @@ hppa_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
{
|
{
|
||||||
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
||||||
|
|
||||||
cb (".reg", 80 * tdep->bytes_per_address, &hppa_linux_regset,
|
cb (".reg", 80 * tdep->bytes_per_address, 80 * tdep->bytes_per_address,
|
||||||
NULL, cb_data);
|
&hppa_linux_regset, NULL, cb_data);
|
||||||
cb (".reg2", 64 * 4, &hppa_linux_fpregset, NULL, cb_data);
|
cb (".reg2", 64 * 4, 64 * 4, &hppa_linux_fpregset, NULL, cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -190,7 +190,8 @@ hppanbsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
void *cb_data,
|
void *cb_data,
|
||||||
const struct regcache *regcache)
|
const struct regcache *regcache)
|
||||||
{
|
{
|
||||||
cb (".reg", HPPANBSD_SIZEOF_GREGS, &hppanbsd_gregset, NULL, cb_data);
|
cb (".reg", HPPANBSD_SIZEOF_GREGS, HPPANBSD_SIZEOF_GREGS, &hppanbsd_gregset,
|
||||||
|
NULL, cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -149,8 +149,10 @@ hppaobsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
void *cb_data,
|
void *cb_data,
|
||||||
const struct regcache *regcache)
|
const struct regcache *regcache)
|
||||||
{
|
{
|
||||||
cb (".reg", HPPAOBSD_SIZEOF_GREGS, &hppaobsd_gregset, NULL, cb_data);
|
cb (".reg", HPPAOBSD_SIZEOF_GREGS, HPPAOBSD_SIZEOF_GREGS, &hppaobsd_gregset,
|
||||||
cb (".reg2", HPPAOBSD_SIZEOF_FPREGS, &hppaobsd_fpregset, NULL, cb_data);
|
NULL, cb_data);
|
||||||
|
cb (".reg2", HPPAOBSD_SIZEOF_FPREGS, HPPAOBSD_SIZEOF_FPREGS,
|
||||||
|
&hppaobsd_fpregset, NULL, cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -309,12 +309,15 @@ i386fbsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
{
|
{
|
||||||
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
||||||
|
|
||||||
cb (".reg", tdep->sizeof_gregset, &i386_gregset, NULL, cb_data);
|
cb (".reg", tdep->sizeof_gregset, tdep->sizeof_gregset, &i386_gregset, NULL,
|
||||||
cb (".reg2", tdep->sizeof_fpregset, &i386_fpregset, NULL, cb_data);
|
cb_data);
|
||||||
|
cb (".reg2", tdep->sizeof_fpregset, tdep->sizeof_fpregset, &i386_fpregset,
|
||||||
|
NULL, cb_data);
|
||||||
|
|
||||||
if (tdep->xcr0 & X86_XSTATE_AVX)
|
if (tdep->xcr0 & X86_XSTATE_AVX)
|
||||||
cb (".reg-xstate", X86_XSTATE_SIZE(tdep->xcr0),
|
cb (".reg-xstate", X86_XSTATE_SIZE (tdep->xcr0),
|
||||||
&i386fbsd_xstateregset, "XSAVE extended state", cb_data);
|
X86_XSTATE_SIZE (tdep->xcr0), &i386fbsd_xstateregset,
|
||||||
|
"XSAVE extended state", cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -764,16 +764,17 @@ i386_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
{
|
{
|
||||||
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
||||||
|
|
||||||
cb (".reg", 68, &i386_gregset, NULL, cb_data);
|
cb (".reg", 68, 68, &i386_gregset, NULL, cb_data);
|
||||||
|
|
||||||
if (tdep->xcr0 & X86_XSTATE_AVX)
|
if (tdep->xcr0 & X86_XSTATE_AVX)
|
||||||
cb (".reg-xstate", X86_XSTATE_SIZE (tdep->xcr0),
|
cb (".reg-xstate", X86_XSTATE_SIZE (tdep->xcr0),
|
||||||
&i386_linux_xstateregset, "XSAVE extended state", cb_data);
|
X86_XSTATE_SIZE (tdep->xcr0), &i386_linux_xstateregset,
|
||||||
|
"XSAVE extended state", cb_data);
|
||||||
else if (tdep->xcr0 & X86_XSTATE_SSE)
|
else if (tdep->xcr0 & X86_XSTATE_SSE)
|
||||||
cb (".reg-xfp", 512, &i386_fpregset, "extended floating-point",
|
cb (".reg-xfp", 512, 512, &i386_fpregset, "extended floating-point",
|
||||||
cb_data);
|
cb_data);
|
||||||
else
|
else
|
||||||
cb (".reg2", 108, &i386_fpregset, NULL, cb_data);
|
cb (".reg2", 108, 108, &i386_fpregset, NULL, cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Linux kernel shows PC value after the 'int $0x80' instruction even if
|
/* Linux kernel shows PC value after the 'int $0x80' instruction even if
|
||||||
|
|
|
@ -3910,9 +3910,11 @@ i386_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
{
|
{
|
||||||
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
||||||
|
|
||||||
cb (".reg", tdep->sizeof_gregset, &i386_gregset, NULL, cb_data);
|
cb (".reg", tdep->sizeof_gregset, tdep->sizeof_gregset, &i386_gregset, NULL,
|
||||||
|
cb_data);
|
||||||
if (tdep->sizeof_fpregset)
|
if (tdep->sizeof_fpregset)
|
||||||
cb (".reg2", tdep->sizeof_fpregset, tdep->fpregset, NULL, cb_data);
|
cb (".reg2", tdep->sizeof_fpregset, tdep->sizeof_fpregset, tdep->fpregset,
|
||||||
|
NULL, cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -207,8 +207,10 @@ ia64_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
void *cb_data,
|
void *cb_data,
|
||||||
const struct regcache *regcache)
|
const struct regcache *regcache)
|
||||||
{
|
{
|
||||||
cb (".reg", IA64_LINUX_GREGS_SIZE, &ia64_linux_gregset, NULL, cb_data);
|
cb (".reg", IA64_LINUX_GREGS_SIZE, IA64_LINUX_GREGS_SIZE, &ia64_linux_gregset,
|
||||||
cb (".reg2", IA64_LINUX_FPREGS_SIZE, &ia64_linux_fpregset, NULL, cb_data);
|
NULL, cb_data);
|
||||||
|
cb (".reg2", IA64_LINUX_FPREGS_SIZE, IA64_LINUX_FPREGS_SIZE,
|
||||||
|
&ia64_linux_fpregset, NULL, cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -1579,21 +1579,26 @@ struct linux_collect_regset_section_cb_data
|
||||||
regset in the corefile note section. */
|
regset in the corefile note section. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
linux_collect_regset_section_cb (const char *sect_name, int size,
|
linux_collect_regset_section_cb (const char *sect_name, int supply_size,
|
||||||
const struct regset *regset,
|
int collect_size, const struct regset *regset,
|
||||||
const char *human_name, void *cb_data)
|
const char *human_name, void *cb_data)
|
||||||
{
|
{
|
||||||
char *buf;
|
char *buf;
|
||||||
struct linux_collect_regset_section_cb_data *data
|
struct linux_collect_regset_section_cb_data *data
|
||||||
= (struct linux_collect_regset_section_cb_data *) cb_data;
|
= (struct linux_collect_regset_section_cb_data *) cb_data;
|
||||||
|
bool variable_size_section = (regset != NULL
|
||||||
|
&& regset->flags & REGSET_VARIABLE_SIZE);
|
||||||
|
|
||||||
|
if (!variable_size_section)
|
||||||
|
gdb_assert (supply_size == collect_size);
|
||||||
|
|
||||||
if (data->abort_iteration)
|
if (data->abort_iteration)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
gdb_assert (regset && regset->collect_regset);
|
gdb_assert (regset && regset->collect_regset);
|
||||||
|
|
||||||
buf = (char *) xmalloc (size);
|
buf = (char *) xmalloc (collect_size);
|
||||||
regset->collect_regset (regset, data->regcache, -1, buf, size);
|
regset->collect_regset (regset, data->regcache, -1, buf, collect_size);
|
||||||
|
|
||||||
/* PRSTATUS still needs to be treated specially. */
|
/* PRSTATUS still needs to be treated specially. */
|
||||||
if (strcmp (sect_name, ".reg") == 0)
|
if (strcmp (sect_name, ".reg") == 0)
|
||||||
|
@ -1603,7 +1608,7 @@ linux_collect_regset_section_cb (const char *sect_name, int size,
|
||||||
else
|
else
|
||||||
data->note_data = (char *) elfcore_write_register_note
|
data->note_data = (char *) elfcore_write_register_note
|
||||||
(data->obfd, data->note_data, data->note_size,
|
(data->obfd, data->note_data, data->note_size,
|
||||||
sect_name, buf, size);
|
sect_name, buf, collect_size);
|
||||||
xfree (buf);
|
xfree (buf);
|
||||||
|
|
||||||
if (data->note_data == NULL)
|
if (data->note_data == NULL)
|
||||||
|
|
|
@ -440,7 +440,8 @@ m32r_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
void *cb_data,
|
void *cb_data,
|
||||||
const struct regcache *regcache)
|
const struct regcache *regcache)
|
||||||
{
|
{
|
||||||
cb (".reg", M32R_LINUX_GREGS_SIZE, &m32r_linux_gregset, NULL, cb_data);
|
cb (".reg", M32R_LINUX_GREGS_SIZE, M32R_LINUX_GREGS_SIZE, &m32r_linux_gregset,
|
||||||
|
NULL, cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -123,8 +123,10 @@ m68kbsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
void *cb_data,
|
void *cb_data,
|
||||||
const struct regcache *regcache)
|
const struct regcache *regcache)
|
||||||
{
|
{
|
||||||
cb (".reg", M68KBSD_SIZEOF_GREGS, &m68kbsd_gregset, NULL, cb_data);
|
cb (".reg", M68KBSD_SIZEOF_GREGS, M68KBSD_SIZEOF_GREGS, &m68kbsd_gregset,
|
||||||
cb (".reg2", M68KBSD_SIZEOF_FPREGS, &m68kbsd_fpregset, NULL, cb_data);
|
NULL, cb_data);
|
||||||
|
cb (".reg2", M68KBSD_SIZEOF_FPREGS, M68KBSD_SIZEOF_FPREGS, &m68kbsd_fpregset,
|
||||||
|
NULL, cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -374,8 +374,10 @@ m68k_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
void *cb_data,
|
void *cb_data,
|
||||||
const struct regcache *regcache)
|
const struct regcache *regcache)
|
||||||
{
|
{
|
||||||
cb (".reg", M68K_LINUX_GREGS_SIZE, &m68k_linux_gregset, NULL, cb_data);
|
cb (".reg", M68K_LINUX_GREGS_SIZE, M68K_LINUX_GREGS_SIZE, &m68k_linux_gregset,
|
||||||
cb (".reg2", M68K_LINUX_FPREGS_SIZE, &m68k_linux_fpregset, NULL, cb_data);
|
NULL, cb_data);
|
||||||
|
cb (".reg2", M68K_LINUX_FPREGS_SIZE, M68K_LINUX_FPREGS_SIZE,
|
||||||
|
&m68k_linux_fpregset, NULL, cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -245,10 +245,10 @@ mips_fbsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
{
|
{
|
||||||
size_t regsize = mips_abi_regsize (gdbarch);
|
size_t regsize = mips_abi_regsize (gdbarch);
|
||||||
|
|
||||||
cb (".reg", MIPS_FBSD_NUM_GREGS * regsize, &mips_fbsd_gregset,
|
cb (".reg", MIPS_FBSD_NUM_GREGS * regsize, MIPS_FBSD_NUM_GREGS * regsize,
|
||||||
NULL, cb_data);
|
&mips_fbsd_gregset, NULL, cb_data);
|
||||||
cb (".reg2", MIPS_FBSD_NUM_FPREGS * regsize, &mips_fbsd_fpregset,
|
cb (".reg2", MIPS_FBSD_NUM_FPREGS * regsize, MIPS_FBSD_NUM_FPREGS * regsize,
|
||||||
NULL, cb_data);
|
&mips_fbsd_fpregset, NULL, cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Signal trampoline support. */
|
/* Signal trampoline support. */
|
||||||
|
|
|
@ -537,16 +537,18 @@ mips_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
{
|
{
|
||||||
if (register_size (gdbarch, MIPS_ZERO_REGNUM) == 4)
|
if (register_size (gdbarch, MIPS_ZERO_REGNUM) == 4)
|
||||||
{
|
{
|
||||||
cb (".reg", sizeof (mips_elf_gregset_t), &mips_linux_gregset,
|
cb (".reg", sizeof (mips_elf_gregset_t), sizeof (mips_elf_gregset_t),
|
||||||
NULL, cb_data);
|
&mips_linux_gregset, NULL, cb_data);
|
||||||
cb (".reg2", sizeof (mips64_elf_fpregset_t), &mips64_linux_fpregset,
|
cb (".reg2", sizeof (mips64_elf_fpregset_t),
|
||||||
|
sizeof (mips64_elf_fpregset_t), &mips64_linux_fpregset,
|
||||||
NULL, cb_data);
|
NULL, cb_data);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cb (".reg", sizeof (mips64_elf_gregset_t), &mips64_linux_gregset,
|
cb (".reg", sizeof (mips64_elf_gregset_t), sizeof (mips64_elf_gregset_t),
|
||||||
NULL, cb_data);
|
&mips64_linux_gregset, NULL, cb_data);
|
||||||
cb (".reg2", sizeof (mips64_elf_fpregset_t), &mips64_linux_fpregset,
|
cb (".reg2", sizeof (mips64_elf_fpregset_t),
|
||||||
|
sizeof (mips64_elf_fpregset_t), &mips64_linux_fpregset,
|
||||||
NULL, cb_data);
|
NULL, cb_data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,10 +123,10 @@ mipsnbsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
{
|
{
|
||||||
size_t regsize = mips_isa_regsize (gdbarch);
|
size_t regsize = mips_isa_regsize (gdbarch);
|
||||||
|
|
||||||
cb (".reg", MIPSNBSD_NUM_GREGS * regsize, &mipsnbsd_gregset,
|
cb (".reg", MIPSNBSD_NUM_GREGS * regsize, MIPSNBSD_NUM_GREGS * regsize,
|
||||||
NULL, cb_data);
|
&mipsnbsd_gregset, NULL, cb_data);
|
||||||
cb (".reg2", MIPSNBSD_NUM_FPREGS * regsize, &mipsnbsd_fpregset,
|
cb (".reg2", MIPSNBSD_NUM_FPREGS * regsize, MIPSNBSD_NUM_FPREGS * regsize,
|
||||||
NULL, cb_data);
|
&mipsnbsd_fpregset, NULL, cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,8 @@ mips64obsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
void *cb_data,
|
void *cb_data,
|
||||||
const struct regcache *regcache)
|
const struct regcache *regcache)
|
||||||
{
|
{
|
||||||
cb (".reg", MIPS64OBSD_NUM_REGS * 8, &mips64obsd_gregset, NULL, cb_data);
|
cb (".reg", MIPS64OBSD_NUM_REGS * 8, MIPS64OBSD_NUM_REGS * 8,
|
||||||
|
&mips64obsd_gregset, NULL, cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -455,10 +455,10 @@ am33_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
void *cb_data,
|
void *cb_data,
|
||||||
const struct regcache *regcache)
|
const struct regcache *regcache)
|
||||||
{
|
{
|
||||||
cb (".reg", sizeof (mn10300_elf_gregset_t), &am33_gregset,
|
cb (".reg", sizeof (mn10300_elf_gregset_t), sizeof (mn10300_elf_gregset_t),
|
||||||
NULL, cb_data);
|
&am33_gregset, NULL, cb_data);
|
||||||
cb (".reg2", sizeof(mn10300_elf_fpregset_t), &am33_fpregset,
|
cb (".reg2", sizeof (mn10300_elf_fpregset_t), sizeof (mn10300_elf_fpregset_t),
|
||||||
NULL, cb_data);
|
&am33_fpregset, NULL, cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -106,7 +106,8 @@ nios2_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
void *cb_data,
|
void *cb_data,
|
||||||
const struct regcache *regcache)
|
const struct regcache *regcache)
|
||||||
{
|
{
|
||||||
cb (".reg", NIOS2_GREGS_SIZE, &nios2_core_regset, NULL, cb_data);
|
cb (".reg", NIOS2_GREGS_SIZE, NIOS2_GREGS_SIZE, &nios2_core_regset, NULL,
|
||||||
|
cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize a trad-frame cache corresponding to the tramp-frame.
|
/* Initialize a trad-frame cache corresponding to the tramp-frame.
|
||||||
|
|
|
@ -128,10 +128,10 @@ ppcfbsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
||||||
|
|
||||||
if (tdep->wordsize == 4)
|
if (tdep->wordsize == 4)
|
||||||
cb (".reg", 148, &ppc32_fbsd_gregset, NULL, cb_data);
|
cb (".reg", 148, 148, &ppc32_fbsd_gregset, NULL, cb_data);
|
||||||
else
|
else
|
||||||
cb (".reg", 296, &ppc64_fbsd_gregset, NULL, cb_data);
|
cb (".reg", 296, 296, &ppc64_fbsd_gregset, NULL, cb_data);
|
||||||
cb (".reg2", 264, &ppc32_fbsd_fpregset, NULL, cb_data);
|
cb (".reg2", 264, 264, &ppc32_fbsd_fpregset, NULL, cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Default page size. */
|
/* Default page size. */
|
||||||
|
|
|
@ -605,21 +605,21 @@ ppc_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
int have_vsx = tdep->ppc_vsr0_upper_regnum != -1;
|
int have_vsx = tdep->ppc_vsr0_upper_regnum != -1;
|
||||||
|
|
||||||
if (tdep->wordsize == 4)
|
if (tdep->wordsize == 4)
|
||||||
cb (".reg", 48 * 4, &ppc32_linux_gregset, NULL, cb_data);
|
cb (".reg", 48 * 4, 48 * 4, &ppc32_linux_gregset, NULL, cb_data);
|
||||||
else
|
else
|
||||||
cb (".reg", 48 * 8, &ppc64_linux_gregset, NULL, cb_data);
|
cb (".reg", 48 * 8, 48 * 8, &ppc64_linux_gregset, NULL, cb_data);
|
||||||
|
|
||||||
cb (".reg2", 264, &ppc32_linux_fpregset, NULL, cb_data);
|
cb (".reg2", 264, 264, &ppc32_linux_fpregset, NULL, cb_data);
|
||||||
|
|
||||||
if (have_altivec)
|
if (have_altivec)
|
||||||
{
|
{
|
||||||
const struct regset *vrregset = ppc_linux_vrregset (gdbarch);
|
const struct regset *vrregset = ppc_linux_vrregset (gdbarch);
|
||||||
cb (".reg-ppc-vmx", PPC_LINUX_SIZEOF_VRREGSET, vrregset,
|
cb (".reg-ppc-vmx", PPC_LINUX_SIZEOF_VRREGSET, PPC_LINUX_SIZEOF_VRREGSET,
|
||||||
"ppc Altivec", cb_data);
|
vrregset, "ppc Altivec", cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (have_vsx)
|
if (have_vsx)
|
||||||
cb (".reg-ppc-vsx", PPC_LINUX_SIZEOF_VSXREGSET,
|
cb (".reg-ppc-vsx", PPC_LINUX_SIZEOF_VSXREGSET, PPC_LINUX_SIZEOF_VSXREGSET,
|
||||||
&ppc32_linux_vsxregset, "POWER7 VSX", cb_data);
|
&ppc32_linux_vsxregset, "POWER7 VSX", cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,8 +59,8 @@ ppcnbsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
void *cb_data,
|
void *cb_data,
|
||||||
const struct regcache *regcache)
|
const struct regcache *regcache)
|
||||||
{
|
{
|
||||||
cb (".reg", 148, &ppcnbsd_gregset, NULL, cb_data);
|
cb (".reg", 148, 148, &ppcnbsd_gregset, NULL, cb_data);
|
||||||
cb (".reg2", 264, &ppcnbsd_fpregset, NULL, cb_data);
|
cb (".reg2", 264, 264, &ppcnbsd_fpregset, NULL, cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@ ppcobsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
void *cb_data,
|
void *cb_data,
|
||||||
const struct regcache *regcache)
|
const struct regcache *regcache)
|
||||||
{
|
{
|
||||||
cb (".reg", 412, &ppcobsd_gregset, NULL, cb_data);
|
cb (".reg", 412, 412, &ppcobsd_gregset, NULL, cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ riscv_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
void *cb_data,
|
void *cb_data,
|
||||||
const struct regcache *regcache)
|
const struct regcache *regcache)
|
||||||
{
|
{
|
||||||
cb (".reg", (32 * riscv_isa_xlen (gdbarch)),
|
cb (".reg", (32 * riscv_isa_xlen (gdbarch)), (32 * riscv_isa_xlen (gdbarch)),
|
||||||
&riscv_linux_gregset, NULL, cb_data);
|
&riscv_linux_gregset, NULL, cb_data);
|
||||||
|
|
||||||
/* TODO: Add FP register support. */
|
/* TODO: Add FP register support. */
|
||||||
|
|
|
@ -146,9 +146,9 @@ rs6000_aix_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
const struct regcache *regcache)
|
const struct regcache *regcache)
|
||||||
{
|
{
|
||||||
if (gdbarch_tdep (gdbarch)->wordsize == 4)
|
if (gdbarch_tdep (gdbarch)->wordsize == 4)
|
||||||
cb (".reg", 592, &rs6000_aix32_regset, NULL, cb_data);
|
cb (".reg", 592, 592, &rs6000_aix32_regset, NULL, cb_data);
|
||||||
else
|
else
|
||||||
cb (".reg", 576, &rs6000_aix64_regset, NULL, cb_data);
|
cb (".reg", 576, 576, &rs6000_aix64_regset, NULL, cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -273,21 +273,22 @@ s390_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
const int gregset_size = (tdep->abi == ABI_LINUX_S390 ?
|
const int gregset_size = (tdep->abi == ABI_LINUX_S390 ?
|
||||||
s390_sizeof_gregset : s390x_sizeof_gregset);
|
s390_sizeof_gregset : s390x_sizeof_gregset);
|
||||||
|
|
||||||
cb (".reg", gregset_size, &s390_gregset, NULL, cb_data);
|
cb (".reg", gregset_size, gregset_size, &s390_gregset, NULL, cb_data);
|
||||||
cb (".reg2", s390_sizeof_fpregset, &s390_fpregset, NULL, cb_data);
|
cb (".reg2", s390_sizeof_fpregset, s390_sizeof_fpregset, &s390_fpregset, NULL,
|
||||||
|
cb_data);
|
||||||
|
|
||||||
if (tdep->abi == ABI_LINUX_S390 && tdep->gpr_full_regnum != -1)
|
if (tdep->abi == ABI_LINUX_S390 && tdep->gpr_full_regnum != -1)
|
||||||
cb (".reg-s390-high-gprs", 16 * 4, &s390_upper_regset,
|
cb (".reg-s390-high-gprs", 16 * 4, 16 * 4, &s390_upper_regset,
|
||||||
"s390 GPR upper halves", cb_data);
|
"s390 GPR upper halves", cb_data);
|
||||||
|
|
||||||
if (tdep->have_linux_v1)
|
if (tdep->have_linux_v1)
|
||||||
cb (".reg-s390-last-break", 8,
|
cb (".reg-s390-last-break", 8, 8,
|
||||||
(gdbarch_ptr_bit (gdbarch) == 32
|
(gdbarch_ptr_bit (gdbarch) == 32
|
||||||
? &s390_last_break_regset : &s390x_last_break_regset),
|
? &s390_last_break_regset : &s390x_last_break_regset),
|
||||||
"s390 last-break address", cb_data);
|
"s390 last-break address", cb_data);
|
||||||
|
|
||||||
if (tdep->have_linux_v2)
|
if (tdep->have_linux_v2)
|
||||||
cb (".reg-s390-system-call", 4, &s390_system_call_regset,
|
cb (".reg-s390-system-call", 4, 4, &s390_system_call_regset,
|
||||||
"s390 system-call", cb_data);
|
"s390 system-call", cb_data);
|
||||||
|
|
||||||
/* If regcache is set, we are in "write" (gcore) mode. In this
|
/* If regcache is set, we are in "write" (gcore) mode. In this
|
||||||
|
@ -297,14 +298,14 @@ s390_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
&& (regcache == NULL
|
&& (regcache == NULL
|
||||||
|| (REG_VALID
|
|| (REG_VALID
|
||||||
== regcache->get_register_status (S390_TDB_DWORD0_REGNUM))))
|
== regcache->get_register_status (S390_TDB_DWORD0_REGNUM))))
|
||||||
cb (".reg-s390-tdb", s390_sizeof_tdbregset, &s390_tdb_regset,
|
cb (".reg-s390-tdb", s390_sizeof_tdbregset, s390_sizeof_tdbregset,
|
||||||
"s390 TDB", cb_data);
|
&s390_tdb_regset, "s390 TDB", cb_data);
|
||||||
|
|
||||||
if (tdep->v0_full_regnum != -1)
|
if (tdep->v0_full_regnum != -1)
|
||||||
{
|
{
|
||||||
cb (".reg-s390-vxrs-low", 16 * 8, &s390_vxrs_low_regset,
|
cb (".reg-s390-vxrs-low", 16 * 8, 16 * 8, &s390_vxrs_low_regset,
|
||||||
"s390 vector registers 0-15 lower half", cb_data);
|
"s390 vector registers 0-15 lower half", cb_data);
|
||||||
cb (".reg-s390-vxrs-high", 16 * 16, &s390_vxrs_high_regset,
|
cb (".reg-s390-vxrs-high", 16 * 16, 16 * 16, &s390_vxrs_high_regset,
|
||||||
"s390 vector registers 16-31", cb_data);
|
"s390 vector registers 16-31", cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -314,12 +315,12 @@ s390_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
{
|
{
|
||||||
if (regcache == NULL
|
if (regcache == NULL
|
||||||
|| REG_VALID == regcache->get_register_status (S390_GSD_REGNUM))
|
|| REG_VALID == regcache->get_register_status (S390_GSD_REGNUM))
|
||||||
cb (".reg-s390-gs-cb", 4 * 8, &s390_gs_regset,
|
cb (".reg-s390-gs-cb", 4 * 8, 4 * 8, &s390_gs_regset,
|
||||||
"s390 guarded-storage registers", cb_data);
|
"s390 guarded-storage registers", cb_data);
|
||||||
|
|
||||||
if (regcache == NULL
|
if (regcache == NULL
|
||||||
|| REG_VALID == regcache->get_register_status (S390_BC_GSD_REGNUM))
|
|| REG_VALID == regcache->get_register_status (S390_BC_GSD_REGNUM))
|
||||||
cb (".reg-s390-gs-bc", 4 * 8, &s390_gsbc_regset,
|
cb (".reg-s390-gs-bc", 4 * 8, 4 * 8, &s390_gsbc_regset,
|
||||||
"s390 guarded-storage broadcast control", cb_data);
|
"s390 guarded-storage broadcast control", cb_data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1447,8 +1447,8 @@ score7_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
void *cb_data,
|
void *cb_data,
|
||||||
const struct regcache *regcache)
|
const struct regcache *regcache)
|
||||||
{
|
{
|
||||||
cb (".reg", SCORE7_LINUX_SIZEOF_GREGSET, &score7_linux_gregset,
|
cb (".reg", SCORE7_LINUX_SIZEOF_GREGSET, SCORE7_LINUX_SIZEOF_GREGSET,
|
||||||
NULL, cb_data);
|
&score7_linux_gregset, NULL, cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct gdbarch *
|
static struct gdbarch *
|
||||||
|
|
|
@ -2232,10 +2232,12 @@ sh_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
||||||
|
|
||||||
if (tdep->core_gregmap != NULL)
|
if (tdep->core_gregmap != NULL)
|
||||||
cb (".reg", tdep->sizeof_gregset, &sh_corefile_gregset, NULL, cb_data);
|
cb (".reg", tdep->sizeof_gregset, tdep->sizeof_gregset,
|
||||||
|
&sh_corefile_gregset, NULL, cb_data);
|
||||||
|
|
||||||
if (tdep->core_fpregmap != NULL)
|
if (tdep->core_fpregmap != NULL)
|
||||||
cb (".reg2", tdep->sizeof_fpregset, &sh_corefile_fpregset, NULL, cb_data);
|
cb (".reg2", tdep->sizeof_fpregset, tdep->sizeof_fpregset,
|
||||||
|
&sh_corefile_fpregset, NULL, cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This is the implementation of gdbarch method
|
/* This is the implementation of gdbarch method
|
||||||
|
|
|
@ -1777,8 +1777,10 @@ sparc_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
{
|
{
|
||||||
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
||||||
|
|
||||||
cb (".reg", tdep->sizeof_gregset, tdep->gregset, NULL, cb_data);
|
cb (".reg", tdep->sizeof_gregset, tdep->sizeof_gregset, tdep->gregset, NULL,
|
||||||
cb (".reg2", tdep->sizeof_fpregset, tdep->fpregset, NULL, cb_data);
|
cb_data);
|
||||||
|
cb (".reg2", tdep->sizeof_fpregset, tdep->sizeof_fpregset, tdep->fpregset,
|
||||||
|
NULL, cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -99,8 +99,8 @@ tilegx_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
void *cb_data,
|
void *cb_data,
|
||||||
const struct regcache *regcache)
|
const struct regcache *regcache)
|
||||||
{
|
{
|
||||||
cb (".reg", TILEGX_LINUX_SIZEOF_GREGSET, &tilegx_linux_regset,
|
cb (".reg", TILEGX_LINUX_SIZEOF_GREGSET, TILEGX_LINUX_SIZEOF_GREGSET,
|
||||||
NULL, cb_data);
|
&tilegx_linux_regset, NULL, cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* OS specific initialization of gdbarch. */
|
/* OS specific initialization of gdbarch. */
|
||||||
|
|
|
@ -96,7 +96,7 @@ vax_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
void *cb_data,
|
void *cb_data,
|
||||||
const struct regcache *regcache)
|
const struct regcache *regcache)
|
||||||
{
|
{
|
||||||
cb (".reg", VAX_NUM_REGS * 4, &vax_gregset, NULL, cb_data);
|
cb (".reg", VAX_NUM_REGS * 4, VAX_NUM_REGS * 4, &vax_gregset, NULL, cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The VAX UNIX calling convention uses R1 to pass a structure return
|
/* The VAX UNIX calling convention uses R1 to pass a structure return
|
||||||
|
|
|
@ -902,8 +902,8 @@ xtensa_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||||
{
|
{
|
||||||
DEBUGTRACE ("xtensa_iterate_over_regset_sections\n");
|
DEBUGTRACE ("xtensa_iterate_over_regset_sections\n");
|
||||||
|
|
||||||
cb (".reg", sizeof (xtensa_elf_gregset_t), &xtensa_gregset,
|
cb (".reg", sizeof (xtensa_elf_gregset_t), sizeof (xtensa_elf_gregset_t),
|
||||||
NULL, cb_data);
|
&xtensa_gregset, NULL, cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue