* readelf.c (main): Reset dump request after each file.
[deliverable/binutils-gdb.git] / gdb / cris-tdep.c
index 0bfb5b32f6d22b6054189bc397a042caa486041f..0d552b8bda4c65df756d0e010edc918136d6313f 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);
@@ -1210,7 +1213,7 @@ cris_init_extra_frame_info (int fromleaf, struct frame_info *fi)
   fi->extra_info->return_pc = 0;
   fi->extra_info->leaf_function = 0;
 
-  if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
+  if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
     {    
       /* We need to setup fi->frame here because run_stack_dummy gets it wrong
          by assuming it's always FP.  */
@@ -1251,13 +1254,13 @@ cris_init_extra_frame_info (int fromleaf, struct frame_info *fi)
 CORE_ADDR
 cris_frame_chain (struct frame_info *fi)
 {
-  if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
+  if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
     {
       return fi->frame;
     }
   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
     {
@@ -1273,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 
@@ -1527,7 +1512,7 @@ cris_pop_frame (void)
   register int regno;
   register int stack_offset = 0;
   
-  if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
+  if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
     {
       /* This happens when we hit a breakpoint set at the entry point,
          when returning from a dummy frame.  */
@@ -3705,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)
@@ -3845,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
         {
@@ -4138,6 +4123,10 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   tdep = (struct gdbarch_tdep *) xmalloc (sizeof (struct gdbarch_tdep));
   gdbarch = gdbarch_alloc (&info, tdep);
 
+  /* NOTE: cagney/2002-12-06: This can be deleted when this arch is
+     ready to unwind the PC first (see frame.c:get_prev_frame()).  */
+  set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_default);
+
   tdep->cris_version = cris_version;
   tdep->cris_mode = cris_mode;
   tdep->cris_abi = cris_abi;
@@ -4261,10 +4250,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.  */
@@ -4276,7 +4263,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_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.  */
@@ -4288,7 +4275,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);
@@ -4328,8 +4315,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.025613 seconds and 4 git commands to generate.