* gas/nios2/nios2.exp: Add copyright.
[deliverable/binutils-gdb.git] / gdb / arch-utils.c
index 92e310172b960282a19645974013b7605f8dcdc0..42802a018e1647044e85af54b5a925b703d5acf2 100644 (file)
@@ -1,7 +1,6 @@
 /* Dynamic architecture support for GDB, the GNU debugger.
 
-   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-   2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+   Copyright (C) 1998-2013 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -32,6 +31,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 #include "objfiles.h"
+#include "language.h"
 
 #include "version.h"
 
@@ -86,7 +86,7 @@ displaced_step_at_entry_point (struct gdbarch *gdbarch)
      We don't want displaced stepping to interfere with those
      breakpoints, so leave space.  */
   gdbarch_breakpoint_from_pc (gdbarch, &addr, &bp_len);
-  addr += bp_len * 3;
+  addr += bp_len * 2;
 
   return addr;
 }
@@ -121,7 +121,7 @@ generic_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
 
 int
 generic_in_solib_return_trampoline (struct gdbarch *gdbarch,
-                                   CORE_ADDR pc, char *name)
+                                   CORE_ADDR pc, const char *name)
 {
   return 0;
 }
@@ -252,7 +252,7 @@ static int target_byte_order_user = BFD_ENDIAN_UNKNOWN;
 static const char endian_big[] = "big";
 static const char endian_little[] = "little";
 static const char endian_auto[] = "auto";
-static const char *endian_enum[] =
+static const char *const endian_enum[] =
 {
   endian_big,
   endian_little,
@@ -506,7 +506,7 @@ gdbarch_update_p (struct gdbarch_info info)
 
   /* If it is the same old architecture, accept the request (but don't
      swap anything).  */
-  if (new_gdbarch == target_gdbarch)
+  if (new_gdbarch == target_gdbarch ())
     {
       if (gdbarch_debug)
        fprintf_unfiltered (gdb_stdlog, "gdbarch_update_p: "
@@ -522,7 +522,7 @@ gdbarch_update_p (struct gdbarch_info info)
                        "New architecture %s (%s) selected\n",
                        host_address_to_string (new_gdbarch),
                        gdbarch_bfd_arch_info (new_gdbarch)->printable_name);
-  deprecated_target_gdbarch_select_hack (new_gdbarch);
+  set_target_gdbarch (new_gdbarch);
 
   return 1;
 }
@@ -556,7 +556,7 @@ set_gdbarch_from_file (bfd *abfd)
 
   if (gdbarch == NULL)
     error (_("Architecture of file not recognized."));
-  deprecated_target_gdbarch_select_hack (gdbarch);
+  set_target_gdbarch (gdbarch);
 }
 
 /* Initialize the current architecture.  Update the ``set
@@ -757,7 +757,7 @@ get_current_arch (void)
   if (has_stack_frames ())
     return get_frame_arch (get_selected_frame (NULL));
   else
-    return target_gdbarch;
+    return target_gdbarch ();
 }
 
 int
@@ -794,6 +794,16 @@ default_gen_return_address (struct gdbarch *gdbarch,
   error (_("This architecture has no method to collect a return address."));
 }
 
+int
+default_return_in_first_hidden_param_p (struct gdbarch *gdbarch,
+                                       struct type *type)
+{
+  /* Usually, the return value's address is stored the in the "first hidden"
+     parameter if the return value should be passed by reference, as
+     specified in ABI.  */
+  return language_pass_by_reference (type);
+}
+
 /* */
 
 /* -Wmissing-prototypes */
This page took 0.026709 seconds and 4 git commands to generate.