summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/binutils
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2005-03-30 09:55:34 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2005-03-30 09:55:34 +0000
commit9f91f5b9bd3218f179d3de59b6096f3331ad09d9 (patch)
tree245bcad7626f0e95c72e1946b22c8edfd8f5682a /gnu/usr.bin/binutils
parent2e341784d0f09eb98dee42f0db80f27b85f112a8 (diff)
Fix reading sparc coredumps.
Diffstat (limited to 'gnu/usr.bin/binutils')
-rw-r--r--gnu/usr.bin/binutils/gdb/sparc-tdep.h3
-rw-r--r--gnu/usr.bin/binutils/gdb/sparcnbsd-tdep.c23
-rw-r--r--gnu/usr.bin/binutils/gdb/sparcobsd-tdep.c14
3 files changed, 16 insertions, 24 deletions
diff --git a/gnu/usr.bin/binutils/gdb/sparc-tdep.h b/gnu/usr.bin/binutils/gdb/sparc-tdep.h
index bbfbb422d9c..66b579352cd 100644
--- a/gnu/usr.bin/binutils/gdb/sparc-tdep.h
+++ b/gnu/usr.bin/binutils/gdb/sparc-tdep.h
@@ -198,6 +198,9 @@ extern void sparc32_sol2_init_abi (struct gdbarch_info info,
/* Register offsets for NetBSD. */
extern const struct sparc_gregset sparc32nbsd_gregset;
+extern void sparc32nbsd_elf_init_abi (struct gdbarch_info info,
+ struct gdbarch *gdbarch);
+
extern struct trad_frame_saved_reg *
sparc32nbsd_sigcontext_saved_regs (struct frame_info *next_frame);
diff --git a/gnu/usr.bin/binutils/gdb/sparcnbsd-tdep.c b/gnu/usr.bin/binutils/gdb/sparcnbsd-tdep.c
index b1be7eb5b12..c573fd0d651 100644
--- a/gnu/usr.bin/binutils/gdb/sparcnbsd-tdep.c
+++ b/gnu/usr.bin/binutils/gdb/sparcnbsd-tdep.c
@@ -55,7 +55,7 @@ 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);
+ sparc32_supply_gregset (&sparc32nbsd_gregset, regcache, regnum, gregs);
/* Traditional NetBSD core files don't use multiple register sets.
Instead, the general-purpose and floating-point registers are
@@ -229,8 +229,8 @@ sparc32nbsd_sigcontext_frame_prev_register (struct frame_info *next_frame,
struct sparc_frame_cache *cache =
sparc32nbsd_sigcontext_frame_cache (next_frame, this_cache);
- trad_frame_prev_register (next_frame, cache->saved_regs, regnum,
- optimizedp, lvalp, addrp, realnump, valuep);
+ trad_frame_get_prev_register (next_frame, cache->saved_regs, regnum,
+ optimizedp, lvalp, addrp, realnump, valuep);
}
static const struct frame_unwind sparc32nbsd_sigcontext_frame_unwind =
@@ -274,16 +274,12 @@ sparc32nbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
set_gdbarch_long_double_bit (gdbarch, 64);
set_gdbarch_long_double_format (gdbarch, &floatformat_ieee_double_big);
- tdep->gregset = XMALLOC (struct regset);
- tdep->gregset->descr = &sparc32nbsd_gregset;
- tdep->gregset->supply_regset = sparc32nbsd_supply_gregset;
+ tdep->gregset = regset_alloc (gdbarch, sparc32nbsd_supply_gregset, NULL);
tdep->sizeof_gregset = 20 * 4;
- tdep->fpregset = XMALLOC (struct regset);
- tdep->fpregset->supply_regset = sparc32nbsd_supply_fpregset;
+ tdep->fpregset = regset_alloc (gdbarch, sparc32nbsd_supply_fpregset, NULL);
tdep->sizeof_fpregset = 33 * 4;
- set_gdbarch_pc_in_sigtramp (gdbarch, sparc32nbsd_pc_in_sigtramp);
frame_unwind_append_sniffer (gdbarch, sparc32nbsd_sigtramp_frame_sniffer);
}
@@ -296,13 +292,13 @@ sparc32nbsd_aout_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
(gdbarch, sparcnbsd_aout_in_solib_call_trampoline);
}
-static void
+void
sparc32nbsd_elf_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
sparc32nbsd_init_abi (info, gdbarch);
set_solib_svr4_fetch_link_map_offsets
- (gdbarch, nbsd_ilp32_solib_svr4_fetch_link_map_offsets);
+ (gdbarch, svr4_ilp32_fetch_link_map_offsets);
}
static enum gdb_osabi
@@ -346,9 +342,8 @@ _initialize_sparnbsd_tdep (void)
gdbarch_register_osabi_sniffer (bfd_arch_sparc, bfd_target_aout_flavour,
sparcnbsd_aout_osabi_sniffer);
- /* BFD doesn't set the architecture for NetBSD style a.out core
- files. */
- gdbarch_register_osabi_sniffer (bfd_arch_unknown, bfd_target_unknown_flavour,
+ /* BFD doesn't set a flavour for NetBSD style a.out core files. */
+ gdbarch_register_osabi_sniffer (bfd_arch_sparc, bfd_target_unknown_flavour,
sparcnbsd_core_osabi_sniffer);
gdbarch_register_osabi (bfd_arch_sparc, 0, GDB_OSABI_NETBSD_AOUT,
diff --git a/gnu/usr.bin/binutils/gdb/sparcobsd-tdep.c b/gnu/usr.bin/binutils/gdb/sparcobsd-tdep.c
index 108e255ed13..7c3bcc91ae7 100644
--- a/gnu/usr.bin/binutils/gdb/sparcobsd-tdep.c
+++ b/gnu/usr.bin/binutils/gdb/sparcobsd-tdep.c
@@ -31,7 +31,6 @@
#include "gdb_assert.h"
#include "sparc-tdep.h"
-#include "nbsd-tdep.h"
/* Signal trampolines. */
@@ -118,8 +117,8 @@ sparc32obsd_frame_prev_register (struct frame_info *next_frame,
struct sparc_frame_cache *cache =
sparc32obsd_frame_cache (next_frame, this_cache);
- trad_frame_prev_register (next_frame, cache->saved_regs, regnum,
- optimizedp, lvalp, addrp, realnump, valuep);
+ trad_frame_get_prev_register (next_frame, cache->saved_regs, regnum,
+ optimizedp, lvalp, addrp, realnump, valuep);
}
static const struct frame_unwind sparc32obsd_frame_unwind =
@@ -148,15 +147,10 @@ sparc32obsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
- /* OpenBSD doesn't support the 128-bit `long double' from the psABI. */
- set_gdbarch_long_double_bit (gdbarch, 64);
- set_gdbarch_long_double_format (gdbarch, &floatformat_ieee_double_big);
+ /* OpenBSD/sparc is very similar to NetBSD/sparc ELF. */
+ sparc32nbsd_elf_init_abi (info, gdbarch);
- set_gdbarch_pc_in_sigtramp (gdbarch, sparc32obsd_pc_in_sigtramp);
frame_unwind_append_sniffer (gdbarch, sparc32obsd_sigtramp_frame_sniffer);
-
- set_solib_svr4_fetch_link_map_offsets
- (gdbarch, nbsd_ilp32_solib_svr4_fetch_link_map_offsets);
}