+2015-02-04 Andreas Arnez <arnez@linux.vnet.ibm.com>
+
+ PR corefiles/17808:
+ * gdbarch.sh (iterate_over_regset_sections_cb): Document this
+ function type, particularly its SIZE parameter.
+ * gdbarch.h: Regenerate.
+ * amd64-tdep.c (amd64_supply_fpregset): In gdb_assert, compare
+ actual against required size using ">=" instead of "==".
+ (amd64_collect_fpregset): Likewise.
+ * i386-tdep.c (i386_supply_gregset): Likewise.
+ (i386_collect_gregset): Likewise.
+ (i386_supply_fpregset): Likewise.
+ (i386_collect_fpregset): Likewise.
+ * mips-linux-tdep.c (mips_supply_gregset_wrapper): Likewise.
+ (mips_fill_gregset_wrapper): Likewise.
+ (mips_supply_fpregset_wrapper): Likewise.
+ (mips_fill_fpregset_wrapper): Likewise.
+ (mips64_supply_gregset_wrapper): Likewise.
+ (mips64_fill_gregset_wrapper): Likewise.
+ (mips64_supply_fpregset_wrapper): Likewise.
+ (mips64_fill_fpregset_wrapper): Likewise.
+ * mn10300-linux-tdep.c (am33_supply_gregset_method): Likewise.
+ (am33_supply_fpregset_method): Likewise.
+ (am33_collect_gregset_method): Likewise.
+ (am33_collect_fpregset_method): Likewise.
+
2015-02-04 Doug Evans <dje@google.com>
Pedro Alves <palves@redhat.com>
Eli Zaretskii <eliz@gnu.org>
struct gdbarch *gdbarch = get_regcache_arch (regcache);
const struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
- gdb_assert (len == tdep->sizeof_fpregset);
+ gdb_assert (len >= tdep->sizeof_fpregset);
amd64_supply_fxsave (regcache, regnum, fpregs);
}
struct gdbarch *gdbarch = get_regcache_arch (regcache);
const struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
- gdb_assert (len == tdep->sizeof_fpregset);
+ gdb_assert (len >= tdep->sizeof_fpregset);
amd64_collect_fxsave (regcache, regnum, fpregs);
}
typedef int (iterate_over_objfiles_in_search_order_cb_ftype)
(struct objfile *objfile, void *cb_data);
+/* Callback type for regset section iterators. The callback usually
+ 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
+ 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)
(const char *sect_name, int size, const struct regset *regset,
const char *human_name, void *cb_data);
typedef int (iterate_over_objfiles_in_search_order_cb_ftype)
(struct objfile *objfile, void *cb_data);
+/* Callback type for regset section iterators. The callback usually
+ 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
+ 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)
(const char *sect_name, int size, const struct regset *regset,
const char *human_name, void *cb_data);
const gdb_byte *regs = gregs;
int i;
- gdb_assert (len == tdep->sizeof_gregset);
+ gdb_assert (len >= tdep->sizeof_gregset);
for (i = 0; i < tdep->gregset_num_regs; i++)
{
gdb_byte *regs = gregs;
int i;
- gdb_assert (len == tdep->sizeof_gregset);
+ gdb_assert (len >= tdep->sizeof_gregset);
for (i = 0; i < tdep->gregset_num_regs; i++)
{
return;
}
- gdb_assert (len == tdep->sizeof_fpregset);
+ gdb_assert (len >= tdep->sizeof_fpregset);
i387_supply_fsave (regcache, regnum, fpregs);
}
return;
}
- gdb_assert (len == tdep->sizeof_fpregset);
+ gdb_assert (len >= tdep->sizeof_fpregset);
i387_collect_fsave (regcache, regnum, fpregs);
}
struct regcache *regcache,
int regnum, const void *gregs, size_t len)
{
- gdb_assert (len == sizeof (mips_elf_gregset_t));
+ gdb_assert (len >= sizeof (mips_elf_gregset_t));
mips_supply_gregset (regcache, (const mips_elf_gregset_t *)gregs);
}
const struct regcache *regcache,
int regnum, void *gregs, size_t len)
{
- gdb_assert (len == sizeof (mips_elf_gregset_t));
+ gdb_assert (len >= sizeof (mips_elf_gregset_t));
mips_fill_gregset (regcache, (mips_elf_gregset_t *)gregs, regnum);
}
struct regcache *regcache,
int regnum, const void *gregs, size_t len)
{
- gdb_assert (len == sizeof (mips_elf_fpregset_t));
+ gdb_assert (len >= sizeof (mips_elf_fpregset_t));
mips_supply_fpregset (regcache, (const mips_elf_fpregset_t *)gregs);
}
const struct regcache *regcache,
int regnum, void *gregs, size_t len)
{
- gdb_assert (len == sizeof (mips_elf_fpregset_t));
+ gdb_assert (len >= sizeof (mips_elf_fpregset_t));
mips_fill_fpregset (regcache, (mips_elf_fpregset_t *)gregs, regnum);
}
struct regcache *regcache,
int regnum, const void *gregs, size_t len)
{
- gdb_assert (len == sizeof (mips64_elf_gregset_t));
+ gdb_assert (len >= sizeof (mips64_elf_gregset_t));
mips64_supply_gregset (regcache, (const mips64_elf_gregset_t *)gregs);
}
const struct regcache *regcache,
int regnum, void *gregs, size_t len)
{
- gdb_assert (len == sizeof (mips64_elf_gregset_t));
+ gdb_assert (len >= sizeof (mips64_elf_gregset_t));
mips64_fill_gregset (regcache, (mips64_elf_gregset_t *)gregs, regnum);
}
struct regcache *regcache,
int regnum, const void *gregs, size_t len)
{
- gdb_assert (len == sizeof (mips64_elf_fpregset_t));
+ gdb_assert (len >= sizeof (mips64_elf_fpregset_t));
mips64_supply_fpregset (regcache, (const mips64_elf_fpregset_t *)gregs);
}
const struct regcache *regcache,
int regnum, void *gregs, size_t len)
{
- gdb_assert (len == sizeof (mips64_elf_fpregset_t));
+ gdb_assert (len >= sizeof (mips64_elf_fpregset_t));
mips64_fill_fpregset (regcache, (mips64_elf_fpregset_t *)gregs, regnum);
}
const mn10300_elf_greg_t *regp = (const mn10300_elf_greg_t *) gregs;
int i;
- gdb_assert (len == sizeof (mn10300_elf_gregset_t));
+ gdb_assert (len >= sizeof (mn10300_elf_gregset_t));
switch (regnum) {
case E_D0_REGNUM:
{
const mn10300_elf_fpregset_t *fpregset = fpregs;
- gdb_assert (len == sizeof (mn10300_elf_fpregset_t));
+ gdb_assert (len >= sizeof (mn10300_elf_fpregset_t));
if (regnum == -1)
{
mn10300_elf_gregset_t *regp = gregs;
int i;
- gdb_assert (len == sizeof (mn10300_elf_gregset_t));
+ gdb_assert (len >= sizeof (mn10300_elf_gregset_t));
switch (regnum) {
case E_D0_REGNUM:
{
mn10300_elf_fpregset_t *fpregset = fpregs;
- gdb_assert (len == sizeof (mn10300_elf_fpregset_t));
+ gdb_assert (len >= sizeof (mn10300_elf_fpregset_t));
if (regnum == -1)
{