+2004-01-11 Mark Kettenis <kettenis@gnu.org>
+
+ * sparc-tdep.h (struct regset): Provide opaque declaration.
+ (struct gdbarch_tdep): Add gregset, sizeof_gregset,
+ fpregset and sizeof_fpregset members.
+ * sparc-tdep.c (struct regset): Provide opaque declaration.
+ (sparc_regset_from_core_section): New function.
+ (sparc32_gdbarch_init): Initialize TDEP->gregset,
+ TDEP->sizeof_gregset, TDEP->fpregset and TDEP->sizeof_fpregset.
+ Set regset_from_core_section when appropriate.
+
2004-01-10 Mark Kettenis <kettenis@gnu.org>
* x86-64-tdep.c (amd64_non_pod_p): New function.
#include "sparc-tdep.h"
+struct regset;
+
/* This file implements the The SPARC 32-bit ABI as defined by the
section "Low-Level System Information" of the SPARC Compliance
Definition (SCD) 2.4.1, which is the 32-bit System V psABI for
}
\f
+/* Return the appropriate register set for the core section identified
+ by SECT_NAME and SECT_SIZE. */
+
+const struct regset *
+sparc_regset_from_core_section (struct gdbarch *gdbarch,
+ const char *sect_name, size_t sect_size)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ if (strcmp (sect_name, ".reg") == 0 && sect_size == tdep->sizeof_gregset)
+ return tdep->gregset;
+
+ if (strcmp (sect_name, ".reg2") == 0 && sect_size == tdep->sizeof_fpregset)
+ return tdep->fpregset;
+
+ return NULL;
+}
+\f
+
static struct gdbarch *
sparc32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
{
tdep->pc_regnum = SPARC32_PC_REGNUM;
tdep->npc_regnum = SPARC32_NPC_REGNUM;
+ tdep->gregset = NULL;
+ tdep->sizeof_gregset = 20 * 4;
+ tdep->fpregset = NULL;
+ tdep->sizeof_fpregset = 33 * 4;
tdep->plt_entry_size = 0;
set_gdbarch_long_double_bit (gdbarch, 128);
frame_unwind_append_sniffer (gdbarch, sparc32_frame_sniffer);
+ /* If we have register sets, enable the generic core file support. */
+ if (tdep->gregset && tdep->fpregset)
+ set_gdbarch_regset_from_core_section (gdbarch,
+ sparc_regset_from_core_section);
+
return gdbarch;
}
\f
struct gdbarch;
struct regcache;
+struct regset;
struct trad_frame_saved_reg;
/* Register offsets for the general-purpose register set. */
int pc_regnum;
int npc_regnum;
+ /* Register sets. */
+ struct regset *gregset;
+ size_t sizeof_gregset;
+ struct regset *fpregset;
+ size_t sizeof_fpregset;
+
/* Offset of saved PC in jmp_buf. */
int jb_pc_offset;