2003-04-21 Andrew Cagney <cagney@redhat.com>
[deliverable/binutils-gdb.git] / gdb / cris-tdep.c
index 6ae9f436745b82b1b793101848d1f4c346d93564..ef5e072020d3c3c3596f642fd7c66b94936362ea 100644 (file)
@@ -488,7 +488,7 @@ cris_examine (CORE_ADDR ip, CORE_ADDR limit, struct frame_info *fi,
   short source_register; 
 
   /* This frame is with respect to a leaf until a push srp is found.  */
-  fi->extra_info->leaf_function = 1;
+  get_frame_extra_info (fi)->leaf_function = 1;
 
   /* This frame is without the FP until a push fp is found.  */
   have_fp = 0;
@@ -527,7 +527,7 @@ cris_examine (CORE_ADDR ip, CORE_ADDR limit, struct frame_info *fi,
                 {
                   return ip;
                 }
-              fi->extra_info->leaf_function = 0;
+              get_frame_extra_info (fi)->leaf_function = 0;
             }
           else if (regno == FP_REGNUM)
             {
@@ -689,7 +689,7 @@ cris_examine (CORE_ADDR ip, CORE_ADDR limit, struct frame_info *fi,
           get_frame_saved_regs (fi)[regno] = get_frame_base (fi) - val;
           val -= 4;
         }
-      if (fi->extra_info->leaf_function)
+      if (get_frame_extra_info (fi)->leaf_function)
         {
           /* Set the register SP to contain the stack pointer of 
              the caller.  */
@@ -1146,10 +1146,10 @@ cris_frameless_function_invocation (struct frame_info *fi)
     return frameless_look_for_prologue (fi);
 }
 
-/* See frame.h.  Determines the address of all registers in the current stack
-   frame storing each in frame->saved_regs.  Space for frame->saved_regs shall
-   be allocated by FRAME_INIT_SAVED_REGS using either frame_saved_regs_zalloc
-   or frame_obstack_alloc.  */
+/* See frame.h.  Determines the address of all registers in the
+   current stack frame storing each in frame->saved_regs.  Space for
+   frame->saved_regs shall be allocated by
+   DEPRECATED_FRAME_INIT_SAVED_REGS using frame_saved_regs_zalloc.  */
 
 void
 cris_frame_init_saved_regs (struct frame_info *fi)
@@ -1174,11 +1174,11 @@ cris_frame_init_saved_regs (struct frame_info *fi)
       /* I don't see this ever happening, considering the context in which
          cris_frame_init_saved_regs is called (always when we're not in
          a dummy frame).  */
-      memcpy (&fi->saved_regs, dummy_regs, sizeof (fi->saved_regs));
+      memcpy (get_frame_saved_regs (fi), dummy_regs, SIZEOF_FRAME_SAVED_REGS);
     }
   else
     {    
-      ip = get_pc_function_start (get_frame_pc (fi));
+      ip = get_frame_func (fi);
       sal = find_pc_line (ip, 0);
 
       /* If there is no symbol information then sal.end == 0, and we end up
@@ -1204,27 +1204,27 @@ cris_init_extra_frame_info (int fromleaf, struct frame_info *fi)
   if (get_next_frame (fi))
     {
       /* Called from get_prev_frame.  */
-      deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (get_next_frame (fi)));
+      deprecated_update_frame_pc_hack (fi, DEPRECATED_FRAME_SAVED_PC (get_next_frame (fi)));
     }
  
   frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info));
  
