This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] NetBSD/sparc core file support tweaks
- From: Mark Kettenis <kettenis at chello dot nl>
- To: gdb-patches at sources dot redhat dot com
- Date: Sun, 25 Jan 2004 13:03:38 +0100 (CET)
- Subject: [PATCH] NetBSD/sparc core file support tweaks
To make getting core files on OpenBSD/sparc easier.
Committed,
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* 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.
Index: sparcnbsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sparcnbsd-tdep.c,v
retrieving revision 1.13
diff -u -p -r1.13 sparcnbsd-tdep.c
--- sparcnbsd-tdep.c 25 Jan 2004 11:46:43 -0000 1.13
+++ sparcnbsd-tdep.c 25 Jan 2004 12:02:10 -0000
@@ -50,16 +50,18 @@ const struct sparc_gregset sparc32nbsd_g
-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_inf
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);