+2004-04-15 Mark Kettenis <kettenis@gnu.org>
+
+ * vax-tdep.c: Include "regset.h".
+ (vax_supply_gregset): New function.
+ (vax_gregset): New variable.
+ (vax_regset_from_core_section): New function.
+ (vax_gdbarch_init): Set regset_from_core_section.
+ * Makefile.in (vax-tdep.o): Update dependencies.
+
2004-04-15 Andrew Cagney <cagney@redhat.com>
* observer.c (normal_stop_subject, observer_notify_normal_stop)
$(language_h) $(wrapper_h) $(gdbcmd_h) $(gdb_string_h) $(varobj_h)
vax-tdep.o: vax-tdep.c $(defs_h) $(symtab_h) $(opcode_vax_h) $(gdbcore_h) \
$(inferior_h) $(regcache_h) $(frame_h) $(frame_base_h) \
- $(frame_unwind_h) $(value_h) $(arch_utils_h) $(gdb_string_h) \
- $(osabi_h) $(dis_asm_h) $(vax_tdep_h)
+ $(frame_unwind_h) $(value_h) $(arch_utils_h) $(osabi_h) \
+ $(dis_asm_h) $(regset_h) $(gdb_string_h) $(vax_tdep_h)
vaxbsd-nat.o: vaxbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) $(vax_tdep_h)
vaxnbsd-tdep.o: vaxnbsd-tdep.c $(defs_h) $(arch_utils_h) $(osabi_h) \
$(vax_tdep_h) $(solib_svr4_h)
#include "trad-frame.h"
#include "value.h"
#include "arch-utils.h"
-#include "gdb_string.h"
#include "osabi.h"
#include "dis-asm.h"
+#include "regset.h"
+
+#include "gdb_string.h"
#include "vax-tdep.h"
return builtin_type_int;
}
\f
+/* Core file support. */
+
+/* Supply register REGNUM from the buffer specified by GREGS and LEN
+ in the general-purpose register set REGSET to register cache
+ REGCACHE. If REGNUM is -1, do this for all registers in REGSET. */
+
+static void
+vax_supply_gregset (const struct regset *regset, struct regcache *regcache,
+ int regnum, const void *gregs, size_t len)
+{
+ const char *regs = gregs;
+ int i;
+
+ for (i = 0; i < VAX_NUM_REGS; i++)
+ {
+ if (regnum == i || regnum == -1)
+ regcache_raw_supply (regcache, i, regs + i * 4);
+ }
+}
+/* VAX register set. */
+
+static struct regset vax_gregset =
+{
+ NULL,
+ vax_supply_gregset
+};
+
+/* Return the appropriate register set for the core section identified
+ by SECT_NAME and SECT_SIZE. */
+
+static const struct regset *
+vax_regset_from_core_section (struct gdbarch *gdbarch,
+ const char *sect_name, size_t sect_size)
+{
+ if (strcmp (sect_name, ".reg") == 0 && sect_size >= VAX_NUM_REGS * 4)
+ return &vax_gregset;
+
+ return NULL;
+}
+\f
/* The VAX Unix calling convention uses R1 to pass a structure return
value address instead of passing it as a first (hidden) argument as
the VMS calling convention suggests. */
set_gdbarch_pc_regnum (gdbarch, VAX_PC_REGNUM);
set_gdbarch_ps_regnum (gdbarch, VAX_PS_REGNUM);
+ set_gdbarch_regset_from_core_section
+ (gdbarch, vax_regset_from_core_section);
+
/* Frame and stack info */
set_gdbarch_skip_prologue (gdbarch, vax_skip_prologue);
set_gdbarch_frame_num_args (gdbarch, vax_frame_num_args);