/* Target-dependent code for NetBSD/sparc.
- Copyright (C) 2002-2013 Free Software Foundation, Inc.
+ Copyright (C) 2002-2016 Free Software Foundation, Inc.
Contributed by Wasabi Systems, Inc.
This file is part of GDB.
#include "symtab.h"
#include "trad-frame.h"
-#include "gdb_assert.h"
-#include "gdb_string.h"
-
#include "sparc-tdep.h"
#include "nbsd-tdep.h"
#define X_RS2(i) ((i) & 0x1f)
#define X_I(i) (((i) >> 13) & 1)
-const struct sparc_gregset sparc32nbsd_gregset =
+const struct sparc_gregmap sparc32nbsd_gregmap =
{
0 * 4, /* %psr */
1 * 4, /* %pc */
struct regcache *regcache,
int regnum, const void *gregs, size_t len)
{
- sparc32_supply_gregset (&sparc32nbsd_gregset, regcache, regnum, gregs);
+ sparc32_supply_gregset (&sparc32nbsd_gregmap, regcache, regnum, gregs);
/* Traditional NetBSD core files don't use multiple register sets.
Instead, the general-purpose and floating-point registers are
lumped together in a single section. */
if (len >= 212)
- sparc32_supply_fpregset (&sparc32_bsd_fpregset, regcache, regnum,
+ sparc32_supply_fpregset (&sparc32_bsd_fpregmap, regcache, regnum,
(const char *) gregs + 80);
}
struct regcache *regcache,
int regnum, const void *fpregs, size_t len)
{
- sparc32_supply_fpregset (&sparc32_bsd_fpregset, regcache, regnum, fpregs);
+ sparc32_supply_fpregset (&sparc32_bsd_fpregmap, regcache, regnum, fpregs);
}
\f
CORE_ADDR addr;
if (*this_cache)
- return *this_cache;
+ return (struct sparc_frame_cache *) *this_cache;
cache = sparc_frame_cache (this_frame, this_cache);
gdb_assert (cache == *this_cache);
find_pc_partial_function (pc, &name, NULL, NULL);
if (sparc32nbsd_pc_in_sigtramp (pc, name))
{
- if (name == NULL || strncmp (name, "__sigtramp_sigcontext", 21))
+ if (name == NULL || !startswith (name, "__sigtramp_sigcontext"))
return 1;
}
}
\f
+static const struct regset sparc32nbsd_gregset =
+ {
+ NULL, sparc32nbsd_supply_gregset, NULL
+ };
+
+static const struct regset sparc32nbsd_fpregset =
+ {
+ NULL, sparc32nbsd_supply_fpregset, NULL
+ };
+
static void
sparc32nbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
set_gdbarch_long_double_bit (gdbarch, 64);
set_gdbarch_long_double_format (gdbarch, floatformats_ieee_double);
- tdep->gregset = regset_alloc (gdbarch, sparc32nbsd_supply_gregset, NULL);
+ tdep->gregset = &sparc32nbsd_gregset;
tdep->sizeof_gregset = 20 * 4;
- tdep->fpregset = regset_alloc (gdbarch, sparc32nbsd_supply_fpregset, NULL);
+ tdep->fpregset = &sparc32nbsd_fpregset;
tdep->sizeof_fpregset = 33 * 4;
/* Make sure we can single-step "new" syscalls. */