/* Target-dependent code for Motorola 68000 BSD's.
- Copyright (C) 2004-2014 Free Software Foundation, Inc.
+ Copyright (C) 2004-2015 Free Software Foundation, Inc.
This file is part of GDB.
#include "tramp-frame.h"
#include "gdbtypes.h"
-#include <string.h>
-
#include "m68k-tdep.h"
#include "solib-svr4.h"
static const struct regset m68kbsd_gregset =
{
NULL,
- m68kbsd_supply_gregset
+ m68kbsd_supply_gregset,
+ NULL,
+ REGSET_VARIABLE_SIZE
};
static const struct regset m68kbsd_fpregset =
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. */