/* Target-dependent code for Motorola 68000 BSD's.
- Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2004-2016 Free Software Foundation, Inc.
This file is part of GDB.
#include "tramp-frame.h"
#include "gdbtypes.h"
-#include "gdb_assert.h"
-#include "gdb_string.h"
-
#include "m68k-tdep.h"
#include "solib-svr4.h"
int regnum, const void *fpregs, size_t len)
{
struct gdbarch *gdbarch = get_regcache_arch (regcache);
- const gdb_byte *regs = fpregs;
+ const gdb_byte *regs = (const gdb_byte *) fpregs;
int i;
gdb_assert (len >= M68KBSD_SIZEOF_FPREGS);
struct regcache *regcache,
int regnum, const void *gregs, size_t len)
{
- const gdb_byte *regs = gregs;
+ const gdb_byte *regs = (const gdb_byte *) gregs;
int i;
gdb_assert (len >= M68KBSD_SIZEOF_GREGS);
/* Motorola 68000 register sets. */
-static struct regset m68kbsd_gregset =
+static const struct regset m68kbsd_gregset =
{
NULL,
- m68kbsd_supply_gregset
+ m68kbsd_supply_gregset,
+ NULL,
+ REGSET_VARIABLE_SIZE
};
-static struct regset m68kbsd_fpregset =
+static const struct regset m68kbsd_fpregset =
{
NULL,
m68kbsd_supply_fpregset
};
-/* Return the appropriate register set for the core section identified
- by SECT_NAME and SECT_SIZE. */
+/* Iterate over core file register note sections. */
-static const struct regset *
-m68kbsd_regset_from_core_section (struct gdbarch *gdbarch,
- const char *sect_name, size_t sect_size)
+static void
+m68kbsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
+ iterate_over_regset_sections_cb *cb,
+ void *cb_data,
+ const struct regcache *regcache)
{
- if (strcmp (sect_name, ".reg") == 0 && sect_size >= M68KBSD_SIZEOF_GREGS)
- return &m68kbsd_gregset;
-
- if (strcmp (sect_name, ".reg2") == 0 && sect_size >= M68KBSD_SIZEOF_FPREGS)
- return &m68kbsd_fpregset;
-
- return NULL;
+ cb (".reg", M68KBSD_SIZEOF_GREGS, &m68kbsd_gregset, NULL, cb_data);
+ cb (".reg2", M68KBSD_SIZEOF_FPREGS, &m68kbsd_fpregset, NULL, cb_data);
}
\f
set_gdbarch_decr_pc_after_break (gdbarch, 2);
- set_gdbarch_regset_from_core_section
- (gdbarch, m68kbsd_regset_from_core_section);
+ set_gdbarch_iterate_over_regset_sections
+ (gdbarch, m68kbsd_iterate_over_regset_sections);
}
/* OpenBSD and NetBSD a.out. */