aboutsummaryrefslogtreecommitdiff
path: root/gdb/sparcnbsd-tdep.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2004-01-25 12:03:36 +0000
committerMark Kettenis <kettenis@gnu.org>2004-01-25 12:03:36 +0000
commitc8e737d5b439aea594305e503a3eec46b98f32c3 (patch)
tree25b1ce9c3d2c0d2f4f98abcea0f67ee456ab99f0 /gdb/sparcnbsd-tdep.c
parent566626fa4d304dee56adbefb82edc25d94c0dfa9 (diff)
downloadgdb-c8e737d5b439aea594305e503a3eec46b98f32c3.zip
gdb-c8e737d5b439aea594305e503a3eec46b98f32c3.tar.gz
gdb-c8e737d5b439aea594305e503a3eec46b98f32c3.tar.bz2
* sparcnbsd-tdep.c (sparc32nbsd_supply_gregset): Also sipply the
floating-point registers for traditional NetBSD core files. (sparc32nbsd_init_abi): Initialize TDEP->sizeof_gregset and TDEP->sizeof_fpregset here.
Diffstat (limited to 'gdb/sparcnbsd-tdep.c')
-rw-r--r--gdb/sparcnbsd-tdep.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gdb/sparcnbsd-tdep.c b/gdb/sparcnbsd-tdep.c
index 21b3aca..7a23ff3 100644
--- a/gdb/sparcnbsd-tdep.c
+++ b/gdb/sparcnbsd-tdep.c
@@ -50,16 +50,18 @@ const struct sparc_gregset sparc32nbsd_gregset =
-1 /* %l0 */
};
-/* Unlike other NetBSD implementations, the SPARC port historically
- used .reg and .reg2 (see bfd/netbsd-core.c), and as such, we can
- share one routine for a.out and ELF core files. */
-
static void
sparc32nbsd_supply_gregset (const struct regset *regset,
struct regcache *regcache,
int regnum, const void *gregs, size_t len)
{
sparc32_supply_gregset (regset->descr, 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 (regcache, regnum, (const char *) gregs + 80);
}
static void
@@ -261,9 +263,11 @@ sparc32nbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
tdep->gregset = XMALLOC (struct regset);
tdep->gregset->descr = &sparc32nbsd_gregset;
tdep->gregset->supply_regset = sparc32nbsd_supply_gregset;
+ tdep->sizeof_gregset = 20 * 4;
tdep->fpregset = XMALLOC (struct regset);
tdep->fpregset->supply_regset = sparc32nbsd_supply_fpregset;
+ tdep->sizeof_fpregset = 33 * 4;
set_gdbarch_pc_in_sigtramp (gdbarch, sparc32nbsd_pc_in_sigtramp);
frame_unwind_append_sniffer (gdbarch, sparc32nbsd_sigtramp_frame_sniffer);