/* Target-dependent code for GNU/Linux running on the Fujitsu FR-V,
for GDB.
- Copyright (C) 2004-2014 Free Software Foundation, Inc.
+ Copyright (C) 2004-2019 Free Software Foundation, Inc.
This file is part of GDB.
#include "frame-unwind.h"
#include "regset.h"
#include "linux-tdep.h"
+#include "gdbarch.h"
/* Define the size (in bytes) of an FR-V instruction. */
static const int frv_instr_size = 4;
void **this_cache)
{
struct gdbarch *gdbarch = get_frame_arch (this_frame);
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
struct trad_frame_cache *cache;
CORE_ADDR addr;
struct frame_id this_id;
if (*this_cache)
- return *this_cache;
+ return (struct trad_frame_cache *) *this_cache;
cache = trad_frame_cache_zalloc (this_frame);
int regnum, const void *gregs, size_t len)
{
int regi;
- char zerobuf[MAX_REGISTER_SIZE];
-
- memset (zerobuf, 0, MAX_REGISTER_SIZE);
/* gr0 always contains 0. Also, the kernel passes the TBR value in
this slot. */
- regcache_raw_supply (regcache, first_gpr_regnum, zerobuf);
+ regcache->raw_supply_zeroed (first_gpr_regnum);
/* Fill gr32, ..., gr63 with zeros. */
for (regi = first_gpr_regnum + 32; regi <= last_gpr_regnum; regi++)
- regcache_raw_supply (regcache, regi, zerobuf);
+ regcache->raw_supply_zeroed (regi);
regcache_supply_regset (regset, regcache, regnum, gregs, len);
}
regcache_supply_regset, regcache_collect_regset
};
-static const struct regset *
-frv_linux_regset_from_core_section (struct gdbarch *gdbarch,
- const char *sect_name, size_t sect_size)
+static void
+frv_linux_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 >= sizeof (frv_elf_gregset_t))
- return &frv_linux_gregset;
-
- if (strcmp (sect_name, ".reg2") == 0
- && sect_size >= sizeof (frv_elf_fpregset_t))
- return &frv_linux_fpregset;
-
- return NULL;
+ cb (".reg", sizeof (frv_elf_gregset_t), sizeof (frv_elf_gregset_t),
+ &frv_linux_gregset, NULL, cb_data);
+ cb (".reg2", sizeof (frv_elf_fpregset_t), sizeof (frv_elf_fpregset_t),
+ &frv_linux_fpregset, NULL, cb_data);
}
\f
/* Set the sigtramp frame sniffer. */
frame_unwind_append_unwinder (gdbarch, &frv_linux_sigtramp_frame_unwind);
- set_gdbarch_regset_from_core_section (gdbarch,
- frv_linux_regset_from_core_section);
+ set_gdbarch_iterate_over_regset_sections
+ (gdbarch, frv_linux_iterate_over_regset_sections);
}
static enum gdb_osabi
return GDB_OSABI_UNKNOWN;
}
-/* Provide a prototype to silence -Wmissing-prototypes. */
-void _initialize_frv_linux_tdep (void);
-
void
_initialize_frv_linux_tdep (void)
{