/* Target-dependent code for NetBSD/sparc64.
- Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
- Free Software Foundation, Inc.
+ Copyright (C) 2002-2015 Free Software Foundation, Inc.
Based on code contributed by Wasabi Systems, Inc.
This file is part of GDB.
#include "solib-svr4.h"
#include "trad-frame.h"
-#include "gdb_assert.h"
-#include "gdb_string.h"
-
#include "sparc64-tdep.h"
#include "nbsd-tdep.h"
/* From <machine/reg.h>. */
-const struct sparc_gregset sparc64nbsd_gregset =
+const struct sparc_gregmap sparc64nbsd_gregmap =
{
0 * 8, /* "tstate" */
1 * 8, /* %pc */
struct regcache *regcache,
int regnum, const void *gregs, size_t len)
{
- sparc64_supply_gregset (&sparc64nbsd_gregset, regcache, regnum, gregs);
+ sparc64_supply_gregset (&sparc64nbsd_gregmap, regcache, regnum, gregs);
}
static void
struct regcache *regcache,
int regnum, const void *fpregs, size_t len)
{
- sparc64_supply_fpregset (regcache, regnum, fpregs);
+ sparc64_supply_fpregset (&sparc64_bsd_fpregmap, regcache, regnum, fpregs);
}
\f
static const CORE_ADDR sparc64nbsd_sigtramp_end = 0xffffffffffffe000ULL;
static int
-sparc64nbsd_pc_in_sigtramp (CORE_ADDR pc, char *name)
+sparc64nbsd_pc_in_sigtramp (CORE_ADDR pc, const char *name)
{
if (pc >= sparc64nbsd_sigtramp_start && pc < sparc64nbsd_sigtramp_end)
return 1;
/* Since we couldn't find the frame's function, the cache was
initialized under the assumption that we're frameless. */
- cache->frameless_p = 0;
+ sparc_record_save_insn (cache);
addr = get_frame_register_unsigned (this_frame, SPARC_FP_REGNUM);
if (addr & 1)
addr += BIAS;
void **this_cache)
{
CORE_ADDR pc = get_frame_pc (this_frame);
- char *name;
+ const char *name;
find_pc_partial_function (pc, &name, NULL, NULL);
if (sparc64nbsd_pc_in_sigtramp (pc, name))
{
- if (name == NULL || strncmp (name, "__sigtramp_sigcontext", 21))
+ if (name == NULL || !startswith (name, "__sigtramp_sigcontext"))
return 1;
}
static const struct frame_unwind sparc64nbsd_sigcontext_frame_unwind =
{
SIGTRAMP_FRAME,
+ default_frame_unwind_stop_reason,
sparc64nbsd_sigcontext_frame_this_id,
sparc64nbsd_sigcontext_frame_prev_register,
NULL,
};
\f
+static const struct regset sparc64nbsd_gregset =
+ {
+ NULL, sparc64nbsd_supply_gregset, NULL
+ };
+
+static const struct regset sparc64nbsd_fpregset =
+ {
+ NULL, sparc64nbsd_supply_fpregset, NULL
+ };
+
static void
sparc64nbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
- tdep->gregset = regset_alloc (gdbarch, sparc64nbsd_supply_gregset, NULL);
+ tdep->gregset = &sparc64nbsd_gregset;
tdep->sizeof_gregset = 160;
- tdep->fpregset = regset_alloc (gdbarch, sparc64nbsd_supply_fpregset, NULL);
+ tdep->fpregset = &sparc64nbsd_fpregset;
tdep->sizeof_fpregset = 272;
/* Make sure we can single-step "new" syscalls. */