* elf64-ppc.c (ppc64_elf_relocate_section): Optimize unaligned relocs.
[deliverable/binutils-gdb.git] / gdb / s390-tdep.c
index f3f7dcb919b3aee4cb8edb68df27e93029e0f764..10df09501b3503bd7b07b0a51f1c931fe1cef01e 100644 (file)
@@ -1,5 +1,7 @@
 /* Target-dependent code for GDB, the GNU debugger.
-   Copyright 2001 Free Software Foundation, Inc.
+
+   Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
+
    Contributed by D.J. Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com)
    for IBM Deutschland Entwicklung GmbH, IBM Corporation.
 
 
 
 /* Number of bytes of storage in the actual machine representation
-   for register N. 
-   Note that the unsigned cast here forces the result of the
-   subtraction to very high positive values if N < S390_FP0_REGNUM */
-int
+   for register N.  */
+static int
 s390_register_raw_size (int reg_nr)
 {
-  return ((unsigned) reg_nr - S390_FP0_REGNUM) <
-    S390_NUM_FPRS ? S390_FPR_SIZE : 4;
+  if (S390_FP0_REGNUM <= reg_nr
+      && reg_nr < S390_FP0_REGNUM + S390_NUM_FPRS)
+    return S390_FPR_SIZE;
+  else
+    return 4;
 }
 
-int
+static int
 s390x_register_raw_size (int reg_nr)
 {
   return (reg_nr == S390_FPC_REGNUM)
     || (reg_nr >= S390_FIRST_ACR && reg_nr <= S390_LAST_ACR) ? 4 : 8;
 }
 
-int
+static int
 s390_cannot_fetch_register (int regno)
 {
   return (regno >= S390_FIRST_CR && regno < (S390_FIRST_CR + 9)) ||
     (regno >= (S390_FIRST_CR + 12) && regno <= S390_LAST_CR);
 }
 
