gdbarch_register_virtual_type_ftype *register_virtual_type;
gdbarch_do_registers_info_ftype *do_registers_info;
gdbarch_register_sim_regno_ftype *register_sim_regno;
+ gdbarch_register_bytes_ok_ftype *register_bytes_ok;
int use_generic_dummy_frames;
int call_dummy_location;
gdbarch_call_dummy_address_ftype *call_dummy_address;
0,
0,
0,
+ 0,
generic_get_saved_register,
0,
0,
gdbarch_free (struct gdbarch *arch)
{
/* At the moment, this is trivial. */
- xfree (arch);
+ free (arch);
}
internal_error ("gdbarch: verify_gdbarch: register_virtual_type invalid");
/* Skip verify of do_registers_info, invalid_p == 0 */
/* Skip verify of register_sim_regno, invalid_p == 0 */
+ /* Skip verify of register_bytes_ok, has predicate */
if ((GDB_MULTI_ARCH >= 1)
&& (gdbarch->use_generic_dummy_frames == -1))
internal_error ("gdbarch: verify_gdbarch: use_generic_dummy_frames invalid");
"REGISTER_SIM_REGNO(reg_nr)",
XSTRING (REGISTER_SIM_REGNO (reg_nr)));
#endif
+#ifdef REGISTER_BYTES_OK
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "REGISTER_BYTES_OK(nr_bytes)",
+ XSTRING (REGISTER_BYTES_OK (nr_bytes)));
+#endif
#ifdef USE_GENERIC_DUMMY_FRAMES
fprintf_unfiltered (file,
"gdbarch_dump: USE_GENERIC_DUMMY_FRAMES # %s\n",
(long) current_gdbarch->register_sim_regno
/*REGISTER_SIM_REGNO ()*/);
#endif
+#ifdef REGISTER_BYTES_OK
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: REGISTER_BYTES_OK = 0x%08lx\n",
+ (long) current_gdbarch->register_bytes_ok
+ /*REGISTER_BYTES_OK ()*/);
+#endif
#ifdef USE_GENERIC_DUMMY_FRAMES
fprintf_unfiltered (file,
"gdbarch_dump: USE_GENERIC_DUMMY_FRAMES = %ld\n",
gdbarch->register_sim_regno = register_sim_regno;
}
+int
+gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch)
+{
+ return gdbarch->register_bytes_ok != 0;
+}
+
+int
+gdbarch_register_bytes_ok (struct gdbarch *gdbarch, long nr_bytes)
+{
+ if (gdbarch->register_bytes_ok == 0)
+ internal_error ("gdbarch: gdbarch_register_bytes_ok invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes_ok called\n");
+ return gdbarch->register_bytes_ok (nr_bytes);
+}
+
+void
+set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch,
+ gdbarch_register_bytes_ok_ftype register_bytes_ok)
+{
+ gdbarch->register_bytes_ok = register_bytes_ok;
+}
+
int
gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch)
{
#endif
#endif
+#if defined (REGISTER_BYTES_OK)
+/* Legacy for systems yet to multi-arch REGISTER_BYTES_OK */
+#define REGISTER_BYTES_OK_P() (1)
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTES_OK_P)
+#define REGISTER_BYTES_OK_P() (0)
+#endif
+
+extern int gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTES_OK_P)
+#define REGISTER_BYTES_OK_P() (gdbarch_register_bytes_ok_p (current_gdbarch))
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTES_OK)
+#define REGISTER_BYTES_OK(nr_bytes) (internal_error ("REGISTER_BYTES_OK"), 0)
+#endif
+
+typedef int (gdbarch_register_bytes_ok_ftype) (long nr_bytes);
+extern int gdbarch_register_bytes_ok (struct gdbarch *gdbarch, long nr_bytes);
+extern void set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch, gdbarch_register_bytes_ok_ftype *register_bytes_ok);
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTES_OK)
+#define REGISTER_BYTES_OK(nr_bytes) (gdbarch_register_bytes_ok (current_gdbarch, nr_bytes))
+#endif
+#endif
+
extern int gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch);
extern void set_gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch, int use_generic_dummy_frames);
#if GDB_MULTI_ARCH