X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gdb%2Fmips64obsd-tdep.c;h=11ff3579eb69f86411d076d89f76051a2ffc5791;hb=012d8ebc4bd1a1afb95d902604007b04762207f0;hp=92b6701e8feb4c8f6b57879d0a95900de841bd79;hpb=ecd75fc8eed3bde86036141228074a20e55dcfc9;p=platform%2Fupstream%2Fbinutils.git diff --git a/gdb/mips64obsd-tdep.c b/gdb/mips64obsd-tdep.c index 92b6701..11ff357 100644 --- a/gdb/mips64obsd-tdep.c +++ b/gdb/mips64obsd-tdep.c @@ -25,9 +25,7 @@ #include "trad-frame.h" #include "tramp-frame.h" -#include "gdb_assert.h" -#include - +#include "obsd-tdep.h" #include "mips-tdep.h" #include "solib-svr4.h" @@ -60,23 +58,21 @@ mips64obsd_supply_gregset (const struct regset *regset, /* OpenBSD/mips64 register set. */ -static struct regset mips64obsd_gregset = +static const struct regset mips64obsd_gregset = { NULL, mips64obsd_supply_gregset }; -/* 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 * -mips64obsd_regset_from_core_section (struct gdbarch *gdbarch, - const char *sect_name, size_t sect_size) +static void +mips64obsd_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 >= MIPS64OBSD_NUM_REGS * 8) - return &mips64obsd_gregset; - - return NULL; + cb (".reg", MIPS64OBSD_NUM_REGS * 8, &mips64obsd_gregset, NULL, cb_data); } @@ -147,14 +143,16 @@ mips64obsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) /* OpenBSD/mips64 only supports the n64 ABI, but the braindamaged way GDB works, forces us to pretend we can handle them all. */ - set_gdbarch_regset_from_core_section - (gdbarch, mips64obsd_regset_from_core_section); + set_gdbarch_iterate_over_regset_sections + (gdbarch, mips64obsd_iterate_over_regset_sections); tramp_frame_prepend_unwinder (gdbarch, &mips64obsd_sigframe); set_gdbarch_long_double_bit (gdbarch, 128); set_gdbarch_long_double_format (gdbarch, floatformats_mips64_quad); + obsd_init_abi(info, gdbarch); + /* OpenBSD/mips64 has SVR4-style shared libraries. */ set_solib_svr4_fetch_link_map_offsets (gdbarch, svr4_lp64_fetch_link_map_offsets);