(m32r_handle_align): Declare type of fragp.
[deliverable/binutils-gdb.git] / gdb / gdbarch.c
index 5cef3ff50a4848c640ac91692f28823a31c289ee..4c5c44da9ae6374d8ef1c8c559d0c7b2fda4f895 100644 (file)
@@ -169,6 +169,7 @@ struct gdbarch
   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;
@@ -234,6 +235,7 @@ struct gdbarch
   int extra_stack_alignment_needed;
   gdbarch_reg_struct_has_addr_ftype *reg_struct_has_addr;
   gdbarch_save_dummy_frame_tos_ftype *save_dummy_frame_tos;
+  int parm_boundary;
   const struct floatformat * float_format;
   const struct floatformat * double_format;
   const struct floatformat * long_double_format;
@@ -314,6 +316,7 @@ struct gdbarch startup_gdbarch =
   0,
   0,
   0,
+  0,
   generic_get_saved_register,
   0,
   0,
@@ -366,6 +369,7 @@ struct gdbarch startup_gdbarch =
   0,
   0,
   0,
+  0,
   /* startup_gdbarch() */
 };
 
@@ -463,7 +467,7 @@ void
 gdbarch_free (struct gdbarch *arch)
 {
   /* At the moment, this is trivial.  */
-  xfree (arch);
+  free (arch);
 }
 
 
@@ -547,6 +551,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
     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");
@@ -943,6 +948,12 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       "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",
@@ -1332,6 +1343,11 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       "SAVE_DUMMY_FRAME_TOS(sp)",
                       XSTRING (SAVE_DUMMY_FRAME_TOS (sp)));
 #endif
+#ifdef PARM_BOUNDARY
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: PARM_BOUNDARY # %s\n",
+                      XSTRING (PARM_BOUNDARY));
+#endif
 #ifdef TARGET_FLOAT_FORMAT
   fprintf_unfiltered (file,
                       "gdbarch_dump: TARGET_FLOAT_FORMAT # %s\n",
@@ -1605,6 +1621,13 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                         (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",
@@ -2029,6 +2052,11 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                         (long) current_gdbarch->save_dummy_frame_tos
                         /*SAVE_DUMMY_FRAME_TOS ()*/);
 #endif
+#ifdef PARM_BOUNDARY
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: PARM_BOUNDARY = %ld\n",
+                      (long) PARM_BOUNDARY);
+#endif
 #ifdef TARGET_FLOAT_FORMAT
   fprintf_unfiltered (file,
                       "gdbarch_dump: TARGET_FLOAT_FORMAT = %ld\n",
@@ -2763,6 +2791,29 @@ set_gdbarch_register_sim_regno (struct gdbarch *gdbarch,
   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)
 {
@@ -3879,6 +3930,21 @@ set_gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch,
   gdbarch->save_dummy_frame_tos = save_dummy_frame_tos;
 }
 
+int
+gdbarch_parm_boundary (struct gdbarch *gdbarch)
+{
+  if (gdbarch_debug >= 2)
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_parm_boundary called\n");
+  return gdbarch->parm_boundary;
+}
+
+void
+set_gdbarch_parm_boundary (struct gdbarch *gdbarch,
+                           int parm_boundary)
+{
+  gdbarch->parm_boundary = parm_boundary;
+}
+
 const struct floatformat *
 gdbarch_float_format (struct gdbarch *gdbarch)
 {
This page took 0.026057 seconds and 4 git commands to generate.