-  fi->extra_info->return_pc = 0;
-  fi->extra_info->leaf_function = 0;
+  get_frame_extra_info (fi)->return_pc = 0;
+  get_frame_extra_info (fi)->leaf_function = 0;
 
   if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi),
                                   get_frame_base (fi),
                                   get_frame_base (fi)))
     {    
-      /* We need to setup fi->frame here because run_stack_dummy gets it wrong
-         by assuming it's always FP.  */
+      /* We need to setup fi->frame here because call_function_by_hand
+         gets it wrong by assuming it's always FP.  */
       deprecated_update_frame_base_hack (fi, deprecated_read_register_dummy (get_frame_pc (fi), get_frame_base (fi), SP_REGNUM));
-      fi->extra_info->return_pc = 
+      get_frame_extra_info (fi)->return_pc = 
         deprecated_read_register_dummy (get_frame_pc (fi),
                                        get_frame_base (fi), PC_REGNUM);
 
       /* FIXME: Is this necessarily true?  */
-      fi->extra_info->leaf_function = 0;
+      get_frame_extra_info (fi)->leaf_function = 0;
     }
   else
     {
@@ -1235,16 +1235,16 @@ cris_init_extra_frame_info (int fromleaf, struct frame_info *fi)
       if (get_frame_saved_regs (fi)[SRP_REGNUM] != 0)
         {
           /* SRP was saved on the stack; non-leaf function.  */
-          fi->extra_info->return_pc =
+          get_frame_extra_info (fi)->return_pc =
             read_memory_integer (get_frame_saved_regs (fi)[SRP_REGNUM], 
                                  REGISTER_RAW_SIZE (SRP_REGNUM));
         }
       else
         {
           /* SRP is still in a register; leaf function.  */
-          fi->extra_info->return_pc = read_register (SRP_REGNUM);
+          get_frame_extra_info (fi)->return_pc = read_register (SRP_REGNUM);
           /* FIXME: Should leaf_function be set to 1 here?  */
-          fi->extra_info->leaf_function = 1;
+          get_frame_extra_info (fi)->leaf_function = 1;
         }
     }
 }
@@ -1276,7 +1276,7 @@ cris_frame_chain (struct frame_info *fi)
 CORE_ADDR
 cris_frame_saved_pc (struct frame_info *fi)
 {
-  return fi->extra_info->return_pc;
+  return get_frame_extra_info (fi)->return_pc;
 }
 
 /* Setup the function arguments for calling a function in the inferior.  */
@@ -1570,7 +1570,7 @@ cris_pop_frame (void)
         }
     
       /* Restore the PC.  */
-      write_register (PC_REGNUM, fi->extra_info->return_pc);
+      write_register (PC_REGNUM, get_frame_extra_info (fi)->return_pc);
     }
   flush_cached_frames ();
 }
@@ -1869,8 +1869,7 @@ process_autoincrement (int size, unsigned short inst, inst_env_type *inst_env)
 
 /* Just a forward declaration.  */
 
-unsigned long
-get_data_from_address (unsigned short *inst, CORE_ADDR address);
+unsigned long get_data_from_address (unsigned short *inst, CORE_ADDR address);
 
 /* Calculates the prefix value for the general case of offset addressing 
    mode.  */
@@ -4009,7 +4008,7 @@ bfd_lookup_symbol (bfd *abfd, const char *symname)
   if (storage_needed > 0)
     {
       symbol_table = (asymbol **) xmalloc (storage_needed);
-      back_to = make_cleanup (free, (PTR) symbol_table);
+      back_to = make_cleanup (free, symbol_table);
       number_of_symbols = bfd_canonicalize_symtab (abfd, symbol_table);
 
       for (i = 0; i < number_of_symbols; i++)
@@ -4155,7 +4154,7 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   if (tdep->cris_abi == CRIS_ABI_ORIGINAL)
     {
       set_gdbarch_double_bit (gdbarch, 32);
-      set_gdbarch_push_arguments (gdbarch, cris_abi_original_push_arguments);
+      set_gdbarch_deprecated_push_arguments (gdbarch, cris_abi_original_push_arguments);
       set_gdbarch_deprecated_store_return_value (gdbarch, 
                                       cris_abi_original_store_return_value);
       set_gdbarch_deprecated_extract_return_value 
@@ -4166,7 +4165,7 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   else if (tdep->cris_abi == CRIS_ABI_V2)
     {
       set_gdbarch_double_bit (gdbarch, 64);
-      set_gdbarch_push_arguments (gdbarch, cris_abi_v2_push_arguments);
+      set_gdbarch_deprecated_push_arguments (gdbarch, cris_abi_v2_push_arguments);
       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);
@@ -4244,58 +4243,41 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_register_raw_size (gdbarch, cris_register_size);
   
   /* The largest value REGISTER_RAW_SIZE can have.  */
-  set_gdbarch_max_register_raw_size (gdbarch, 32);
+  set_gdbarch_deprecated_max_register_raw_size (gdbarch, 32);
   
   /* The length of the registers in the program's representation.  */
   set_gdbarch_register_virtual_size (gdbarch, cris_register_size);
   
   /* The largest value REGISTER_VIRTUAL_SIZE can have.  */
-  set_gdbarch_max_register_virtual_size (gdbarch, 32);
+  set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 32);
 
   set_gdbarch_register_virtual_type (gdbarch, cris_register_virtual_type);
   
   /* Use generic dummy frames.  */
   
-  /* Where to execute the call in the memory segments.  */
-  set_gdbarch_call_dummy_address (gdbarch, entry_point_address);
-  
-  /* Start execution at the beginning of dummy.  */
-  set_gdbarch_call_dummy_start_offset (gdbarch, 0);
-  set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
-  
-  /* Set to 1 since call_dummy_breakpoint_offset was defined.  */
-  set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1);
-  
   /* Read all about dummy frames in blockframe.c.  */
