/* Target-dependent code for NetBSD/sh.
- Copyright (C) 2002, 2003, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2006, 2007, 2008, 2009
+ Free Software Foundation, Inc.
Contributed by Wasabi Systems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
#include "gdbcore.h"
struct regcache *regcache,
int regnum, const void *gregs, size_t len)
{
+ struct gdbarch *gdbarch = get_regcache_arch (regcache);
const gdb_byte *regs = gregs;
int i;
gdb_assert (len >= SHNBSD_SIZEOF_GREGS);
- if (regnum == PC_REGNUM || regnum == -1)
- regcache_raw_supply (regcache, PC_REGNUM, regs + (0 * 4));
+ if (regnum == gdbarch_pc_regnum (gdbarch) || regnum == -1)
+ regcache_raw_supply (regcache, gdbarch_pc_regnum (gdbarch),
+ regs + (0 * 4));
if (regnum == SR_REGNUM || regnum == -1)
regcache_raw_supply (regcache, SR_REGNUM, regs + (1 * 4));
const struct regcache *regcache,
int regnum, void *gregs, size_t len)
{
+ struct gdbarch *gdbarch = get_regcache_arch (regcache);
gdb_byte *regs = gregs;
int i;
gdb_assert (len >= SHNBSD_SIZEOF_GREGS);
- if (regnum == PC_REGNUM || regnum == -1)
- regcache_raw_collect (regcache, PC_REGNUM, regs + (0 * 4));
+ if (regnum == gdbarch_pc_regnum (gdbarch) || regnum == -1)
+ regcache_raw_collect (regcache, gdbarch_pc_regnum (gdbarch),
+ regs + (0 * 4));
if (regnum == SR_REGNUM || regnum == -1)
regcache_raw_collect (regcache, SR_REGNUM, regs + (1 * 4));
}
void
-shnbsd_supply_reg (char *regs, int regnum)
+shnbsd_supply_reg (struct regcache *regcache, const char *regs, int regnum)
{
- shnbsd_supply_gregset (&shnbsd_gregset, current_regcache, regnum,
+ shnbsd_supply_gregset (&shnbsd_gregset, regcache, regnum,
regs, SHNBSD_SIZEOF_GREGS);
}
void
-shnbsd_fill_reg (char *regs, int regnum)
+shnbsd_fill_reg (const struct regcache *regcache, char *regs, int regnum)
{
- shnbsd_collect_gregset (&shnbsd_gregset, current_regcache, regnum,
+ shnbsd_collect_gregset (&shnbsd_gregset, regcache, regnum,
regs, SHNBSD_SIZEOF_GREGS);
}
\f