2004-02-14 Elena Zannoni <ezannoni@redhat.com>
[deliverable/binutils-gdb.git] / gdb / s390-tdep.c
index e4921eba41dccbd0c20f129047cf8f3d055da05a..c97f8c5f7e03ace99a39b9592b7c60a7c5d275c2 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for GDB, the GNU debugger.
 
-   Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
    Contributed by D.J. Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com)
    for IBM Deutschland Entwicklung GmbH, IBM Corporation.
@@ -31,7 +31,6 @@
 #include "target.h"
 #include "gdbcore.h"
 #include "gdbcmd.h"
-#include "symfile.h"
 #include "objfiles.h"
 #include "tm.h"
 #include "../bfd/bfd.h"
@@ -901,7 +900,7 @@ s390_get_signal_frame_info (struct frame_info *fi)
       && get_frame_extra_info (next_frame)->sigcontext)
     {
       /* We're definitely backtracing from a signal handler.  */
-      CORE_ADDR *saved_regs = get_frame_saved_regs (fi);
+      CORE_ADDR *saved_regs = deprecated_get_frame_saved_regs (fi);
       CORE_ADDR save_reg_addr = (get_frame_extra_info (next_frame)->sigcontext
                                  + DEPRECATED_REGISTER_BYTE (S390_GP0_REGNUM));
       int reg;
@@ -1428,12 +1427,12 @@ s390_get_frame_info (CORE_ADDR start_pc,
        - the analysis gave us enough information to actually figure it
          out.  */
     if (fi
-        && get_frame_saved_regs (fi)
+        && deprecated_get_frame_saved_regs (fi)
         && original_sp != -1)
       {
         int slot_num;
         CORE_ADDR slot_addr;
-        CORE_ADDR *saved_regs = get_frame_saved_regs (fi);
+        CORE_ADDR *saved_regs = deprecated_get_frame_saved_regs (fi);
 
         /* Scan the spill array; if a spill slot says it holds the
            original value of some register, then record that slot's
@@ -1565,22 +1564,6 @@ s390_sniff_pc_function_start (CORE_ADDR pc, struct frame_info *fi)
 }
 
 
-
-static CORE_ADDR
-s390_function_start (struct frame_info *fi)
-{
-  CORE_ADDR function_start = 0;
-
-  if (get_frame_extra_info (fi) && get_frame_extra_info (fi)->initialised)
-    function_start = get_frame_extra_info (fi)->function_start;
-  else if (get_frame_pc (fi))
-    function_start = get_frame_func (fi);
-  return function_start;
-}
-
-
-
-
 static int
 s390_frameless_function_invocation (struct frame_info *fi)
 {
@@ -1719,7 +1702,7 @@ s390_frame_init_saved_regs (struct frame_info *fi)
 
   int quick;
 
-  if (get_frame_saved_regs (fi) == NULL)
+  if (deprecated_get_frame_saved_regs (fi) == NULL)
     {
       /* zalloc memsets the saved regs */
       frame_saved_regs_zalloc (fi);
@@ -1754,10 +1737,10 @@ s390_frame_saved_pc_nofix (struct frame_info *fi)
     {
       get_frame_extra_info (fi)->saved_pc_valid = 1;
       if (get_frame_extra_info (fi)->good_prologue
-          && get_frame_saved_regs (fi)[S390_RETADDR_REGNUM])
+          && deprecated_get_frame_saved_regs (fi)[S390_RETADDR_REGNUM])
         get_frame_extra_info (fi)->saved_pc
           = ADDR_BITS_REMOVE (read_memory_integer
-                              (get_frame_saved_regs (fi)[S390_RETADDR_REGNUM],
+                              (deprecated_get_frame_saved_regs (fi)[S390_RETADDR_REGNUM],
                                S390_GPR_SIZE));
       else
         get_frame_extra_info (fi)->saved_pc
@@ -1841,24 +1824,24 @@ s390_frame_chain (struct frame_info *thisframe)
        }
       else
        {
-         if (get_frame_saved_regs (thisframe))
+         if (deprecated_get_frame_saved_regs (thisframe))
            {
              int regno;
 
               if (prev_fextra_info.frame_pointer_saved_pc
-                  && get_frame_saved_regs (thisframe)[S390_FRAME_REGNUM])
+                  && deprecated_get_frame_saved_regs (thisframe)[S390_FRAME_REGNUM])
                 regno = S390_FRAME_REGNUM;
               else
                 regno = S390_SP_REGNUM;
 
-             if (get_frame_saved_regs (thisframe)[regno])
+             if (deprecated_get_frame_saved_regs (thisframe)[regno])
                 {
                   /* The SP's entry of `saved_regs' is special.  */
                   if (regno == S390_SP_REGNUM)
-                    prev_fp = get_frame_saved_regs (thisframe)[regno];
+                    prev_fp = deprecated_get_frame_saved_regs (thisframe)[regno];
                   else
                     prev_fp =
-                      read_memory_integer (get_frame_saved_regs (thisframe)[regno],
+                      read_memory_integer (deprecated_get_frame_saved_regs (thisframe)[regno],
                                            S390_GPR_SIZE);
                 }
            }
@@ -1874,6 +1857,15 @@ s390_frame_chain (struct frame_info *thisframe)
 
 
 
+/* NOTE: cagney/2003-10-31: "return_value" makes
+   "extract_struct_value_address", "extract_return_value", and
+   "use_struct_convention" redundant.  */
+static CORE_ADDR
+s390_cannot_extract_struct_value_address (struct regcache *regcache)
+{
+  return 0;
+}
+
 /* a given return value in `regbuf' with a type `valtype', extract and copy its
    value into `valbuf' */
 static void
@@ -1992,22 +1984,22 @@ s390_pop_frame_regular (struct frame_info *frame)
   write_register (S390_PC_REGNUM, DEPRECATED_FRAME_SAVED_PC (frame));
 
   /* Restore any saved registers.  */
-  if (get_frame_saved_regs (frame))
+  if (deprecated_get_frame_saved_regs (frame))
     {
       for (regnum = 0; regnum < NUM_REGS; regnum++)
-        if (get_frame_saved_regs (frame)[regnum] != 0)
+        if (deprecated_get_frame_saved_regs (frame)[regnum] != 0)
           {
             ULONGEST value;
             
-            value = read_memory_unsigned_integer (get_frame_saved_regs (frame)[regnum],
-                                                  REGISTER_RAW_SIZE (regnum));
+            value = read_memory_unsigned_integer (deprecated_get_frame_saved_regs (frame)[regnum],
+                                                  DEPRECATED_REGISTER_RAW_SIZE (regnum));
             write_register (regnum, value);
           }
 
       /* Actually cut back the stack.  Remember that the SP's element of
          saved_regs is the old SP itself, not the address at which it is
          saved.  */
-      write_register (S390_SP_REGNUM, get_frame_saved_regs (frame)[S390_SP_REGNUM]);
+      write_register (S390_SP_REGNUM, deprecated_get_frame_saved_regs (frame)[S390_SP_REGNUM]);
     }
 
   /* Throw away any cached frame information.  */
@@ -2570,12 +2562,11 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
   /* 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);
+  set_gdbarch_deprecated_init_frame_pc (gdbarch, deprecated_init_frame_pc_default);
 
   set_gdbarch_believe_pcc_promotion (gdbarch, 0);
   set_gdbarch_char_signed (gdbarch, 0);
 
-  set_gdbarch_frame_args_skip (gdbarch, 0);
   set_gdbarch_deprecated_frame_chain (gdbarch, s390_frame_chain);
   set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, s390_frame_init_saved_regs);
   set_gdbarch_deprecated_store_struct_return (gdbarch, s390_store_struct_return);
@@ -2588,9 +2579,6 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_deprecated_pop_frame (gdbarch, s390_pop_frame);
   /* Stack grows downward.  */
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
-  /* Offset from address of function to start of its code.
-     Zero on most machines.  */
-  set_gdbarch_function_start_offset (gdbarch, 0);
   set_gdbarch_deprecated_max_register_raw_size (gdbarch, 8);
   set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 8);
   set_gdbarch_breakpoint_from_pc (gdbarch, s390_breakpoint_from_pc);
@@ -2622,8 +2610,7 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_stab_reg_to_regnum (gdbarch, s390_stab_reg_to_regnum);
   set_gdbarch_dwarf_reg_to_regnum (gdbarch, s390_stab_reg_to_regnum);
   set_gdbarch_dwarf2_reg_to_regnum (gdbarch, s390_stab_reg_to_regnum);
-  set_gdbarch_deprecated_extract_struct_value_address
-    (gdbarch, generic_cannot_extract_struct_value_address);
+  set_gdbarch_deprecated_extract_struct_value_address (gdbarch, s390_cannot_extract_struct_value_address);
 
   /* Parameters for inferior function calls.  */
   set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point);
This page took 0.033498 seconds and 4 git commands to generate.