aboutsummaryrefslogtreecommitdiff
path: root/gdb/sparc-linux-tdep.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@redhat.com>2006-04-08 21:15:26 +0000
committerDavid S. Miller <davem@redhat.com>2006-04-08 21:15:26 +0000
commit07c5f590ae27c60e498282c40414f6c77dccc39a (patch)
tree39371d8cbc7e580b584a4e2e143ca2701955d86c /gdb/sparc-linux-tdep.c
parent0b4294d3c0c9cdac430a5f973dc5911869011ff2 (diff)
downloadgdb-07c5f590ae27c60e498282c40414f6c77dccc39a.zip
gdb-07c5f590ae27c60e498282c40414f6c77dccc39a.tar.gz
gdb-07c5f590ae27c60e498282c40414f6c77dccc39a.tar.bz2
* sparc64-linux-tdep.c (sparc64_linux_core_gregset,
sparc64_linux_supply_core_gregset, sparc64_linux_collect_core_gregset, sparc64_linux_supply_core_fpregset, sparc64_linux_collect_core_fpregset): New. (sparc64_linux_init_abi): Register them with generic sparc core regset infrastructure. * sparc32-linux-tdep.c (sparc32_linux_core_gregset, sparc32_linux_supply_core_gregset, sparc32_linux_collect_core_gregset, sparc32_linux_supply_core_fpregset, sparc32_linux_collect_core_fpregset): New. (sparc32_linux_init_abi): Register them with generic sparc core regset infrastructure. * Makefile.in: Update dependencies.
Diffstat (limited to 'gdb/sparc-linux-tdep.c')
-rw-r--r--gdb/sparc-linux-tdep.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/gdb/sparc-linux-tdep.c b/gdb/sparc-linux-tdep.c
index 446f05e..bb1a7f0 100644
--- a/gdb/sparc-linux-tdep.c
+++ b/gdb/sparc-linux-tdep.c
@@ -24,6 +24,7 @@
#include "floatformat.h"
#include "frame.h"
#include "frame-unwind.h"
+#include "regset.h"
#include "gdbarch.h"
#include "gdbcore.h"
#include "osabi.h"
@@ -170,11 +171,67 @@ sparc32_linux_step_trap (unsigned long insn)
}
+const struct sparc_gregset sparc32_linux_core_gregset =
+{
+ 32 * 4, /* %psr */
+ 33 * 4, /* %pc */
+ 34 * 4, /* %npc */
+ 35 * 4, /* %y */
+ -1, /* %wim */
+ -1, /* %tbr */
+ 1 * 4, /* %g1 */
+ 16 * 4, /* %l0 */
+ 4, /* y size */
+};
+
+
+static void
+sparc32_linux_supply_core_gregset (const struct regset *regset,
+ struct regcache *regcache,
+ int regnum, const void *gregs, size_t len)
+{
+ sparc32_supply_gregset (&sparc32_linux_core_gregset, regcache, regnum, gregs);
+}
+
+static void
+sparc32_linux_collect_core_gregset (const struct regset *regset,
+ const struct regcache *regcache,
+ int regnum, void *gregs, size_t len)
+{
+ sparc32_collect_gregset (&sparc32_linux_core_gregset, regcache, regnum, gregs);
+}
+
+static void
+sparc32_linux_supply_core_fpregset (const struct regset *regset,
+ struct regcache *regcache,
+ int regnum, const void *fpregs, size_t len)
+{
+ sparc32_supply_fpregset (regcache, regnum, fpregs);
+}
+
+static void
+sparc32_linux_collect_core_fpregset (const struct regset *regset,
+ const struct regcache *regcache,
+ int regnum, void *fpregs, size_t len)
+{
+ sparc32_collect_fpregset (regcache, regnum, fpregs);
+}
+
+
+
static void
sparc32_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ tdep->gregset = regset_alloc (gdbarch, sparc32_linux_supply_core_gregset,
+ sparc32_linux_collect_core_gregset);
+ tdep->sizeof_gregset = 152;
+
+ tdep->fpregset = regset_alloc (gdbarch, sparc32_linux_supply_core_fpregset,
+ sparc32_linux_collect_core_fpregset);
+ tdep->sizeof_fpregset = 396;
+
tramp_frame_prepend_unwinder (gdbarch, &sparc32_linux_sigframe);
tramp_frame_prepend_unwinder (gdbarch, &sparc32_linux_rt_sigframe);