-  set_gdbarch_call_dummy_length (gdbarch, 0);
   set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point);
   
   /* Defined to 1 to indicate that the target supports inferior function 
      calls.  */
-  set_gdbarch_call_dummy_p (gdbarch, 1);
   set_gdbarch_call_dummy_words (gdbarch, 0);
   set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);
   
-  /* No stack adjustment needed when peforming an inferior function call.  */
-  set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
-  set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
-
-  set_gdbarch_get_saved_register (gdbarch, deprecated_generic_get_saved_register);
+  set_gdbarch_deprecated_get_saved_register (gdbarch, deprecated_generic_get_saved_register);
   
   /* No register requires conversion from raw format to virtual format.  */
   set_gdbarch_register_convertible (gdbarch, generic_register_convertible_not);
 
-  set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame);
-  set_gdbarch_push_return_address (gdbarch, cris_push_return_address);
-  set_gdbarch_pop_frame (gdbarch, cris_pop_frame);
+  set_gdbarch_deprecated_push_return_address (gdbarch, cris_push_return_address);
+  set_gdbarch_deprecated_pop_frame (gdbarch, cris_pop_frame);
 
-  set_gdbarch_store_struct_return (gdbarch, cris_store_struct_return);
+  set_gdbarch_deprecated_store_struct_return (gdbarch, cris_store_struct_return);
   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);
-  set_gdbarch_init_extra_frame_info (gdbarch, cris_init_extra_frame_info);
+  set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, cris_frame_init_saved_regs);
+  set_gdbarch_deprecated_init_extra_frame_info (gdbarch, cris_init_extra_frame_info);
   set_gdbarch_skip_prologue (gdbarch, cris_skip_prologue);
   set_gdbarch_prologue_frameless_p (gdbarch, generic_prologue_frameless_p);
   
@@ -4316,19 +4298,19 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_frame_args_skip (gdbarch, 0);
   set_gdbarch_frameless_function_invocation 
     (gdbarch, cris_frameless_function_invocation);
-  set_gdbarch_frame_chain (gdbarch, cris_frame_chain);
+  set_gdbarch_deprecated_frame_chain (gdbarch, cris_frame_chain);
 
-  set_gdbarch_frame_saved_pc (gdbarch, cris_frame_saved_pc);
-  set_gdbarch_saved_pc_after_call (gdbarch, cris_saved_pc_after_call);
+  set_gdbarch_deprecated_frame_saved_pc (gdbarch, cris_frame_saved_pc);
+  set_gdbarch_deprecated_saved_pc_after_call (gdbarch, cris_saved_pc_after_call);
 
   set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
   
-  /* No extra stack alignment needed.  Set to 1 by default.  */
-  set_gdbarch_extra_stack_alignment_needed (gdbarch, 0);
-  
   /* Helpful for backtracing and returning in a call dummy.  */
   set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);
 
+  /* Should be using push_dummy_call.  */
+  set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp);
+
   /* Use target_specific function to define link map offsets.  */
   set_solib_svr4_fetch_link_map_offsets 
     (gdbarch, cris_linux_svr4_fetch_link_map_offsets);
This page took 0.028801 seconds and 4 git commands to generate.