aboutsummaryrefslogtreecommitdiff
path: root/gdb/sparc64-sol2-tdep.c
diff options
context:
space:
mode:
authorUlrich Weigand <ulrich.weigand@de.ibm.com>2014-12-03 15:38:46 +0100
committerUlrich Weigand <ulrich.weigand@de.ibm.com>2014-12-03 15:38:46 +0100
commitff1eb2b544c8500f48eff3418ac1e005acd5e3fe (patch)
treeded3bf7baa2645ebab06b44173d15cb308993855 /gdb/sparc64-sol2-tdep.c
parent75783939d7bd00c4e0086e5b7e536fb88f4e9d27 (diff)
downloadgdb-ff1eb2b544c8500f48eff3418ac1e005acd5e3fe.zip
gdb-ff1eb2b544c8500f48eff3418ac1e005acd5e3fe.tar.gz
gdb-ff1eb2b544c8500f48eff3418ac1e005acd5e3fe.tar.bz2
Use core regset iterators on Sparc Solaris
Remove native-only core file handling on Sparc Solaris. Instead, enable the sparc target generic core regset logic on Solaris by providing appropriate register offset maps. Thanks to Joel Brobecker for testing! gdb/ * config/sparc/sol2.mh (NATDEPFILES): Remove core-regset.o. * sparc-sol2-tdep.c: Include "regset.h". (sparc32_sol2_supply_core_gregset): New function. (sparc32_sol2_collect_core_gregset): Likewise. (sparc32_sol2_supply_core_fpregset): Likewise. (sparc32_sol2_collect_core_fpregset): Likewise. (sparc32_sol2_gregset, sparc32_sol2_fpregset): New variables. (sparc32_sol2_init_abi): Set tdep->gregset/sizeof_gregset and tdep->fpregset/sizeof_fpregset. * sparc64-sol2-tdep.c: Include "regset.h". (sparc64_sol2_supply_core_gregset): New function. (sparc64_sol2_collect_core_gregset): Likewise. (sparc64_sol2_supply_core_fpregset): Likewise. (sparc64_sol2_collect_core_fpregset): Likewise. (sparc64_sol2_gregset, sparc64_sol2_fpregset): New variables. (sparc64_sol2_init_abi): Set tdep->gregset/sizeof_gregset and tdep->fpregset/sizeof_fpregset.
Diffstat (limited to 'gdb/sparc64-sol2-tdep.c')
-rw-r--r--gdb/sparc64-sol2-tdep.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/gdb/sparc64-sol2-tdep.c b/gdb/sparc64-sol2-tdep.c
index 23e943d..d1d6d62 100644
--- a/gdb/sparc64-sol2-tdep.c
+++ b/gdb/sparc64-sol2-tdep.c
@@ -25,6 +25,7 @@
#include "objfiles.h"
#include "osabi.h"
#include "trad-frame.h"
+#include "regset.h"
#include "sol2-tdep.h"
#include "sparc64-tdep.h"
@@ -49,6 +50,52 @@ const struct sparc_fpregmap sparc64_sol2_fpregmap =
0 * 8, /* %f0 */
33 * 8, /* %fsr */
};
+
+static void
+sparc64_sol2_supply_core_gregset (const struct regset *regset,
+ struct regcache *regcache,
+ int regnum, const void *gregs, size_t len)
+{
+ sparc64_supply_gregset (&sparc64_sol2_gregmap, regcache, regnum, gregs);
+}
+
+static void
+sparc64_sol2_collect_core_gregset (const struct regset *regset,
+ const struct regcache *regcache,
+ int regnum, void *gregs, size_t len)
+{
+ sparc64_collect_gregset (&sparc64_sol2_gregmap, regcache, regnum, gregs);
+}
+
+static void
+sparc64_sol2_supply_core_fpregset (const struct regset *regset,
+ struct regcache *regcache,
+ int regnum, const void *fpregs, size_t len)
+{
+ sparc64_supply_fpregset (&sparc64_sol2_fpregmap, regcache, regnum, fpregs);
+}
+
+static void
+sparc64_sol2_collect_core_fpregset (const struct regset *regset,
+ const struct regcache *regcache,
+ int regnum, void *fpregs, size_t len)
+{
+ sparc64_collect_fpregset (&sparc64_sol2_fpregmap, regcache, regnum, fpregs);
+}
+
+static const struct regset sparc64_sol2_gregset =
+ {
+ NULL,
+ sparc64_sol2_supply_core_gregset,
+ sparc64_sol2_collect_core_gregset
+ };
+
+static const struct regset sparc64_sol2_fpregset =
+ {
+ NULL,
+ sparc64_sol2_supply_core_fpregset,
+ sparc64_sol2_collect_core_fpregset
+ };
static struct sparc_frame_cache *
@@ -159,6 +206,12 @@ sparc64_sol2_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ tdep->gregset = &sparc64_sol2_gregset;
+ tdep->sizeof_gregset = 304;
+
+ tdep->fpregset = &sparc64_sol2_fpregset;
+ tdep->sizeof_fpregset = 544;
+
frame_unwind_append_unwinder (gdbarch, &sparc64_sol2_sigtramp_frame_unwind);
sparc64_init_abi (info, gdbarch);