expression.h: New ops OP_NSSTRING, OP_SELECTOR, OP_MSGCALL, and OP_SELF.
[deliverable/binutils-gdb.git] / gdb / cris-tdep.c
index a1344304de9b02c5f1f8951b98deb7fd6e1e73eb..5d64d43f1f6c432f8a014bdcfba83656459f9fb3 100644 (file)
@@ -37,6 +37,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #include "solib.h"              /* Support for shared libraries. */
 #include "solib-svr4.h"         /* For struct link_map_offsets.  */
+#include "gdb_string.h"
 
 
 enum cris_num_regs
@@ -762,7 +763,7 @@ cris_skip_prologue_main (CORE_ADDR pc, int frameless_p)
    adjusts pcptr (if necessary) to point to the actual memory location where
    the breakpoint should be inserted.  */
 
-unsigned char *
+const unsigned char *
 cris_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
 {
   static unsigned char break_insn[] = {0x38, 0xe9};
@@ -774,8 +775,8 @@ cris_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
 /* Returns the register SRP (subroutine return pointer) which must contain 
    the content of the register PC after a function call.  */
 
-CORE_ADDR
-cris_saved_pc_after_call ()
+static CORE_ADDR
+cris_saved_pc_after_call (struct frame_info *frame)
 {
   return read_register (SRP_REGNUM);
 }
@@ -995,7 +996,7 @@ cris_abi_v2_store_return_value (struct type *type, char *valbuf)
 /* Return the name of register regno as a string. Return NULL for an invalid or
    unimplemented register.  */
 
-char *
+const char *
 cris_register_name (int regno)
 {
   static char *cris_genreg_names[] =
@@ -1155,7 +1156,7 @@ cris_frame_init_saved_regs (struct frame_info *fi)
   CORE_ADDR ip;
   struct symtab_and_line sal;
   int best_limit;
-  char *dummy_regs = generic_find_dummy_frame (fi->pc, fi->frame);
+  char *dummy_regs = deprecated_generic_find_dummy_frame (fi->pc, fi->frame);
   
   /* Examine the entire prologue.  */
   register int frameless_p = 0; 
@@ -1214,9 +1215,10 @@ cris_init_extra_frame_info (int fromleaf, struct frame_info *fi)
     {    
       /* We need to setup fi->frame here because run_stack_dummy gets it wrong
          by assuming it's always FP.  */
-      fi->frame = generic_read_register_dummy (fi->pc, fi->frame, SP_REGNUM);
+      fi->frame = deprecated_read_register_dummy (fi->pc, fi->frame,
+                                                 SP_REGNUM);
       fi->extra_info->return_pc = 
-        generic_read_register_dummy (fi->pc, fi->frame, PC_REGNUM);
+        deprecated_read_register_dummy (fi->pc, fi->frame, PC_REGNUM);
 
       /* FIXME: Is this necessarily true?  */
       fi->extra_info->leaf_function = 0;
@@ -1520,7 +1522,7 @@ cris_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
    all saved registers.  */
 
 void 
-cris_pop_frame ()
+cris_pop_frame (void)
 {
   register struct frame_info *fi = get_current_frame ();
   register int regno;
@@ -3625,11 +3627,13 @@ static struct core_fns cris_elf_core_fns =
 };
 
 /* Fetch (and possibly build) an appropriate link_map_offsets
-   structure for native Linux/CRIS targets using the struct offsets
-   defined in link.h (but without actual reference to that file).
+   structure for native GNU/Linux CRIS targets using the struct
+   offsets defined in link.h (but without actual reference to that
+   file).
 
-   This makes it possible to access Linux/CRIS shared libraries from a
-   GDB that was not built on an Linux/CRIS host (for cross debugging).
+   This makes it possible to access GNU/Linux CRIS shared libraries
+   from a GDB that was not built on an GNU/Linux CRIS host (for cross
+   debugging).
 
    See gdb/solib-svr4.h for an explanation of these fields.  */
 
@@ -3875,19 +3879,19 @@ _initialize_cris_tdep (void)
   c = add_set_cmd ("cris-version", class_support, var_integer, 
                    (char *) &usr_cmd_cris_version, 
                    "Set the current CRIS version.", &setlist);
-  c->function.sfunc = cris_version_update;
+  set_cmd_sfunc (c, cris_version_update);
   add_show_from_set (c, &showlist);
   
   c = add_set_enum_cmd ("cris-mode", class_support, cris_mode_enums, 
                         &usr_cmd_cris_mode, 
                         "Set the current CRIS mode.", &setlist);
-  c->function.sfunc = cris_mode_update;
+  set_cmd_sfunc (c, cris_mode_update);
   add_show_from_set (c, &showlist);
 
   c = add_set_enum_cmd ("cris-abi", class_support, cris_abi_enums, 
                         &usr_cmd_cris_abi, 
                         "Set the current CRIS ABI version.", &setlist);
-  c->function.sfunc = cris_abi_update;
+  set_cmd_sfunc (c, cris_abi_update);
   add_show_from_set (c, &showlist);
 
   c = add_cmd ("cris-fpless-backtrace", class_support, cris_fpless_backtrace, 
@@ -3923,8 +3927,17 @@ cris_version_update (char *ignore_args, int from_tty,
 {
   struct gdbarch_info info;
 
+  /* NOTE: cagney/2002-03-17: The add_show_from_set() function clones
+     the set command passed as a parameter.  The clone operation will
+     include (BUG?) any ``set'' command callback, if present.
+     Commands like ``info set'' call all the ``show'' command
+     callbacks.  Unfortunatly, for ``show'' commands cloned from
+     ``set'', this includes callbacks belonging to ``set'' commands.
+     Making this worse, this only occures if add_show_from_set() is
+     called after add_cmd_sfunc() (BUG?).  */
+
   /* From here on, trust the user's CRIS version setting.  */
-  if (c->type == set_cmd)
+  if (cmd_type (c) == set_cmd)
     {
       usr_cmd_cris_version_valid = 1;
   
@@ -3941,8 +3954,17 @@ cris_mode_update (char *ignore_args, int from_tty,
 {
   struct gdbarch_info info;
   
+  /* NOTE: cagney/2002-03-17: The add_show_from_set() function clones
+     the set command passed as a parameter.  The clone operation will
+     include (BUG?) any ``set'' command callback, if present.
+     Commands like ``info set'' call all the ``show'' command
+     callbacks.  Unfortunatly, for ``show'' commands cloned from
+     ``set'', this includes callbacks belonging to ``set'' commands.
+     Making this worse, this only occures if add_show_from_set() is
+     called after add_cmd_sfunc() (BUG?).  */
+
   /* From here on, trust the user's CRIS mode setting.  */
-  if (c->type == set_cmd)
+  if (cmd_type (c) == set_cmd)
     {
       usr_cmd_cris_mode_valid = 1;
   
@@ -3959,8 +3981,17 @@ cris_abi_update (char *ignore_args, int from_tty,
 {
   struct gdbarch_info info;
   
+  /* NOTE: cagney/2002-03-17: The add_show_from_set() function clones
+     the set command passed as a parameter.  The clone operation will
+     include (BUG?) any ``set'' command callback, if present.
+     Commands like ``info set'' call all the ``show'' command
+     callbacks.  Unfortunatly, for ``show'' commands cloned from
+     ``set'', this includes callbacks belonging to ``set'' commands.
+     Making this worse, this only occures if add_show_from_set() is
+     called after add_cmd_sfunc() (BUG?).  */
+
   /* From here on, trust the user's CRIS ABI setting.  */
-  if (c->type == set_cmd)
+  if (cmd_type (c) == set_cmd)
     {
       usr_cmd_cris_abi_valid = 1;
   
@@ -4071,17 +4102,19 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
           cris_abi = CRIS_ABI_V2;
         }
     }
-  else if (gdbarch_tdep (current_gdbarch))
+  else if (arches != NULL)
     {
-      /* No bfd available.  Stick with whatever ABI we're currently using.  
-         (This is to avoid changing the ABI when the user updates the 
-         architecture with the 'set cris-version' command.)  */
-      cris_abi = gdbarch_tdep (current_gdbarch)->cris_abi;
+      /* No bfd available.  Stick with the ABI from the most recently
+         selected architecture of this same family (the head of arches
+         always points to this).  (This is to avoid changing the ABI
+         when the user updates the architecture with the 'set
+         cris-version' command.)  */
+      cris_abi = gdbarch_tdep (arches->gdbarch)->cris_abi;
     }
   else
     {
-      /* No bfd, and no current architecture available.  Assume it's the 
-         new ABI.  */
+      /* No bfd, and no previously selected architecture available.
+         Assume it's the new ABI.  */
       cris_abi = CRIS_ABI_V2;
     }
 
@@ -4130,9 +4163,9 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
     {
       set_gdbarch_double_bit (gdbarch, 32);
       set_gdbarch_push_arguments (gdbarch, cris_abi_original_push_arguments);
-      set_gdbarch_store_return_value (gdbarch, 
+      set_gdbarch_deprecated_store_return_value (gdbarch, 
                                       cris_abi_original_store_return_value);
-      set_gdbarch_extract_return_value 
+      set_gdbarch_deprecated_extract_return_value 
         (gdbarch, cris_abi_original_extract_return_value);
       set_gdbarch_reg_struct_has_addr 
         (gdbarch, cris_abi_original_reg_struct_has_addr);
@@ -4141,9 +4174,9 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
     {
       set_gdbarch_double_bit (gdbarch, 64);
       set_gdbarch_push_arguments (gdbarch, cris_abi_v2_push_arguments);
-      set_gdbarch_store_return_value (gdbarch, cris_abi_v2_store_return_value);
-      set_gdbarch_extract_return_value (gdbarch, 
-                                        cris_abi_v2_extract_return_value);
+      set_gdbarch_deprecated_store_return_value (gdbarch, cris_abi_v2_store_return_value);
+      set_gdbarch_deprecated_extract_return_value
+       (gdbarch, cris_abi_v2_extract_return_value);
       set_gdbarch_reg_struct_has_addr (gdbarch, 
                                        cris_abi_v2_reg_struct_has_addr);
     }
@@ -4154,9 +4187,6 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
      which means we have to set this explicitly.  */
   set_gdbarch_long_double_bit (gdbarch, 64);
     
-  /* Floating point is IEEE compatible.  */
-  set_gdbarch_ieee_float (gdbarch, 1);
-
   /* There are 32 registers (some of which may not be implemented).  */
   set_gdbarch_num_regs (gdbarch, 32);
   set_gdbarch_sp_regnum (gdbarch, 14);
@@ -4269,8 +4299,8 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_pop_frame (gdbarch, cris_pop_frame);
 
   set_gdbarch_store_struct_return (gdbarch, cris_store_struct_return);
-  set_gdbarch_extract_struct_value_address (gdbarch, 
-                                            cris_extract_struct_value_address);
+  set_gdbarch_deprecated_extract_struct_value_address
+    (gdbarch, cris_extract_struct_value_address);
   set_gdbarch_use_struct_convention (gdbarch, cris_use_struct_convention);
 
   set_gdbarch_frame_init_saved_regs (gdbarch, cris_frame_init_saved_regs);
This page took 0.095576 seconds and 4 git commands to generate.