-int
+static int
 s390_register_byte (int reg_nr)
 {
   if (reg_nr <= S390_GP_LAST_REGNUM)
@@ -116,7 +119,7 @@ struct frame_extra_info
 
 static CORE_ADDR s390_frame_saved_pc_nofix (struct frame_info *fi);
 
-int
+static int
 s390_readinstruction (bfd_byte instr[], CORE_ADDR at,
                      struct disassemble_info *info)
 {
@@ -131,8 +134,11 @@ s390_readinstruction (bfd_byte instr[], CORE_ADDR at,
   if ((*info->read_memory_func) (at, &instr[0], 2, info))
     return -1;
   instrlen = s390_instrlen[instr[0] >> 6];
-  if ((*info->read_memory_func) (at + 2, &instr[2], instrlen - 2, info))
-    return -1;
+  if (instrlen > 2)
+    {
+      if ((*info->read_memory_func) (at + 2, &instr[2], instrlen - 2, info))
+        return -1;
+    }
   return instrlen;
 }
 
@@ -144,7 +150,7 @@ s390_memset_extra_info (struct frame_extra_info *fextra_info)
 
 
 
-char *
+static const char *
 s390_register_name (int reg_nr)
 {
   static char *register_names[] = {
@@ -160,15 +166,16 @@ s390_register_name (int reg_nr)
     "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15"
   };
 
-  if (reg_nr >= S390_LAST_REGNUM)
+  if (reg_nr <= S390_LAST_REGNUM)
+    return register_names[reg_nr];
+  else
     return NULL;
-  return register_names[reg_nr];
 }
 
 
 
 
-int
+static int
 s390_stab_reg_to_regnum (int regno)
 {
   return regno >= 64 ? S390_PSWM_REGNUM - 64 :
@@ -180,6 +187,14 @@ s390_stab_reg_to_regnum (int regno)
 }
 
 
+/* Return true if REGIDX is the number of a register used to pass
+     arguments, false otherwise.  */
+static int
+is_arg_reg (int regidx)
+{
+  return 2 <= regidx && regidx <= 6;
+}
+
 
 /* s390_get_frame_info based on Hartmuts
    prologue definition in
@@ -195,7 +210,7 @@ s390_stab_reg_to_regnum (int regno)
 
  */
 
-int
+static int
 s390_get_frame_info (CORE_ADDR pc, struct frame_extra_info *fextra_info,
                     struct frame_info *fi, int init_extra_info)
 {
@@ -208,15 +223,45 @@ s390_get_frame_info (CORE_ADDR pc, struct frame_extra_info *fextra_info,
   int gprs_saved[S390_NUM_GPRS];
   int fprs_saved[S390_NUM_FPRS];
   int regidx, instrlen;
-  int save_link_regidx, subtract_sp_regidx;
-  int const_pool_state, save_link_state;
-  int frame_pointer_found, varargs_state;
+  int const_pool_state;
+  int varargs_state;
   int loop_cnt, gdb_gpr_store, gdb_fpr_store;
-  int frame_pointer_regidx = 0xf;
   int offset, expected_offset;
   int err = 0;
   disassemble_info info;
 
+  /* Have we seen an instruction initializing the frame pointer yet?
+     If we've seen an `lr %r11, %r15', then frame_pointer_found is
+     non-zero, and frame_pointer_regidx == 11.  Otherwise,
+     frame_pointer_found is zero and frame_pointer_regidx is 15,
+     indicating that we're using the stack pointer as our frame
+     pointer.  */
+  int frame_pointer_found = 0;
+  int frame_pointer_regidx = 0xf;
+
+  /* What we've seen so far regarding saving the back chain link:
+     0 -- nothing yet; sp still has the same value it had at the entry
+          point.  Since not all functions allocate frames, this is a
+          valid state for the prologue to finish in.
+     1 -- We've saved the original sp in some register other than the
+          frame pointer (hard-coded to be %r11, yuck).
+          save_link_regidx is the register we saved it in.
+     2 -- We've seen the initial `bras' instruction of the sequence for
+          reserving more than 32k of stack:
+                bras %rX, .+8
+                .long N
+                s %r15, 0(%rX)
+          where %rX is not the constant pool register.
+          subtract_sp_regidx is %rX, and fextra_info->stack_bought is N.
+     3 -- We've reserved space for a new stack frame.  This means we
+          either saw a simple `ahi %r15,-N' in state 1, or the final
+          `s %r15, ...' in state 2.
+     4 -- The frame and link are now fully initialized.  We've
+          reserved space for the new stack frame, and stored the old
+          stack pointer captured in the back chain pointer field.  */
+  int save_link_state = 0;
+  int save_link_regidx, subtract_sp_regidx;
+
   /* What we've seen so far regarding r12 --- the GOT (Global Offset
      Table) pointer.  We expect to see `l %r12, N(%r13)', which loads
      r12 with the offset from the constant pool to the GOT, and then
@@ -228,22 +273,24 @@ s390_get_frame_info (CORE_ADDR pc, struct frame_extra_info *fextra_info,
      When got_state is 1, then got_load_addr is the address of the
      load instruction, and got_load_len is the length of that
      instruction.  */
-  int got_state;
+  int got_state= 0;
   CORE_ADDR got_load_addr = 0, got_load_len = 0;
 
-  const_pool_state = save_link_state = got_state = varargs_state = 0;
-  frame_pointer_found = 0;
+  const_pool_state = varargs_state = 0;
+
   memset (gprs_saved, 0, sizeof (gprs_saved));
   memset (fprs_saved, 0, sizeof (fprs_saved));
-  info.read_memory_func = dis_asm_read_memory;
+  info.read_memory_func = deprecated_tm_print_insn_info.read_memory_func;
 
   save_link_regidx = subtract_sp_regidx = 0;
   if (fextra_info)
     {
-      if (fi && fi->frame)
+      if (fi && get_frame_base (fi))
        {
-         orig_sp = fi->frame + fextra_info->stack_bought;
-         saved_regs = fi->saved_regs;
+          orig_sp = get_frame_base (fi);
+          if (! init_extra_info && fextra_info->initialised)
+            orig_sp += fextra_info->stack_bought;
+         saved_regs = get_frame_saved_regs (fi);
        }
       if (init_extra_info || !fextra_info->initialised)
        {
@@ -269,18 +316,19 @@ s390_get_frame_info (CORE_ADDR pc, struct frame_extra_info *fextra_info,
       if (instr[0] == S390_SYSCALL_OPCODE && test_pc == pc)
        {
          good_prologue = 1;
-         if (saved_regs && fextra_info && fi->next && fi->next->extra_info
-             && fi->next->extra_info->sigcontext)
+         if (saved_regs && fextra_info && get_next_frame (fi)
+             && get_frame_extra_info (get_next_frame (fi))
+             && get_frame_extra_info (get_next_frame (fi))->sigcontext)
            {
              /* We are backtracing from a signal handler */
-             save_reg_addr = fi->next->extra_info->sigcontext +
+             save_reg_addr = get_frame_extra_info (get_next_frame (fi))->sigcontext +
                REGISTER_BYTE (S390_GP0_REGNUM);
              for (regidx = 0; regidx < S390_NUM_GPRS; regidx++)
                {
                  saved_regs[S390_GP0_REGNUM + regidx] = save_reg_addr;
                  save_reg_addr += S390_GPR_SIZE;
                }
-             save_reg_addr = fi->next->extra_info->sigcontext +
+             save_reg_addr = get_frame_extra_info (get_next_frame (fi))->sigcontext +
                (GDB_TARGET_IS_ESAME ? S390X_SIGREGS_FP0_OFFSET :
                 S390_SIGREGS_FP0_OFFSET);
              for (regidx = 0; regidx < S390_NUM_FPRS; regidx++)
@@ -374,6 +422,28 @@ s390_get_frame_info (CORE_ADDR pc, struct frame_extra_info *fextra_info,
          continue;
        }
 
+      /* Check for an fp-relative STG, ST, or STM.  This is probably
+          spilling an argument from a register out into a stack slot.
+          This could be a user instruction, but if we haven't included
+          any other suspicious instructions in the prologue, this
+          could only be an initializing store, which isn't too bad to
+          skip.  The consequences of not including arg-to-stack spills
+          are more serious, though --- you don't see the proper values
+          of the arguments.  */
+      if ((save_link_state == 3 || save_link_state == 4)
+          && ((instr[0] == 0x50      /* st %rA, D(%rX,%rB) */
+               && (instr[1] & 0xf) == 0 /* %rX is zero, no index reg */
+               && is_arg_reg ((instr[1] >> 4) & 0xf)
+               && ((instr[2] >> 4) & 0xf) == frame_pointer_regidx)
+              || (instr[0] == 0x90 /* stm %rA, %rB, D(%rC) */
+                  && is_arg_reg ((instr[1] >> 4) & 0xf)
+                  && is_arg_reg (instr[1] & 0xf)
+                  && ((instr[2] >> 4) & 0xf) == frame_pointer_regidx)))
+        {
+          valid_prologue = 1;
+          continue;
+        }
+
       /* check for STD */
       if (instr[0] == 0x60 && (instr[2] >> 4) == 0xf)
        {
@@ -492,7 +562,8 @@ s390_get_frame_info (CORE_ADDR pc, struct frame_extra_info *fextra_info,
       /* Alternatively check for the complex construction for
          buying more than 32k of stack
          BRAS gprx,.+8
-         long vals    %r15,0(%gprx)  gprx currently r1 */
+         long val
+         s    %r15,0(%gprx)  gprx currently r1 */
       if ((save_link_state == 1) && (instr[0] == 0xa7)
          && ((instr[1] & 0xf) == 0x5) && (instr[2] == 0)
          && (instr[3] == 0x4) && ((instr[1] >> 4) != CONST_POOL_REGIDX))
@@ -604,14 +675,14 @@ s390_get_frame_info (CORE_ADDR pc, struct frame_extra_info *fextra_info,
 }
 
 
-int
+static int
 s390_check_function_end (CORE_ADDR pc)
 {
   bfd_byte instr[S390_MAX_INSTR_SIZE];
   disassemble_info info;
   int regidx, instrlen;
 
-  info.read_memory_func = dis_asm_read_memory;
+  info.read_memory_func = deprecated_tm_print_insn_info.read_memory_func;
   instrlen = s390_readinstruction (instr, pc, &info);
   if (instrlen < 0)
     return -1;
@@ -696,35 +767,35 @@ s390_sniff_pc_function_start (CORE_ADDR pc, struct frame_info *fi)
 
 
 
-CORE_ADDR
+static CORE_ADDR
 s390_function_start (struct frame_info *fi)
 {
   CORE_ADDR function_start = 0;
 
-  if (fi->extra_info && fi->extra_info->initialised)
-    function_start = fi->extra_info->function_start;
-  else if (fi->pc)
-    function_start = get_pc_function_start (fi->pc);
+  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;
 }
 
 
 
 
-int
+static int
 s390_frameless_function_invocation (struct frame_info *fi)
 {
   struct frame_extra_info fextra_info, *fextra_info_ptr;
   int frameless = 0;
 
-  if (fi->next == NULL)                /* no may be frameless */
+  if (get_next_frame (fi) == NULL)             /* no may be frameless */
     {
-      if (fi->extra_info)
-       fextra_info_ptr = fi->extra_info;
+      if (get_frame_extra_info (fi))
+       fextra_info_ptr = get_frame_extra_info (fi);
       else
        {
          fextra_info_ptr = &fextra_info;
-         s390_get_frame_info (s390_sniff_pc_function_start (fi->pc, fi),
+         s390_get_frame_info (s390_sniff_pc_function_start (get_frame_pc (fi), fi),
                               fextra_info_ptr, fi, 1);
        }
       frameless = ((fextra_info_ptr->stack_bought == 0));
@@ -748,7 +819,7 @@ s390_is_sigreturn (CORE_ADDR pc, struct frame_info *sighandler_fi,
 
   scontext = temp_sregs = 0;
 
-  info.read_memory_func = dis_asm_read_memory;
+  info.read_memory_func = deprecated_tm_print_insn_info.read_memory_func;
   instrlen = s390_readinstruction (instr, pc, &info);
   if (sigcaller_pc)
     *sigcaller_pc = 0;
@@ -759,11 +830,10 @@ s390_is_sigreturn (CORE_ADDR pc, struct frame_info *sighandler_fi,
       if (sighandler_fi)
        {
          if (s390_frameless_function_invocation (sighandler_fi))
-           orig_sp = sighandler_fi->frame;
+           orig_sp = get_frame_base (sighandler_fi);
          else
            orig_sp = ADDR_BITS_REMOVE ((CORE_ADDR)
-                                       read_memory_integer (sighandler_fi->
-                                                            frame,
+                                       read_memory_integer (get_frame_base (sighandler_fi),
                                                             S390_GPR_SIZE));
          if (orig_sp && sigcaller_pc)
            {
@@ -811,115 +881,114 @@ s390_is_sigreturn (CORE_ADDR pc, struct frame_info *sighandler_fi,
   for the moment.
   For some reason the blockframe.c calls us with fi->next->fromleaf
   so this seems of little use to us. */
-void
+static CORE_ADDR
 s390_init_frame_pc_first (int next_fromleaf, struct frame_info *fi)
 {
   CORE_ADDR sigcaller_pc;
-
-  fi->pc = 0;
+  CORE_ADDR pc = 0;
   if (next_fromleaf)
     {
-      fi->pc = ADDR_BITS_REMOVE (read_register (S390_RETADDR_REGNUM));
+      pc = ADDR_BITS_REMOVE (read_register (S390_RETADDR_REGNUM));
       /* fix signal handlers */
     }
-  else if (fi->next && fi->next->pc)
-    fi->pc = s390_frame_saved_pc_nofix (fi->next);
-  if (fi->pc && fi->next && fi->next->frame &&
-      s390_is_sigreturn (fi->pc, fi->next, NULL, &sigcaller_pc))
+  else if (get_next_frame (fi) && get_frame_pc (get_next_frame (fi)))
+    pc = s390_frame_saved_pc_nofix (get_next_frame (fi));
+  if (pc && get_next_frame (fi) && get_frame_base (get_next_frame (fi))
+      && s390_is_sigreturn (pc, get_next_frame (fi), NULL, &sigcaller_pc))
     {
-      fi->pc = sigcaller_pc;
+      pc = sigcaller_pc;
     }
-
+  return pc;
 }
 
-void
+static void
 s390_init_extra_frame_info (int fromleaf, struct frame_info *fi)
 {
-  fi->extra_info = frame_obstack_alloc (sizeof (struct frame_extra_info));
-  if (fi->pc)
-    s390_get_frame_info (s390_sniff_pc_function_start (fi->pc, fi),
-                        fi->extra_info, fi, 1);
+  frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info));
+  if (get_frame_pc (fi))
+    s390_get_frame_info (s390_sniff_pc_function_start (get_frame_pc (fi), fi),
+                        get_frame_extra_info (fi), fi, 1);
   else
-    s390_memset_extra_info (fi->extra_info);
+    s390_memset_extra_info (get_frame_extra_info (fi));
 }
 
 /* If saved registers of frame FI are not known yet, read and cache them.
    &FEXTRA_INFOP contains struct frame_extra_info; TDATAP can be NULL,
    in which case the framedata are read.  */
 
-void
+static void
 s390_frame_init_saved_regs (struct frame_info *fi)
 {
 
   int quick;
 
-  if (fi->saved_regs == NULL)
+  if (get_frame_saved_regs (fi) == NULL)
     {
       /* zalloc memsets the saved regs */
       frame_saved_regs_zalloc (fi);
-      if (fi->pc)
+      if (get_frame_pc (fi))
        {
-         quick = (fi->extra_info && fi->extra_info->initialised
-                  && fi->extra_info->good_prologue);
-         s390_get_frame_info (quick ? fi->extra_info->function_start :
-                              s390_sniff_pc_function_start (fi->pc, fi),
-                              fi->extra_info, fi, !quick);
+         quick = (get_frame_extra_info (fi)
+                  && get_frame_extra_info (fi)->initialised
+                  && get_frame_extra_info (fi)->good_prologue);
+         s390_get_frame_info (quick
+                              ? get_frame_extra_info (fi)->function_start
+                              : s390_sniff_pc_function_start (get_frame_pc (fi), fi),
+                              get_frame_extra_info (fi), fi, !quick);
        }
     }
 }
 
 
 
-CORE_ADDR
-s390_frame_args_address (struct frame_info *fi)
-{
-
-  /* Apparently gdb already knows gdb_args_offset itself */
-  return fi->frame;
-}
-
-
 static CORE_ADDR
 s390_frame_saved_pc_nofix (struct frame_info *fi)
 {
-  if (fi->extra_info && fi->extra_info->saved_pc_valid)
-    return fi->extra_info->saved_pc;
+  if (get_frame_extra_info (fi) && get_frame_extra_info (fi)->saved_pc_valid)
+    return get_frame_extra_info (fi)->saved_pc;
+
+  if (deprecated_generic_find_dummy_frame (get_frame_pc (fi),
+                                          get_frame_base (fi)))
+    return deprecated_read_register_dummy (get_frame_pc (fi),
+                                          get_frame_base (fi), S390_PC_REGNUM);
+
   s390_frame_init_saved_regs (fi);
-  if (fi->extra_info)
+  if (get_frame_extra_info (fi))
     {
-      fi->extra_info->saved_pc_valid = 1;
-      if (fi->extra_info->good_prologue)
-       {
-         if (fi->saved_regs[S390_RETADDR_REGNUM])
-           {
-             return (fi->extra_info->saved_pc =
-                     ADDR_BITS_REMOVE (read_memory_integer
-                                       (fi->saved_regs[S390_RETADDR_REGNUM],
-                                        S390_GPR_SIZE)));
-           }
-       }
+      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])
+        get_frame_extra_info (fi)->saved_pc
+          = ADDR_BITS_REMOVE (read_memory_integer
+                              (get_frame_saved_regs (fi)[S390_RETADDR_REGNUM],
+                               S390_GPR_SIZE));
+      else
+        get_frame_extra_info (fi)->saved_pc
+          = ADDR_BITS_REMOVE (read_register (S390_RETADDR_REGNUM));
+      return get_frame_extra_info (fi)->saved_pc;
     }
   return 0;
 }
 
-CORE_ADDR
+static CORE_ADDR
 s390_frame_saved_pc (struct frame_info *fi)
 {
   CORE_ADDR saved_pc = 0, sig_pc;
 
-  if (fi->extra_info && fi->extra_info->sig_fixed_saved_pc_valid)
-    return fi->extra_info->sig_fixed_saved_pc;
+  if (get_frame_extra_info (fi)
+      && get_frame_extra_info (fi)->sig_fixed_saved_pc_valid)
+    return get_frame_extra_info (fi)->sig_fixed_saved_pc;
   saved_pc = s390_frame_saved_pc_nofix (fi);
 
-  if (fi->extra_info)
+  if (get_frame_extra_info (fi))
     {
-      fi->extra_info->sig_fixed_saved_pc_valid = 1;
+      get_frame_extra_info (fi)->sig_fixed_saved_pc_valid = 1;
       if (saved_pc)
        {
          if (s390_is_sigreturn (saved_pc, fi, NULL, &sig_pc))
            saved_pc = sig_pc;
        }
-      fi->extra_info->sig_fixed_saved_pc = saved_pc;
+      get_frame_extra_info (fi)->sig_fixed_saved_pc = saved_pc;
     }
   return saved_pc;
 }
@@ -927,16 +996,19 @@ s390_frame_saved_pc (struct frame_info *fi)
 
 
 
-/* We want backtraces out of signal handlers so we don't
-   set thisframe->signal_handler_caller to 1 */
+/* We want backtraces out of signal handlers so we don't set
+   (get_frame_type (thisframe) == SIGTRAMP_FRAME) to 1 */
 
-CORE_ADDR
+static CORE_ADDR
 s390_frame_chain (struct frame_info *thisframe)
 {
   CORE_ADDR prev_fp = 0;
 
-  if (thisframe->prev && thisframe->prev->frame)
-    prev_fp = thisframe->prev->frame;
+  if (deprecated_generic_find_dummy_frame (get_frame_pc (thisframe),
+                                          get_frame_base (thisframe)))
+    return deprecated_read_register_dummy (get_frame_pc (thisframe),
+                                          get_frame_base (thisframe),
+                                          S390_SP_REGNUM);
   else
     {
       int sigreturn = 0;
@@ -944,7 +1016,7 @@ s390_frame_chain (struct frame_info *thisframe)
       struct frame_extra_info prev_fextra_info;
 
       memset (&prev_fextra_info, 0, sizeof (prev_fextra_info));
-      if (thisframe->pc)
+      if (get_frame_pc (thisframe))
        {
          CORE_ADDR saved_pc, sig_pc;
 
@@ -968,24 +1040,30 @@ s390_frame_chain (struct frame_info *thisframe)
                                                         frame_pointer_saved_pc
                                                         ? 11 : 15)),
                                         S390_GPR_SIZE);
-         thisframe->extra_info->sigcontext = sregs;
+         get_frame_extra_info (thisframe)->sigcontext = sregs;
        }
       else
        {
-         if (thisframe->saved_regs)
+         if (get_frame_saved_regs (thisframe))
            {
-
              int regno;
 
-             regno =
-               ((prev_fextra_info.frame_pointer_saved_pc
-                 && thisframe->
-                 saved_regs[S390_FRAME_REGNUM]) ? S390_FRAME_REGNUM :
-                S390_SP_REGNUM);
-             if (thisframe->saved_regs[regno])
-               prev_fp =
-                 read_memory_integer (thisframe->saved_regs[regno],
-                                      S390_GPR_SIZE);
+              if (prev_fextra_info.frame_pointer_saved_pc
+                  && get_frame_saved_regs (thisframe)[S390_FRAME_REGNUM])
+                regno = S390_FRAME_REGNUM;
+              else
+                regno = S390_SP_REGNUM;
+
+             if (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];
+                  else
+                    prev_fp =
+                      read_memory_integer (get_frame_saved_regs (thisframe)[regno],
+                                           S390_GPR_SIZE);
+                }
            }
        }
     }
@@ -1001,7 +1079,7 @@ s390_frame_chain (struct frame_info *thisframe)
 
 /* a given return value in `regbuf' with a type `valtype', extract and copy its
    value into `valbuf' */
-void
+static void
 s390_extract_return_value (struct type *valtype, char *regbuf, char *valbuf)
 {
   /* floats and doubles are returned in fpr0. fpr's have a size of 8 bytes.
@@ -1059,28 +1137,29 @@ s390_promote_integer_argument (struct type *valtype, char *valbuf,
   return (value);
 }
 
-void
+static void
 s390_store_return_value (struct type *valtype, char *valbuf)
 {
   int arglen;
-  char *reg_buff = alloca (max (S390_FPR_SIZE, REGISTER_SIZE)), *value;
+  char *reg_buff = alloca (max (S390_FPR_SIZE, DEPRECATED_REGISTER_SIZE)), *value;
 
   if (TYPE_CODE (valtype) == TYPE_CODE_FLT)
     {
-      DOUBLEST tempfloat = extract_floating (valbuf, TYPE_LENGTH (valtype));
-
-      floatformat_from_doublest (&floatformat_ieee_double_big, &tempfloat,
-                                reg_buff);
-      write_register_bytes (REGISTER_BYTE (S390_FP0_REGNUM), reg_buff,
-                           S390_FPR_SIZE);
+      if (TYPE_LENGTH (valtype) == 4
+          || TYPE_LENGTH (valtype) == 8)
+        deprecated_write_register_bytes (REGISTER_BYTE (S390_FP0_REGNUM),
+                                        valbuf, TYPE_LENGTH (valtype));
+      else
+        error ("GDB is unable to return `long double' values "
+               "on this architecture.");
     }
   else
     {
       value =
        s390_promote_integer_argument (valtype, valbuf, reg_buff, &arglen);
       /* Everything else is returned in GPR2 and up. */
-      write_register_bytes (REGISTER_BYTE (S390_GP0_REGNUM + 2), value,
-                           arglen);
+      deprecated_write_register_bytes (REGISTER_BYTE (S390_GP0_REGNUM + 2),
+                                      value, arglen);
     }
 }
 static int
@@ -1106,8 +1185,8 @@ gdb_print_insn_s390 (bfd_vma memaddr, disassemble_info * info)
 
 
 /* Not the most efficent code in the world */
-int
-s390_fp_regnum ()
+static int
+s390_fp_regnum (void)
 {
   int regno = S390_SP_REGNUM;
   struct frame_extra_info fextra_info;
@@ -1121,58 +1200,38 @@ s390_fp_regnum ()
   return regno;
 }
 
-CORE_ADDR
-s390_read_fp ()
+static CORE_ADDR
+s390_read_fp (void)
 {
   return read_register (s390_fp_regnum ());
 }
 
 
-void
-s390_write_fp (CORE_ADDR val)
-{
-  write_register (s390_fp_regnum (), val);
-}
-
-
-void
-s390_push_dummy_frame ()
-{
-  CORE_ADDR orig_sp = read_register (S390_SP_REGNUM), new_sp;
-  void *saved_regs = alloca (REGISTER_BYTES);
-
-  new_sp = (orig_sp - (REGISTER_BYTES + S390_GPR_SIZE));
-  read_register_bytes (0, (char *) saved_regs, REGISTER_BYTES);
-  /* Use saved copy instead of orig_sp as this will have the correct endianness */
-  write_memory (new_sp, (char *) saved_regs + REGISTER_BYTE (S390_SP_REGNUM),
-               S390_GPR_SIZE);
-  write_memory (new_sp + S390_GPR_SIZE, (char *) &saved_regs, REGISTER_BYTES);
-  write_register (S390_SP_REGNUM, new_sp);
-}
-
-
 static void
 s390_pop_frame_regular (struct frame_info *frame)
 {
   int regnum;
 
-  write_register (S390_PC_REGNUM, FRAME_SAVED_PC (frame));
+  write_register (S390_PC_REGNUM, DEPRECATED_FRAME_SAVED_PC (frame));
 
   /* Restore any saved registers.  */
-  for (regnum = 0; regnum < NUM_REGS; regnum++)
-    if (frame->saved_regs[regnum] != 0)
-      {
-        ULONGEST value;
-
-        value = read_memory_unsigned_integer (frame->saved_regs[regnum],
-                                              REGISTER_RAW_SIZE (regnum));
-        write_register (regnum, value);
-      }
+  if (get_frame_saved_regs (frame))
+    {
+      for (regnum = 0; regnum < NUM_REGS; regnum++)
+        if (get_frame_saved_regs (frame)[regnum] != 0)
+          {
+            ULONGEST value;
+            
+            value = read_memory_unsigned_integer (get_frame_saved_regs (frame)[regnum],
+                                                  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, frame->saved_regs[S390_SP_REGNUM]);
+      /* 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]);
+    }
 
   /* Throw away any cached frame information.  */
   flush_cached_frames ();
@@ -1183,8 +1242,8 @@ s390_pop_frame_regular (struct frame_info *frame)
    machine state that was in effect before the frame was created. 
    Used in the contexts of the "return" command, and of 
    target function calls from the debugger.  */
-void
-s390_pop_frame ()
+static void
+s390_pop_frame (void)
 {
   /* This function checks for and handles generic dummy frames, and
      calls back to our function for ordinary frames.  */
@@ -1285,7 +1344,7 @@ is_float_like (struct type *type)
 
 /* Return non-zero if TYPE is considered a `DOUBLE_OR_FLOAT', as
    defined by the parameter passing conventions described in the
-   "Linux for S/390 ELF Application Binary Interface Supplement".
+   "GNU/Linux for S/390 ELF Application Binary Interface Supplement".
    Otherwise, return zero.  */
 static int
 is_double_or_float (struct type *type)
@@ -1297,8 +1356,9 @@ is_double_or_float (struct type *type)
 
 
 /* Return non-zero if TYPE is considered a `SIMPLE_ARG', as defined by
-   the parameter passing conventions described in the "Linux for S/390
-   ELF Application Binary Interface Supplement".  Return zero otherwise.  */
+   the parameter passing conventions described in the "GNU/Linux for
+   S/390 ELF Application Binary Interface Supplement".  Return zero
+   otherwise.  */
 static int
 is_simple_arg (struct type *type)
 {
@@ -1346,8 +1406,9 @@ extend_simple_arg (struct value *arg)
 
 
 /* Return non-zero if TYPE is a `DOUBLE_ARG', as defined by the
-   parameter passing conventions described in the "Linux for S/390 ELF
-   Application Binary Interface Supplement".  Return zero otherwise.  */
+   parameter passing conventions described in the "GNU/Linux for S/390
+   ELF Application Binary Interface Supplement".  Return zero
+   otherwise.  */
 static int
 is_double_arg (struct type *type)
 {
@@ -1418,8 +1479,8 @@ alignment_of (struct type *type)
 
 
 /* Put the actual parameter values pointed to by ARGS[0..NARGS-1] in
-   place to be passed to a function, as specified by the "Linux for
-   S/390 ELF Application Binary Interface Supplement".
+   place to be passed to a function, as specified by the "GNU/Linux
+   for S/390 ELF Application Binary Interface Supplement".
 
    SP is the current stack pointer.  We must put arguments, links,
    padding, etc. whereever they belong, and return the new stack
@@ -1431,7 +1492,7 @@ alignment_of (struct type *type)
 
    Our caller has taken care of any type promotions needed to satisfy
    prototypes or the old K&R argument-passing rules.  */
-CORE_ADDR
+static CORE_ADDR
 s390_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
                     int struct_return, CORE_ADDR struct_addr)
 {
@@ -1511,9 +1572,9 @@ s390_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
           {
             /* When we store a single-precision value in an FP register,
                it occupies the leftmost bits.  */
-            write_register_bytes (REGISTER_BYTE (S390_FP0_REGNUM + fr),
-                                  VALUE_CONTENTS (arg),
-                                  TYPE_LENGTH (type));
+            deprecated_write_register_bytes (REGISTER_BYTE (S390_FP0_REGNUM + fr),
+                                            VALUE_CONTENTS (arg),
+                                            TYPE_LENGTH (type));
             fr += 2;
           }
         else if (is_simple_arg (type)
@@ -1531,10 +1592,10 @@ s390_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
         else if (is_double_arg (type)
                  && gr <= 5)
           {
-            write_register_gen (S390_GP0_REGNUM + gr,
-                                VALUE_CONTENTS (arg));
-            write_register_gen (S390_GP0_REGNUM + gr + 1,
-                                VALUE_CONTENTS (arg) + 4);
+            deprecated_write_register_gen (S390_GP0_REGNUM + gr,
+                                          VALUE_CONTENTS (arg));
+            deprecated_write_register_gen (S390_GP0_REGNUM + gr + 1,
+                                          VALUE_CONTENTS (arg) + 4);
             gr += 2;
           }
         else
@@ -1588,22 +1649,44 @@ s390_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
      frame.  This will help us get backtraces from within functions
      called from GDB.  */
   write_memory_unsigned_integer (sp, (TARGET_PTR_BIT / TARGET_CHAR_BIT),
-                                 read_fp ());
+                                 deprecated_read_fp ());
 
   return sp;
 }
 
+
+static CORE_ADDR
+s390_frame_align (struct gdbarch *gdbarch, CORE_ADDR addr)
+{
+  /* Both the 32- and 64-bit ABI's say that the stack pointer should
+     always be aligned on an eight-byte boundary.  */
+  return (addr & -8);
+}
+
+
+static int
+s390_use_struct_convention (int gcc_p, struct type *value_type)
+{
+  enum type_code code = TYPE_CODE (value_type);
+
+  return (code == TYPE_CODE_STRUCT
+          || code == TYPE_CODE_UNION);
+}
+
+
 /* Return the GDB type object for the "standard" data type
    of data in register N.  */
-struct type *
+static struct type *
 s390_register_virtual_type (int regno)
 {
-  return ((unsigned) regno - S390_FPC_REGNUM) <
-    S390_NUM_FPRS ? builtin_type_double : builtin_type_int;
+  if (S390_FP0_REGNUM <= regno && regno < S390_FP0_REGNUM + S390_NUM_FPRS)
+    return builtin_type_double;
+  else
+    return builtin_type_int;
 }
 
 
-struct type *
+static struct type *
 s390x_register_virtual_type (int regno)
 {
   return (regno == S390_FPC_REGNUM) ||
@@ -1613,7 +1696,7 @@ s390x_register_virtual_type (int regno)
 
 
 
-void
+static void
 s390_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
 {
   write_register (S390_GP0_REGNUM + 2, addr);
@@ -1621,7 +1704,7 @@ s390_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
 
 
 
-static unsigned char *
+static const unsigned char *
 s390_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
 {
   static unsigned char breakpoint[] = { 0x0, 0x1 };
@@ -1632,7 +1715,7 @@ s390_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
 
 /* Advance PC across any function entry prologue instructions to reach some
    "real" code.  */
-CORE_ADDR
+static CORE_ADDR
 s390_skip_prologue (CORE_ADDR pc)
 {
   struct frame_extra_info fextra_info;
@@ -1645,7 +1728,7 @@ s390_skip_prologue (CORE_ADDR pc)
    Can't go through the frames for this because on some machines
    the new frame is not set up until the new function executes
    some instructions.  */
-CORE_ADDR
+static CORE_ADDR
 s390_saved_pc_after_call (struct frame_info *frame)
 {
   return ADDR_BITS_REMOVE (read_register (S390_RETADDR_REGNUM));
@@ -1665,7 +1748,38 @@ s390_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
   return sp;
 }
 
-struct gdbarch *
+static int
+s390_address_class_type_flags (int byte_size, int dwarf2_addr_class)
+{
+  if (byte_size == 4)
+    return TYPE_FLAG_ADDRESS_CLASS_1;
+  else
+    return 0;
+}
+
+static const char *
+s390_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags)
+{
+  if (type_flags & TYPE_FLAG_ADDRESS_CLASS_1)
+    return "mode32";
+  else
+    return NULL;
+}
+
+static int
+s390_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name,
+                                      int *type_flags_ptr)
+{
+  if (strcmp (name, "mode32") == 0)
+    {
+      *type_flags_ptr = TYPE_FLAG_ADDRESS_CLASS_1;
+      return 1;
+    }
+  else
+    return 0;
+}
+
+static struct gdbarch *
 s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 {
   static LONGEST s390_call_dummy_words[] = { 0 };
@@ -1685,124 +1799,121 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   /* Yes: create a new gdbarch for the specified machine type.  */
   gdbarch = gdbarch_alloc (&info, NULL);
 
+  /* 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_believe_pcc_promotion (gdbarch, 0);
+  set_gdbarch_char_signed (gdbarch, 0);
 
   set_gdbarch_frame_args_skip (gdbarch, 0);
-  set_gdbarch_frame_args_address (gdbarch, s390_frame_args_address);
-  set_gdbarch_frame_chain (gdbarch, s390_frame_chain);
-  set_gdbarch_frame_init_saved_regs (gdbarch, s390_frame_init_saved_regs);
-  set_gdbarch_frame_locals_address (gdbarch, s390_frame_args_address);
-  /* We can't do this */
-  set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
-  set_gdbarch_store_struct_return (gdbarch, s390_store_struct_return);
-  set_gdbarch_extract_return_value (gdbarch, s390_extract_return_value);
-  set_gdbarch_store_return_value (gdbarch, s390_store_return_value);
-  /* Amount PC must be decremented by after a breakpoint.
-     This is often the number of bytes in BREAKPOINT
-     but not always.  */
+  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);
+  set_gdbarch_deprecated_extract_return_value (gdbarch, s390_extract_return_value);
+  set_gdbarch_deprecated_store_return_value (gdbarch, s390_store_return_value);
+  /* Amount PC must be decremented by after a breakpoint.  This is
+     often the number of bytes returned by BREAKPOINT_FROM_PC but not
+     always.  */
   set_gdbarch_decr_pc_after_break (gdbarch, 2);
-  set_gdbarch_pop_frame (gdbarch, s390_pop_frame);
-  set_gdbarch_ieee_float (gdbarch, 1);
+  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_max_register_raw_size (gdbarch, 8);
-  set_gdbarch_max_register_virtual_size (gdbarch, 8);
+  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);
   set_gdbarch_skip_prologue (gdbarch, s390_skip_prologue);
-  set_gdbarch_init_extra_frame_info (gdbarch, s390_init_extra_frame_info);
-  set_gdbarch_init_frame_pc_first (gdbarch, s390_init_frame_pc_first);
-  set_gdbarch_read_fp (gdbarch, s390_read_fp);
-  set_gdbarch_write_fp (gdbarch, s390_write_fp);
+  set_gdbarch_deprecated_init_extra_frame_info (gdbarch, s390_init_extra_frame_info);
+  set_gdbarch_deprecated_init_frame_pc_first (gdbarch, s390_init_frame_pc_first);
+  set_gdbarch_deprecated_target_read_fp (gdbarch, s390_read_fp);
   /* This function that tells us whether the function invocation represented
      by FI does not have a frame on the stack associated with it.  If it
      does not, FRAMELESS is set to 1, else 0.  */
   set_gdbarch_frameless_function_invocation (gdbarch,
                                             s390_frameless_function_invocation);
   /* Return saved PC from a frame */
-  set_gdbarch_frame_saved_pc (gdbarch, s390_frame_saved_pc);
-  /* FRAME_CHAIN takes a frame's nominal address
-     and produces the frame's chain-pointer. */
-  set_gdbarch_frame_chain (gdbarch, s390_frame_chain);
-  set_gdbarch_saved_pc_after_call (gdbarch, s390_saved_pc_after_call);
-  set_gdbarch_register_byte (gdbarch, s390_register_byte);
+  set_gdbarch_deprecated_frame_saved_pc (gdbarch, s390_frame_saved_pc);
+  /* DEPRECATED_FRAME_CHAIN takes a frame's nominal address and
+     produces the frame's chain-pointer. */
+  set_gdbarch_deprecated_frame_chain (gdbarch, s390_frame_chain);
+  set_gdbarch_deprecated_saved_pc_after_call (gdbarch, s390_saved_pc_after_call);
+  set_gdbarch_deprecated_register_byte (gdbarch, s390_register_byte);
   set_gdbarch_pc_regnum (gdbarch, S390_PC_REGNUM);
   set_gdbarch_sp_regnum (gdbarch, S390_SP_REGNUM);
-  set_gdbarch_fp_regnum (gdbarch, S390_FP_REGNUM);
+  set_gdbarch_deprecated_fp_regnum (gdbarch, S390_FP_REGNUM);
   set_gdbarch_fp0_regnum (gdbarch, S390_FP0_REGNUM);
   set_gdbarch_num_regs (gdbarch, S390_NUM_REGS);
   set_gdbarch_cannot_fetch_register (gdbarch, s390_cannot_fetch_register);
   set_gdbarch_cannot_store_register (gdbarch, s390_cannot_fetch_register);
-  set_gdbarch_get_saved_register (gdbarch, generic_get_saved_register);
-  set_gdbarch_use_struct_convention (gdbarch, generic_use_struct_convention);
-  set_gdbarch_frame_chain_valid (gdbarch, func_frame_chain_valid);
+  set_gdbarch_use_struct_convention (gdbarch, s390_use_struct_convention);
   set_gdbarch_register_name (gdbarch, s390_register_name);
   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);
 
   /* Parameters for inferior function calls.  */
-  set_gdbarch_call_dummy_p (gdbarch, 1);
-  set_gdbarch_use_generic_dummy_frames (gdbarch, 1);
-  set_gdbarch_call_dummy_length (gdbarch, 0);
-  set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT);
-  set_gdbarch_call_dummy_address (gdbarch, entry_point_address);
-  set_gdbarch_call_dummy_start_offset (gdbarch, 0);
-  set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_at_entry_point);
-  set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame);
-  set_gdbarch_push_arguments (gdbarch, s390_push_arguments);
-  set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1);
-  set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
-  set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
-  set_gdbarch_extract_struct_value_address (gdbarch, 0);
-  set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
-  set_gdbarch_push_return_address (gdbarch, s390_push_return_address);
-  set_gdbarch_sizeof_call_dummy_words (gdbarch,
-                                       sizeof (s390_call_dummy_words));
-  set_gdbarch_call_dummy_words (gdbarch, s390_call_dummy_words);
-  set_gdbarch_coerce_float_to_double (gdbarch,
-                                      standard_coerce_float_to_double);
+  set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point);
+  set_gdbarch_frame_align (gdbarch, s390_frame_align);
+  set_gdbarch_deprecated_push_arguments (gdbarch, s390_push_arguments);
+  set_gdbarch_deprecated_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);
+  set_gdbarch_deprecated_push_return_address (gdbarch,
+                                              s390_push_return_address);
+  set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (s390_call_dummy_words));
+  set_gdbarch_deprecated_call_dummy_words (gdbarch, s390_call_dummy_words);
 
   switch (info.bfd_arch_info->mach)
     {
-    case bfd_mach_s390_esa:
-      set_gdbarch_register_size (gdbarch, 4);
-      set_gdbarch_register_raw_size (gdbarch, s390_register_raw_size);
-      set_gdbarch_register_virtual_size (gdbarch, s390_register_raw_size);
-      set_gdbarch_register_virtual_type (gdbarch, s390_register_virtual_type);
+    case bfd_mach_s390_31:
+      set_gdbarch_deprecated_register_size (gdbarch, 4);
+      set_gdbarch_deprecated_register_raw_size (gdbarch, s390_register_raw_size);
+      set_gdbarch_deprecated_register_virtual_size (gdbarch, s390_register_raw_size);
+      set_gdbarch_deprecated_register_virtual_type (gdbarch, s390_register_virtual_type);
 
       set_gdbarch_addr_bits_remove (gdbarch, s390_addr_bits_remove);
-      set_gdbarch_register_bytes (gdbarch, S390_REGISTER_BYTES);
+      set_gdbarch_deprecated_register_bytes (gdbarch, S390_REGISTER_BYTES);
       break;
-    case bfd_mach_s390_esame:
-      set_gdbarch_register_size (gdbarch, 8);
-      set_gdbarch_register_raw_size (gdbarch, s390x_register_raw_size);
-      set_gdbarch_register_virtual_size (gdbarch, s390x_register_raw_size);
-      set_gdbarch_register_virtual_type (gdbarch,
-                                        s390x_register_virtual_type);
+    case bfd_mach_s390_64:
+      set_gdbarch_deprecated_register_size (gdbarch, 8);
+      set_gdbarch_deprecated_register_raw_size (gdbarch, s390x_register_raw_size);
+      set_gdbarch_deprecated_register_virtual_size (gdbarch, s390x_register_raw_size);
+      set_gdbarch_deprecated_register_virtual_type (gdbarch, s390x_register_virtual_type);
 
       set_gdbarch_long_bit (gdbarch, 64);
       set_gdbarch_long_long_bit (gdbarch, 64);
       set_gdbarch_ptr_bit (gdbarch, 64);
-      set_gdbarch_register_bytes (gdbarch, S390X_REGISTER_BYTES);
+      set_gdbarch_deprecated_register_bytes (gdbarch, S390X_REGISTER_BYTES);
+      set_gdbarch_address_class_type_flags (gdbarch,
+                                            s390_address_class_type_flags);
+      set_gdbarch_address_class_type_flags_to_name (gdbarch,
+                                                    s390_address_class_type_flags_to_name);
+      set_gdbarch_address_class_name_to_type_flags (gdbarch,
+                                                    s390_address_class_name_to_type_flags);
       break;
     }
 
+  /* Should be using push_dummy_call.  */
+  set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp);
+
   return gdbarch;
 }
 
 
 
+extern initialize_file_ftype _initialize_s390_tdep; /* -Wmissing-prototypes */
+
 void
-_initialize_s390_tdep ()
+_initialize_s390_tdep (void)
 {
 
   /* Hook us into the gdbarch mechanism.  */
   register_gdbarch_init (bfd_arch_s390, s390_gdbarch_init);
-  if (!tm_print_insn)          /* Someone may have already set it */
-    tm_print_insn = gdb_print_insn_s390;
+  if (!deprecated_tm_print_insn)       /* Someone may have already set it */
+    deprecated_tm_print_insn = gdb_print_insn_s390;
 }
 
 #endif /* GDBSERVER */
This page took 0.041426 seconds and 4 git commands to generate.