* arch-utils.c, arch-utils.h (default_convert_from_func_ptr_addr):
[deliverable/binutils-gdb.git] / gdb / arch-utils.c
index bf637b58627eef9f26f61caa87ba8783e491c259..d58eb4571883e233bb374d5bbcba012b7b6b3686 100644 (file)
@@ -151,17 +151,13 @@ generic_prologue_frameless_p (CORE_ADDR ip)
 /* Helper functions for INNER_THAN */
 
 int
-core_addr_lessthan (lhs, rhs)
-     CORE_ADDR lhs;
-     CORE_ADDR rhs;
+core_addr_lessthan (CORE_ADDR lhs, CORE_ADDR rhs)
 {
   return (lhs < rhs);
 }
 
 int
-core_addr_greaterthan (lhs, rhs)
-     CORE_ADDR lhs;
-     CORE_ADDR rhs;
+core_addr_greaterthan (CORE_ADDR lhs, CORE_ADDR rhs)
 {
   return (lhs > rhs);
 }
@@ -211,21 +207,32 @@ default_double_format (struct gdbarch *gdbarch)
 /* Misc helper functions for targets. */
 
 int
-frame_num_args_unknown (fi)
-     struct frame_info *fi;
+frame_num_args_unknown (struct frame_info *fi)
 {
   return -1;
 }
 
 
 int
-generic_register_convertible_not (num)
-     int num;
+generic_register_convertible_not (int num)
 {
   return 0;
 }
   
 
+int
+default_register_sim_regno (int num)
+{
+  return num;
+}
+
+
+CORE_ADDR
+default_convert_from_func_ptr_addr (CORE_ADDR addr)
+{
+  return addr;
+}
+
 /* Functions to manipulate the endianness of the target.  */
 
 #ifdef TARGET_BYTE_ORDER_SELECTABLE
@@ -298,7 +305,10 @@ set_endian (char *ignore_args, int from_tty, struct cmd_list_element *c)
          struct gdbarch_info info;
          memset (&info, 0, sizeof info);
          info.byte_order = LITTLE_ENDIAN;
-         gdbarch_update (info);
+         if (! gdbarch_update_p (info))
+           {
+             printf_unfiltered ("Little endian target not supported by GDB\n");
+           }
        }
       else
        {
@@ -313,7 +323,10 @@ set_endian (char *ignore_args, int from_tty, struct cmd_list_element *c)
          struct gdbarch_info info;
          memset (&info, 0, sizeof info);
          info.byte_order = BIG_ENDIAN;
-         gdbarch_update (info);
+         if (! gdbarch_update_p (info))
+           {
+             printf_unfiltered ("Big endian target not supported by GDB\n");
+           }
        }
       else
        {
@@ -484,7 +497,7 @@ set_architecture (char *ignore_args, int from_tty, struct cmd_list_element *c)
       info.bfd_arch_info = bfd_scan_arch (set_architecture_string);
       if (info.bfd_arch_info == NULL)
        internal_error ("set_architecture: bfd_scan_arch failed");
-      if (gdbarch_update (info))
+      if (gdbarch_update_p (info))
        target_architecture_auto = 0;
       else
        printf_unfiltered ("Architecture `%s' not reconized.\n",
@@ -535,19 +548,19 @@ info_architecture (char *args, int from_tty)
   printf_filtered ("\n");
 }
 
-/* Set the dynamic target-system-dependant parameters (architecture,
+/* Set the dynamic target-system-dependent parameters (architecture,
    byte-order) using information found in the BFD */
 
 void
-set_gdbarch_from_file (abfd)
-     bfd *abfd;
+set_gdbarch_from_file (bfd *abfd)
 {
   if (GDB_MULTI_ARCH)
     {
       struct gdbarch_info info;
       memset (&info, 0, sizeof info);
       info.abfd = abfd;
-      gdbarch_update (info);
+      if (! gdbarch_update_p (info))
+       error ("Architecture of file not reconized.\n");
     }
   else
     {
@@ -642,7 +655,10 @@ initialize_current_architecture (void)
 
   if (GDB_MULTI_ARCH)
     {
-      gdbarch_update (info);
+      if (! gdbarch_update_p (info))
+       {
+         internal_error ("initialize_current_architecture: Selection of initial architecture failed");
+       }
     }
 
   /* Create the ``set architecture'' command appending ``auto'' to the
This page took 0.024653 seconds and 4 git commands to generate.