X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fhppaobsd-tdep.c;h=ad914e17f351a8babc3ff4af71683488a3eff8bd;hb=a9ff5f12cff6cd06f74ecf387ac5468984c94c6f;hp=5b895c4b155d2be1aadcd3fd00b9c59b1fbc9572;hpb=cbb6aada97409ccf45cdc24ef7f7e464906ada9a;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/hppaobsd-tdep.c b/gdb/hppaobsd-tdep.c index 5b895c4b15..ad914e17f3 100644 --- a/gdb/hppaobsd-tdep.c +++ b/gdb/hppaobsd-tdep.c @@ -1,6 +1,6 @@ /* Target-dependent code for OpenBSD/hppa - Copyright (C) 2004-2013 Free Software Foundation, Inc. + Copyright (C) 2004-2016 Free Software Foundation, Inc. This file is part of GDB. @@ -22,9 +22,6 @@ #include "regcache.h" #include "regset.h" -#include "gdb_assert.h" -#include "gdb_string.h" - #include "hppa-tdep.h" #include "hppabsd-tdep.h" @@ -47,7 +44,7 @@ hppaobsd_supply_gregset (const struct regset *regset, int regnum, const void *gregs, size_t len) { gdb_byte zero[4] = { 0 }; - const gdb_byte *regs = gregs; + const gdb_byte *regs = (const gdb_byte *) gregs; size_t offset; int i; @@ -116,8 +113,7 @@ hppaobsd_supply_fpregset (const struct regset *regset, struct regcache *regcache, 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 >= HPPAOBSD_SIZEOF_FPREGS); @@ -131,32 +127,30 @@ hppaobsd_supply_fpregset (const struct regset *regset, /* OpenBSD/hppa register sets. */ -static struct regset hppaobsd_gregset = +static const struct regset hppaobsd_gregset = { NULL, - hppaobsd_supply_gregset + hppaobsd_supply_gregset, + NULL, + REGSET_VARIABLE_SIZE }; -static struct regset hppaobsd_fpregset = +static const struct regset hppaobsd_fpregset = { NULL, hppaobsd_supply_fpregset }; -/* Return the appropriate register set for the core section identified - by SECT_NAME and SECT_SIZE. */ +/* Iterate over supported core file register note sections. */ -static const struct regset * -hppaobsd_regset_from_core_section (struct gdbarch *gdbarch, - const char *sect_name, size_t sect_size) +static void +hppaobsd_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 >= HPPAOBSD_SIZEOF_GREGS) - return &hppaobsd_gregset; - - if (strcmp (sect_name, ".reg2") == 0 && sect_size >= HPPAOBSD_SIZEOF_FPREGS) - return &hppaobsd_fpregset; - - return NULL; + cb (".reg", HPPAOBSD_SIZEOF_GREGS, &hppaobsd_gregset, NULL, cb_data); + cb (".reg2", HPPAOBSD_SIZEOF_FPREGS, &hppaobsd_fpregset, NULL, cb_data); } @@ -167,8 +161,8 @@ hppaobsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) hppabsd_init_abi (info, gdbarch); /* Core file support. */ - set_gdbarch_regset_from_core_section - (gdbarch, hppaobsd_regset_from_core_section); + set_gdbarch_iterate_over_regset_sections + (gdbarch, hppaobsd_iterate_over_regset_sections); }