Fix for PR gdb/209, PR gdb/156:
[deliverable/binutils-gdb.git] / gdb / gdbarch.c
index 060d700d4ca4900d788d12c20916dc541b6deacf..85ebde7dc1b6b57cf77a445b041357d10b7f4dc5 100644 (file)
@@ -255,6 +255,7 @@ struct gdbarch
   gdbarch_skip_trampoline_code_ftype *skip_trampoline_code;
   gdbarch_in_solib_call_trampoline_ftype *in_solib_call_trampoline;
   gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p;
+  gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments;
 };
 
 
@@ -393,7 +394,8 @@ struct gdbarch startup_gdbarch =
   0,
   0,
   0,
-  0,
+  generic_in_function_epilogue_p,
+  construct_inferior_arguments,
   /* startup_gdbarch() */
 };
 
@@ -486,6 +488,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
   current_gdbarch->pointer_to_address = unsigned_pointer_to_address;
   current_gdbarch->address_to_pointer = unsigned_address_to_pointer;
   current_gdbarch->return_value_on_stack = generic_return_value_on_stack_not;
+  current_gdbarch->use_struct_convention = generic_use_struct_convention;
   current_gdbarch->prologue_frameless_p = generic_prologue_frameless_p;
   current_gdbarch->breakpoint_from_pc = legacy_breakpoint_from_pc;
   current_gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
@@ -503,6 +506,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
   current_gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
   current_gdbarch->in_solib_call_trampoline = generic_in_solib_call_trampoline;
   current_gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p;
+  current_gdbarch->construct_inferior_arguments = construct_inferior_arguments;
   /* gdbarch_alloc() */
 
   return current_gdbarch;
@@ -637,7 +641,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
   if ((GDB_MULTI_ARCH >= 2)
       && (gdbarch->call_dummy_length == -1))
     fprintf_unfiltered (log, "\n\tcall_dummy_length");
-  if ((GDB_MULTI_ARCH >= 2)
+  if ((GDB_MULTI_ARCH >= 1)
       && (gdbarch->pc_in_call_dummy == 0))
     fprintf_unfiltered (log, "\n\tpc_in_call_dummy");
   if ((GDB_MULTI_ARCH >= 1)
@@ -689,9 +693,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
       && (gdbarch->store_return_value == 0))
     fprintf_unfiltered (log, "\n\tstore_return_value");
   /* Skip verify of extract_struct_value_address, has predicate */
-  if ((GDB_MULTI_ARCH >= 2)
-      && (gdbarch->use_struct_convention == 0))
-    fprintf_unfiltered (log, "\n\tuse_struct_convention");
+  /* Skip verify of use_struct_convention, invalid_p == 0 */
   if ((GDB_MULTI_ARCH >= 2)
       && (gdbarch->frame_init_saved_regs == 0))
     fprintf_unfiltered (log, "\n\tframe_init_saved_regs");
@@ -756,6 +758,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
   /* Skip verify of skip_trampoline_code, invalid_p == 0 */
   /* Skip verify of in_solib_call_trampoline, invalid_p == 0 */
   /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
+  /* Skip verify of construct_inferior_arguments, invalid_p == 0 */
   buf = ui_file_xstrdup (log, &dummy);
   make_cleanup (xfree, buf);
   if (strlen (buf) > 0)
@@ -963,6 +966,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                         (long) current_gdbarch->coerce_float_to_double
                         /*COERCE_FLOAT_TO_DOUBLE ()*/);
 #endif
+  if (GDB_MULTI_ARCH)
+    fprintf_unfiltered (file,
+                        "gdbarch_dump: construct_inferior_arguments = 0x%08lx\n",
+                        (long) current_gdbarch->construct_inferior_arguments);
 #ifdef CONVERT_FROM_FUNC_PTR_ADDR
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
@@ -4271,6 +4278,24 @@ set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch,
   gdbarch->in_function_epilogue_p = in_function_epilogue_p;
 }
 
+char *
+gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv)
+{
+  if (gdbarch->construct_inferior_arguments == 0)
+    internal_error (__FILE__, __LINE__,
+                    "gdbarch: gdbarch_construct_inferior_arguments invalid");
+  if (gdbarch_debug >= 2)
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_construct_inferior_arguments called\n");
+  return gdbarch->construct_inferior_arguments (gdbarch, argc, argv);
+}
+
+void
+set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch,
+                                          gdbarch_construct_inferior_arguments_ftype construct_inferior_arguments)
+{
+  gdbarch->construct_inferior_arguments = construct_inferior_arguments;
+}
+
 
 /* Keep a registry of per-architecture data-pointers required by GDB
    modules. */
This page took 0.024549 seconds and 4 git commands to generate.