diff options
-rw-r--r-- | gdb/ChangeLog | 14 | ||||
-rw-r--r-- | gdb/Makefile.in | 10 | ||||
-rw-r--r-- | gdb/sparc-linux-tdep.c | 57 | ||||
-rw-r--r-- | gdb/sparc64-linux-tdep.c | 57 |
4 files changed, 133 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e81143a..c508973 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -2,8 +2,22 @@ * sparc-linux-tdep.c (sparc32_linux_step_trap): New. (sparc32_linux_init_abi): Hook it into tdep->step_trap. + (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. * sparc64-linux-tdep.c (sparc64_linux_step_trap): New. (sparc64_linux_init_abi): Hook it into tdep->step_trap. + (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. * Makefile.in: Update dependencies. 2006-04-07 David S. Miller <davem@sunset.davemloft.net> diff --git a/gdb/Makefile.in b/gdb/Makefile.in index bdc5da5..9a83e64 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -2616,8 +2616,8 @@ sparc64-linux-nat.o: sparc64-linux-nat.c $(defs_h) $(regcache_h) \ $(gregset_h) $(sparc64_tdep_h) $(sparc_tdep_h) \ $(sparc_nat_h) $(inferior_h) $(target_h) $(linux_nat_h) sparc64-linux-tdep.o: sparc64-linux-tdep.c $(defs_h) $(frame_h) \ - $(frame_unwind_h) $(regcache_h) $(gdbarch_h) $(gdbcore_h) \ - $(osabi_h) $(solib_svr4_h) $(symtab_h) $(trad_frame_h) \ + $(frame_unwind_h) $(regset_h) $(regcache_h) $(gdbarch_h) \ + $(gdbcore_h) $(osabi_h) $(solib_svr4_h) $(symtab_h) $(trad_frame_h) \ $(tramp_frame_h) $(sparc64_tdep_h) sparc64-nat.o: sparc64-nat.c $(defs_h) $(gdbarch_h) $(sparc64_tdep_h) \ $(sparc_nat_h) @@ -2644,9 +2644,9 @@ sparc-linux-nat.o: sparc-linux-nat.c $(defs_h) $(regcache_h) $(gregset_h) \ $(sparc_tdep_h) $(sparc_nat_h) $(inferior_h) $(target_h) \ $(linux_nat_h) sparc-linux-tdep.o: sparc-linux-tdep.c $(defs_h) $(dwarf2_frame_h) \ - $(floatformat_h) $(frame_h) $(frame_unwind_h) $(gdbarch_h) \ - $(gdbcore_h) $(osabi_h) $(regcache_h) $(solib_svr4_h) $(symtab_h) \ - $(trad_frame_h) $(tramp_frame_h) $(sparc_tdep_h) + $(floatformat_h) $(frame_h) $(frame_unwind_h) $(regset_h) \ + $(gdbarch_h) $(gdbcore_h) $(osabi_h) $(regcache_h) $(solib_svr4_h) \ + $(symtab_h) $(trad_frame_h) $(tramp_frame_h) $(sparc_tdep_h) sparc-nat.o: sparc-nat.c $(defs_h) $(inferior_h) $(regcache_h) $(target_h) \ $(gdb_assert_h) $(gdb_string_h) $(gdb_wait_h) $(sparc_tdep_h) \ $(sparc_nat_h) $(inf_ptrace_h) 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); diff --git a/gdb/sparc64-linux-tdep.c b/gdb/sparc64-linux-tdep.c index 8e0498e..dd3b622 100644 --- a/gdb/sparc64-linux-tdep.c +++ b/gdb/sparc64-linux-tdep.c @@ -22,6 +22,7 @@ #include "defs.h" #include "frame.h" #include "frame-unwind.h" +#include "regset.h" #include "regcache.h" #include "gdbarch.h" #include "gdbcore.h" @@ -131,11 +132,67 @@ sparc64_linux_step_trap (unsigned long insn) } +const struct sparc_gregset sparc64_linux_core_gregset = +{ + 32 * 8, /* %tstate */ + 33 * 8, /* %tpc */ + 34 * 8, /* %tnpc */ + 35 * 8, /* %y */ + -1, /* %wim */ + -1, /* %tbr */ + 1 * 8, /* %g1 */ + 16 * 8, /* %l0 */ + 8, /* y size */ +}; + + +static void +sparc64_linux_supply_core_gregset (const struct regset *regset, + struct regcache *regcache, + int regnum, const void *gregs, size_t len) +{ + sparc64_supply_gregset (&sparc64_linux_core_gregset, regcache, regnum, gregs); +} + +static void +sparc64_linux_collect_core_gregset (const struct regset *regset, + const struct regcache *regcache, + int regnum, void *gregs, size_t len) +{ + sparc64_collect_gregset (&sparc64_linux_core_gregset, regcache, regnum, gregs); +} + +static void +sparc64_linux_supply_core_fpregset (const struct regset *regset, + struct regcache *regcache, + int regnum, const void *fpregs, size_t len) +{ + sparc64_supply_fpregset (regcache, regnum, fpregs); +} + +static void +sparc64_linux_collect_core_fpregset (const struct regset *regset, + const struct regcache *regcache, + int regnum, void *fpregs, size_t len) +{ + sparc64_collect_fpregset (regcache, regnum, fpregs); +} + + + static void sparc64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + tdep->gregset = regset_alloc (gdbarch, sparc64_linux_supply_core_gregset, + sparc64_linux_collect_core_gregset); + tdep->sizeof_gregset = 288; + + tdep->fpregset = regset_alloc (gdbarch, sparc64_linux_supply_core_fpregset, + sparc64_linux_collect_core_fpregset); + tdep->sizeof_fpregset = 280; + tramp_frame_prepend_unwinder (gdbarch, &sparc64_linux_rt_sigframe); sparc64_init_abi (info, gdbarch); |