2002-11-27 Andrew Cagney <ac131313@redhat.com>
[deliverable/binutils-gdb.git] / gdb / cris-tdep.c
index c53c7ea87acc1c1647c6009022ddedb4cfa02118..6cc88ae75ef312d6ff1b43ebda68c70672735fca 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
@@ -391,7 +392,7 @@ static CORE_ADDR bfd_lookup_symbol (bfd *, const char *);
 
    CORE_ADDR frame
    CORE_ADDR pc
-   int signal_handler_caller
+   enum frame_type type;
    CORE_ADDR return_pc
    int leaf_function
 
@@ -404,8 +405,9 @@ static CORE_ADDR bfd_lookup_symbol (bfd *, const char *);
    of the register PC.  All other frames contain the content of the
    register PC in the next frame.
 
-   The variable signal_handler_caller is non-zero when the frame is
-   associated with the call of a signal handler.
+   The variable `type' indicates the frame's type: normal, SIGTRAMP
+   (associated with a signal handler), dummy (associated with a dummy
+   frame).
 
    The variable return_pc contains the address where execution should be
    resumed when the present frame has finished, the return address.
@@ -679,29 +681,29 @@ cris_examine (CORE_ADDR ip, CORE_ADDR limit, struct frame_info *fi,
 
   if (have_fp)
     {
-      fi->saved_regs[FP_REGNUM] = FRAME_FP (fi);
+      fi->saved_regs[FP_REGNUM] = get_frame_base (fi);
       
       /* Calculate the addresses.  */
       for (regno = regsave; regno >= 0; regno--)
         {
-          fi->saved_regs[regno] = FRAME_FP (fi) - val;
+          fi->saved_regs[regno] = get_frame_base (fi) - val;
           val -= 4;
         }
       if (fi->extra_info->leaf_function)
         {
           /* Set the register SP to contain the stack pointer of 
              the caller.  */
-          fi->saved_regs[SP_REGNUM] = FRAME_FP (fi) + 4;
+          fi->saved_regs[SP_REGNUM] = get_frame_base (fi) + 4;
         }
       else
         {
           /* Set the register SP to contain the stack pointer of 
              the caller.  */
-          fi->saved_regs[SP_REGNUM] = FRAME_FP (fi) + 8;
+          fi->saved_regs[SP_REGNUM] = get_frame_base (fi) + 8;
       
           /* Set the register SRP to contain the return address of 
              the caller.  */
-          fi->saved_regs[SRP_REGNUM] = FRAME_FP (fi) + 4;
+          fi->saved_regs[SRP_REGNUM] = get_frame_base (fi) + 4;
         }
     }
   return ip;
@@ -971,7 +973,7 @@ cris_abi_original_store_return_value (struct type *type, char *valbuf)
   int len = TYPE_LENGTH (type);
   
   if (len <= REGISTER_SIZE) 
-    write_register_bytes (REGISTER_BYTE (RET_REGNUM), valbuf, len);
+    deprecated_write_register_bytes (REGISTER_BYTE (RET_REGNUM), valbuf, len);
   else
     internal_error (__FILE__, __LINE__, "cris_abi_original_store_return_value: type length too large.");
 }
@@ -986,7 +988,8 @@ cris_abi_v2_store_return_value (struct type *type, char *valbuf)
   if (len <= 2 * REGISTER_SIZE)
     {
       /* Note that this works since R10 and R11 are consecutive registers.  */
-      write_register_bytes (REGISTER_BYTE (RET_REGNUM), valbuf, len);
+      deprecated_write_register_bytes (REGISTER_BYTE (RET_REGNUM), valbuf,
+                                      len);
     }
   else
     internal_error (__FILE__, __LINE__, "cris_abi_v2_store_return_value: type length too large.");
@@ -1138,7 +1141,7 @@ cris_abi_v2_reg_struct_has_addr (int gcc_p, struct type *type)
 int
 cris_frameless_function_invocation (struct frame_info *fi)
 {
-  if (fi->signal_handler_caller)
+  if ((get_frame_type (fi) == SIGTRAMP_FRAME))
     return 0;
   else
     return frameless_look_for_prologue (fi);
@@ -1214,9 +1217,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;
@@ -1256,7 +1260,7 @@ cris_frame_chain (struct frame_info *fi)
     }
   else if (!inside_entry_file (fi->pc))
     {
-      return read_memory_unsigned_integer (FRAME_FP (fi), 4);
+      return read_memory_unsigned_integer (get_frame_base (fi), 4);
     }
   else
     {
@@ -1272,24 +1276,6 @@ cris_frame_saved_pc (struct frame_info *fi)
   return fi->extra_info->return_pc;
 }
 
-/* Return the address of the argument block for the frame described 
-   by struct frame_info.  */
-
-CORE_ADDR
-cris_frame_args_address (struct frame_info *fi)
-{
-  return FRAME_FP (fi);
-}
-
-/* Return the address of the locals block for the frame
-   described by struct frame_info.  */
-
-CORE_ADDR
-cris_frame_locals_address (struct frame_info *fi)
-{
-  return FRAME_FP (fi);
-}
-
 /* Setup the function arguments for calling a function in the inferior.  */
 
 CORE_ADDR 
@@ -3704,8 +3690,8 @@ cris_fpless_backtrace (char *noargs, int from_tty)
      function (since there's no push srp in that case).  */
   int innermost_frame = 1;
   
-  read_register_gen (PC_REGNUM, (char *) &pc);
-  read_register_gen (SP_REGNUM, (char *) &sp);
+  deprecated_read_register_gen (PC_REGNUM, (char *) &pc);
+  deprecated_read_register_gen (SP_REGNUM, (char *) &sp);
   
   /* We make an explicit return when we can't find an outer frame.  */
   while (1)
@@ -3844,7 +3830,7 @@ cris_fpless_backtrace (char *noargs, int from_tty)
           /* We couldn't find a push srp in the prologue, so this must be
              a leaf function, and thus we use the srp register directly.
              This should happen at most once, for the innermost function.  */
-          read_register_gen (SRP_REGNUM, (char *) &pc);
+          deprecated_read_register_gen (SRP_REGNUM, (char *) &pc);
         }
       else
         {
@@ -4260,10 +4246,8 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_register_virtual_type (gdbarch, cris_register_virtual_type);
   
   /* Use generic dummy frames.  */
-  set_gdbarch_use_generic_dummy_frames (gdbarch, 1);
   
   /* Where to execute the call in the memory segments.  */
-  set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT);
   set_gdbarch_call_dummy_address (gdbarch, entry_point_address);
   
   /* Start execution at the beginning of dummy.  */
@@ -4275,7 +4259,7 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   
   /* Read all about dummy frames in blockframe.c.  */
   set_gdbarch_call_dummy_length (gdbarch, 0);
-  set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_at_entry_point);
+  set_gdbarch_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.  */
@@ -4287,7 +4271,7 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   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, generic_get_saved_register);
+  set_gdbarch_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);
@@ -4327,8 +4311,6 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_frame_chain_valid (gdbarch, generic_file_frame_chain_valid);
 
   set_gdbarch_frame_saved_pc (gdbarch, cris_frame_saved_pc);
-  set_gdbarch_frame_args_address (gdbarch, cris_frame_args_address);
-  set_gdbarch_frame_locals_address (gdbarch, cris_frame_locals_address);
   set_gdbarch_saved_pc_after_call (gdbarch, cris_saved_pc_after_call);
 
   set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
This page took 0.026059 seconds and 4 git commands to generate.