* strerror.c: Revert last change. Declare static sys_nerr
[deliverable/binutils-gdb.git] / gdb / mips-tdep.c
index fc1c2488537d133008dc1d272ae4378d5a858b4b..5a4ea2451a37b2d5ada5f7eee755b46655db3c65 100644 (file)
@@ -48,6 +48,7 @@
 #include "elf-bfd.h"
 #include "symcat.h"
 #include "sim-regno.h"
+#include "dis-asm.h"
 
 static void set_reg_offset (CORE_ADDR *saved_regs, int regnum, CORE_ADDR off);
 static struct type *mips_register_type (struct gdbarch *gdbarch, int regnum);
@@ -374,8 +375,6 @@ mips_stack_argsize (void)
 
 #define VM_MIN_ADDRESS (CORE_ADDR)0x400000
 
-int gdb_print_insn_mips (bfd_vma, disassemble_info *);
-
 static mips_extra_func_info_t heuristic_proc_desc (CORE_ADDR, CORE_ADDR,
                                                   struct frame_info *, int);
 
@@ -655,9 +654,9 @@ mips_register_raw_size (int regnum)
         NOTE: cagney/2003-06-15: This is so bogus.  The register's
         raw size is changing according to the ABI
         (FP_REGISTER_DOUBLE).  Also, GDB's protocol is defined by a
-        combination of REGISTER_RAW_SIZE and REGISTER_BYTE.  */
+        combination of REGISTER_RAW_SIZE and DEPRECATED_REGISTER_BYTE.  */
       if (mips64_transfers_32bit_regs_p)
-       return REGISTER_VIRTUAL_SIZE (regnum);
+       return DEPRECATED_REGISTER_VIRTUAL_SIZE (regnum);
       else if (regnum >= FP0_REGNUM && regnum < FP0_REGNUM + 32
               && FP_REGISTER_DOUBLE)
        /* For MIPS_ABI_N32 (for example) we need 8 byte floating point
@@ -718,7 +717,7 @@ mips_register_convertible (int reg_nr)
   if (mips64_transfers_32bit_regs_p)
     return 0;
   else
-    return (REGISTER_RAW_SIZE (reg_nr) > REGISTER_VIRTUAL_SIZE (reg_nr));
+    return (REGISTER_RAW_SIZE (reg_nr) > DEPRECATED_REGISTER_VIRTUAL_SIZE (reg_nr));
 }
 
 static void
@@ -764,8 +763,8 @@ static void
 mips_register_to_value (struct frame_info *frame, int regnum,
                        struct type *type, void *to)
 {
-  frame_read_register (frame, regnum + 0, (char *) to + 4);
-  frame_read_register (frame, regnum + 1, (char *) to + 0);
+  get_frame_register (frame, regnum + 0, (char *) to + 4);
+  get_frame_register (frame, regnum + 1, (char *) to + 0);
 }
 
 static void
@@ -1571,7 +1570,7 @@ mips_find_saved_regs (struct frame_info *fci)
   t_inst inst;
   CORE_ADDR *saved_regs;
 
-  if (get_frame_saved_regs (fci) != NULL)
+  if (deprecated_get_frame_saved_regs (fci) != NULL)
     return;
   saved_regs = frame_saved_regs_zalloc (fci);
 
@@ -2590,7 +2589,7 @@ find_proc_desc (CORE_ADDR pc, struct frame_info *next_frame, int cur_frame)
          to have their own proc_descs, and even if they don't,
          heuristic_proc_desc knows how to create them! */
 
-      register struct linked_proc_info *link;
+      struct linked_proc_info *link;
 
       for (link = linked_proc_desc_table; link; link = link->next)
        if (PROC_LOW_ADDR (&link->info) <= pc
@@ -2624,7 +2623,7 @@ mips_frame_chain (struct frame_info *frame)
   CORE_ADDR tmp;
   CORE_ADDR saved_pc = DEPRECATED_FRAME_SAVED_PC (frame);
 
-  if (saved_pc == 0 || inside_entry_file (saved_pc))
+  if (saved_pc == 0 || deprecated_inside_entry_file (saved_pc))
     return 0;
 
   /* Check if the PC is inside a call stub.  If it is, fetch the
@@ -2734,7 +2733,7 @@ mips_init_extra_frame_info (int fromleaf, struct frame_info *fci)
                              get_frame_base (fci));
              set_reg_offset (temp_saved_regs, PC_REGNUM,
                              temp_saved_regs[RA_REGNUM]);
-             memcpy (get_frame_saved_regs (fci), temp_saved_regs,
+             memcpy (deprecated_get_frame_saved_regs (fci), temp_saved_regs,
                      SIZEOF_FRAME_SAVED_REGS);
            }
        }
@@ -2823,18 +2822,12 @@ mips_type_needs_double_align (struct type *type)
   return 0;
 }
 
-/* Macros to round N up or down to the next A boundary; 
-   A must be a power of two.  */
-
-#define ROUND_DOWN(n,a) ((n) & ~((a)-1))
-#define ROUND_UP(n,a) (((n)+(a)-1) & ~((a)-1))
-
 /* Adjust the address downward (direction of stack growth) so that it
    is correctly aligned for a new stack frame.  */
 static CORE_ADDR
 mips_frame_align (struct gdbarch *gdbarch, CORE_ADDR addr)
 {
-  return ROUND_DOWN (addr, 16);
+  return align_down (addr, 16);
 }
 
 static CORE_ADDR
@@ -2863,21 +2856,21 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
      aligned.  For n32 and n64, stack frames need to be 128-bit
      aligned, so we round to this widest known alignment.  */
 
-  sp = ROUND_DOWN (sp, 16);
-  struct_addr = ROUND_DOWN (struct_addr, 16);
+  sp = align_down (sp, 16);
+  struct_addr = align_down (struct_addr, 16);
 
   /* Now make space on the stack for the args.  We allocate more
      than necessary for EABI, because the first few arguments are
      passed in registers, but that's OK.  */
   for (argnum = 0; argnum < nargs; argnum++)
-    len += ROUND_UP (TYPE_LENGTH (VALUE_TYPE (args[argnum])), 
+    len += align_up (TYPE_LENGTH (VALUE_TYPE (args[argnum])), 
                     MIPS_STACK_ARGSIZE);
-  sp -= ROUND_UP (len, 16);
+  sp -= align_up (len, 16);
 
   if (mips_debug)
     fprintf_unfiltered (gdb_stdlog, 
-                       "mips_eabi_push_dummy_call: sp=0x%s allocated %d\n",
-                       paddr_nz (sp), ROUND_UP (len, 16));
+                       "mips_eabi_push_dummy_call: sp=0x%s allocated %ld\n",
+                       paddr_nz (sp), (long) align_up (len, 16));
 
   /* Initialize the integer and float register pointers.  */
   argreg = A0_REGNUM;
@@ -3084,7 +3077,7 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
                 only needs to be adjusted when it has been used.  */
 
              if (stack_used_p)
-               stack_offset += ROUND_UP (partial_len, MIPS_STACK_ARGSIZE);
+               stack_offset += align_up (partial_len, MIPS_STACK_ARGSIZE);
            }
        }
       if (mips_debug)
@@ -3125,19 +3118,19 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
      aligned.  For n32 and n64, stack frames need to be 128-bit
      aligned, so we round to this widest known alignment.  */
 
-  sp = ROUND_DOWN (sp, 16);
-  struct_addr = ROUND_DOWN (struct_addr, 16);
+  sp = align_down (sp, 16);
+  struct_addr = align_down (struct_addr, 16);
 
   /* Now make space on the stack for the args.  */
   for (argnum = 0; argnum < nargs; argnum++)
-    len += ROUND_UP (TYPE_LENGTH (VALUE_TYPE (args[argnum])), 
+    len += align_up (TYPE_LENGTH (VALUE_TYPE (args[argnum])), 
                     MIPS_STACK_ARGSIZE);
-  sp -= ROUND_UP (len, 16);
+  sp -= align_up (len, 16);
 
   if (mips_debug)
     fprintf_unfiltered (gdb_stdlog, 
-                       "mips_n32n64_push_dummy_call: sp=0x%s allocated %d\n",
-                       paddr_nz (sp), ROUND_UP (len, 16));
+                       "mips_n32n64_push_dummy_call: sp=0x%s allocated %ld\n",
+                       paddr_nz (sp), (long) align_up (len, 16));
 
   /* Initialize the integer and float register pointers.  */
   argreg = A0_REGNUM;
@@ -3315,7 +3308,7 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
                 adjusted when it has been used.  */
 
              if (stack_used_p)
-               stack_offset += ROUND_UP (partial_len, MIPS_STACK_ARGSIZE);
+               stack_offset += align_up (partial_len, MIPS_STACK_ARGSIZE);
            }
        }
       if (mips_debug)
@@ -3356,19 +3349,19 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
      aligned.  For n32 and n64, stack frames need to be 128-bit
      aligned, so we round to this widest known alignment.  */
 
-  sp = ROUND_DOWN (sp, 16);
-  struct_addr = ROUND_DOWN (struct_addr, 16);
+  sp = align_down (sp, 16);
+  struct_addr = align_down (struct_addr, 16);
 
   /* Now make space on the stack for the args.  */
   for (argnum = 0; argnum < nargs; argnum++)
-    len += ROUND_UP (TYPE_LENGTH (VALUE_TYPE (args[argnum])), 
+    len += align_up (TYPE_LENGTH (VALUE_TYPE (args[argnum])), 
                     MIPS_STACK_ARGSIZE);
-  sp -= ROUND_UP (len, 16);
+  sp -= align_up (len, 16);
 
   if (mips_debug)
     fprintf_unfiltered (gdb_stdlog, 
-                       "mips_o32_push_dummy_call: sp=0x%s allocated %d\n",
-                       paddr_nz (sp), ROUND_UP (len, 16));
+                       "mips_o32_push_dummy_call: sp=0x%s allocated %ld\n",
+                       paddr_nz (sp), (long) align_up (len, 16));
 
   /* Initialize the integer and float register pointers.  */
   argreg = A0_REGNUM;
@@ -3479,7 +3472,7 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
              argreg += FP_REGISTER_DOUBLE ? 1 : 2;
            }
          /* Reserve space for the FP register.  */
-         stack_offset += ROUND_UP (len, MIPS_STACK_ARGSIZE);
+         stack_offset += align_up (len, MIPS_STACK_ARGSIZE);
        }
       else
        {
@@ -3623,7 +3616,7 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
                 refered to as their "home".  Consequently, space is
                 always allocated.  */
 
-             stack_offset += ROUND_UP (partial_len, MIPS_STACK_ARGSIZE);
+             stack_offset += align_up (partial_len, MIPS_STACK_ARGSIZE);
            }
        }
       if (mips_debug)
@@ -3664,19 +3657,19 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
      aligned.  For n32 and n64, stack frames need to be 128-bit
      aligned, so we round to this widest known alignment.  */
 
-  sp = ROUND_DOWN (sp, 16);
-  struct_addr = ROUND_DOWN (struct_addr, 16);
+  sp = align_down (sp, 16);
+  struct_addr = align_down (struct_addr, 16);
 
   /* Now make space on the stack for the args.  */
   for (argnum = 0; argnum < nargs; argnum++)
-    len += ROUND_UP (TYPE_LENGTH (VALUE_TYPE (args[argnum])), 
+    len += align_up (TYPE_LENGTH (VALUE_TYPE (args[argnum])), 
                     MIPS_STACK_ARGSIZE);
-  sp -= ROUND_UP (len, 16);
+  sp -= align_up (len, 16);
 
   if (mips_debug)
     fprintf_unfiltered (gdb_stdlog, 
-                       "mips_o64_push_dummy_call: sp=0x%s allocated %d\n",
-                       paddr_nz (sp), ROUND_UP (len, 16));
+                       "mips_o64_push_dummy_call: sp=0x%s allocated %ld\n",
+                       paddr_nz (sp), (long) align_up (len, 16));
 
   /* Initialize the integer and float register pointers.  */
   argreg = A0_REGNUM;
@@ -3787,7 +3780,7 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
              argreg += FP_REGISTER_DOUBLE ? 1 : 2;
            }
          /* Reserve space for the FP register.  */
-         stack_offset += ROUND_UP (len, MIPS_STACK_ARGSIZE);
+         stack_offset += align_up (len, MIPS_STACK_ARGSIZE);
        }
       else
        {
@@ -3931,7 +3924,7 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
                 refered to as their "home".  Consequently, space is
                 always allocated.  */
 
-             stack_offset += ROUND_UP (partial_len, MIPS_STACK_ARGSIZE);
+             stack_offset += align_up (partial_len, MIPS_STACK_ARGSIZE);
            }
        }
       if (mips_debug)
@@ -3947,7 +3940,7 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
 static void
 mips_pop_frame (void)
 {
-  register int regnum;
+  int regnum;
   struct frame_info *frame = get_current_frame ();
   CORE_ADDR new_sp = get_frame_base (frame);
   mips_extra_func_info_t proc_desc;
@@ -3964,18 +3957,18 @@ mips_pop_frame (void)
   mips_find_saved_regs (frame);
   for (regnum = 0; regnum < NUM_REGS; regnum++)
     if (regnum != SP_REGNUM && regnum != PC_REGNUM
-       && get_frame_saved_regs (frame)[regnum])
+       && deprecated_get_frame_saved_regs (frame)[regnum])
       {
        /* Floating point registers must not be sign extended, 
           in case MIPS_SAVED_REGSIZE = 4 but sizeof (FP0_REGNUM) == 8.  */
 
        if (FP0_REGNUM <= regnum && regnum < FP0_REGNUM + 32)
          write_register (regnum,
-                         read_memory_unsigned_integer (get_frame_saved_regs (frame)[regnum],
+                         read_memory_unsigned_integer (deprecated_get_frame_saved_regs (frame)[regnum],
                                                        MIPS_SAVED_REGSIZE));
        else
          write_register (regnum,
-                         read_memory_integer (get_frame_saved_regs (frame)[regnum],
+                         read_memory_integer (deprecated_get_frame_saved_regs (frame)[regnum],
                                               MIPS_SAVED_REGSIZE));
       }
 
@@ -4236,7 +4229,7 @@ mips_print_register (struct ui_file *file, struct frame_info *frame,
     fprintf_filtered (file, ": ");
 
   if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
-    offset = REGISTER_RAW_SIZE (regnum) - REGISTER_VIRTUAL_SIZE (regnum);
+    offset = REGISTER_RAW_SIZE (regnum) - DEPRECATED_REGISTER_VIRTUAL_SIZE (regnum);
   else
     offset = 0;
 
@@ -4286,10 +4279,10 @@ print_gp_register_row (struct ui_file *file, struct frame_info *frame,
       col++;
     }
   /* print the R0 to R31 names */
-  fprintf_filtered (file,
-                   (start_regnum % NUM_REGS) < MIPS_NUMREGS
-                   ? "\n R%-4d" : "\n      ",
-                   start_regnum);
+  if ((start_regnum % NUM_REGS) < MIPS_NUMREGS)
+    fprintf_filtered (file, "\n R%-4d", start_regnum % NUM_REGS);
+  else
+    fprintf_filtered (file, "\n      ");
 
   /* now print the values in hex, 4 or 8 to the row */
   for (col = 0, regnum = start_regnum;
@@ -4304,16 +4297,16 @@ print_gp_register_row (struct ui_file *file, struct frame_info *frame,
       if (!frame_register_read (frame, regnum, raw_buffer))
        error ("can't read register %d (%s)", regnum, REGISTER_NAME (regnum));
       /* pad small registers */
-      for (byte = 0; byte < (MIPS_REGSIZE - REGISTER_VIRTUAL_SIZE (regnum)); byte++)
+      for (byte = 0; byte < (MIPS_REGSIZE - DEPRECATED_REGISTER_VIRTUAL_SIZE (regnum)); byte++)
        printf_filtered ("  ");
       /* Now print the register value in hex, endian order. */
       if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
-       for (byte = REGISTER_RAW_SIZE (regnum) - REGISTER_VIRTUAL_SIZE (regnum);
+       for (byte = REGISTER_RAW_SIZE (regnum) - DEPRECATED_REGISTER_VIRTUAL_SIZE (regnum);
             byte < REGISTER_RAW_SIZE (regnum);
             byte++)
          fprintf_filtered (file, "%02x", (unsigned char) raw_buffer[byte]);
       else
-       for (byte = REGISTER_VIRTUAL_SIZE (regnum) - 1;
+       for (byte = DEPRECATED_REGISTER_VIRTUAL_SIZE (regnum) - 1;
             byte >= 0;
             byte--)
          fprintf_filtered (file, "%02x", (unsigned char) raw_buffer[byte]);
@@ -4743,12 +4736,12 @@ mips_eabi_extract_return_value (struct type *valtype,
   return_value_location (valtype, &hi, &lo);
 
   memcpy (valbuf + lo.buf_offset,
-         regbuf + REGISTER_BYTE (lo.reg) + lo.reg_offset,
+         regbuf + DEPRECATED_REGISTER_BYTE (lo.reg) + lo.reg_offset,
          lo.len);
 
   if (hi.len > 0)
     memcpy (valbuf + hi.buf_offset,
-           regbuf + REGISTER_BYTE (hi.reg) + hi.reg_offset,
+           regbuf + DEPRECATED_REGISTER_BYTE (hi.reg) + hi.reg_offset,
            hi.len);
 }
 
@@ -4762,12 +4755,12 @@ mips_o64_extract_return_value (struct type *valtype,
   return_value_location (valtype, &hi, &lo);
 
   memcpy (valbuf + lo.buf_offset,
-         regbuf + REGISTER_BYTE (lo.reg) + lo.reg_offset,
+         regbuf + DEPRECATED_REGISTER_BYTE (lo.reg) + lo.reg_offset,
          lo.len);
 
   if (hi.len > 0)
     memcpy (valbuf + hi.buf_offset,
-           regbuf + REGISTER_BYTE (hi.reg) + hi.reg_offset,
+           regbuf + DEPRECATED_REGISTER_BYTE (hi.reg) + hi.reg_offset,
            hi.len);
 }
 
@@ -4784,14 +4777,14 @@ mips_eabi_store_return_value (struct type *valtype, char *valbuf)
 
   memset (raw_buffer, 0, sizeof (raw_buffer));
   memcpy (raw_buffer + lo.reg_offset, valbuf + lo.buf_offset, lo.len);
-  deprecated_write_register_bytes (REGISTER_BYTE (lo.reg), raw_buffer,
+  deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (lo.reg), raw_buffer,
                                   REGISTER_RAW_SIZE (lo.reg));
 
   if (hi.len > 0)
     {
       memset (raw_buffer, 0, sizeof (raw_buffer));
       memcpy (raw_buffer + hi.reg_offset, valbuf + hi.buf_offset, hi.len);
-      deprecated_write_register_bytes (REGISTER_BYTE (hi.reg), raw_buffer,
+      deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (hi.reg), raw_buffer,
                                       REGISTER_RAW_SIZE (hi.reg));
     }
 }
@@ -4806,14 +4799,14 @@ mips_o64_store_return_value (struct type *valtype, char *valbuf)
 
   memset (raw_buffer, 0, sizeof (raw_buffer));
   memcpy (raw_buffer + lo.reg_offset, valbuf + lo.buf_offset, lo.len);
-  deprecated_write_register_bytes (REGISTER_BYTE (lo.reg), raw_buffer,
+  deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (lo.reg), raw_buffer,
                                   REGISTER_RAW_SIZE (lo.reg));
 
   if (hi.len > 0)
     {
       memset (raw_buffer, 0, sizeof (raw_buffer));
       memcpy (raw_buffer + hi.reg_offset, valbuf + hi.buf_offset, hi.len);
-      deprecated_write_register_bytes (REGISTER_BYTE (hi.reg), raw_buffer,
+      deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (hi.reg), raw_buffer,
                                       REGISTER_RAW_SIZE (hi.reg));
     }
 }
@@ -5255,9 +5248,10 @@ reinit_frame_cache_sfunc (char *args, int from_tty,
   reinit_frame_cache ();
 }
 
-int
-gdb_print_insn_mips (bfd_vma memaddr, disassemble_info *info)
+static int
+gdb_print_insn_mips (bfd_vma memaddr, struct disassemble_info *info)
 {
+  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
   mips_extra_func_info_t proc_desc;
 
   /* Search for the function containing this address.  Set the low bit
@@ -5290,6 +5284,26 @@ gdb_print_insn_mips (bfd_vma memaddr, disassemble_info *info)
   /* Round down the instruction address to the appropriate boundary.  */
   memaddr &= (info->mach == bfd_mach_mips16 ? ~1 : ~3);
 
+  /* Set the disassembler options.  */
+  if (tdep->mips_abi == MIPS_ABI_N32
+      || tdep->mips_abi == MIPS_ABI_N64)
+    {
+      /* Set up the disassembler info, so that we get the right
+        register names from libopcodes.  */
+      if (tdep->mips_abi == MIPS_ABI_N32)
+       info->disassembler_options = "gpr-names=n32";
+      else
+       info->disassembler_options = "gpr-names=64";
+      info->flavour = bfd_target_elf_flavour;
+    }
+  else
+    /* This string is not recognized explicitly by the disassembler,
+       but it tells the disassembler to not try to guess the ABI from
+       the bfd elf headers, such that, if the user overrides the ABI
+       of a program linked as NewABI, the disassembly will follow the
+       register naming conventions specified by the user.  */
+    info->disassembler_options = "gpr-names=32";
+
   /* Call the appropriate disassembler based on the target endian-ness.  */
   if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
     return print_insn_big_mips (memaddr, info);
@@ -5540,25 +5554,6 @@ mips_ignore_helper (CORE_ADDR pc)
 }
 
 
-/* Return a location where we can set a breakpoint that will be hit
-   when an inferior function call returns.  This is normally the
-   program's entry point.  Executables that don't have an entry
-   point (e.g. programs in ROM) should define a symbol __CALL_DUMMY_ADDRESS
-   whose address is the location where the breakpoint should be placed.  */
-
-static CORE_ADDR
-mips_call_dummy_address (void)
-{
-  struct minimal_symbol *sym;
-
-  sym = lookup_minimal_symbol ("__CALL_DUMMY_ADDRESS", NULL, NULL);
-  if (sym)
-    return SYMBOL_VALUE_ADDRESS (sym);
-  else
-    return entry_point_address ();
-}
-
-
 /* When debugging a 64 MIPS target running a 32 bit ABI, the size of
    the register stored on the stack (32) is different to its real raw
    size (64).  The below ensures that registers are fetched from the
@@ -5745,12 +5740,6 @@ mips_gdbarch_init (struct gdbarch_info info,
   enum mips_abi mips_abi, found_abi, wanted_abi;
   int num_regs;
 
-  /* Reset the disassembly info, in case it was set to something
-     non-default.  */
-  deprecated_tm_print_insn_info.flavour = bfd_target_unknown_flavour;
-  deprecated_tm_print_insn_info.arch = bfd_arch_unknown;
-  deprecated_tm_print_insn_info.mach = 0;
-
   elf_flags = 0;
 
   if (info.abfd)
@@ -5830,34 +5819,6 @@ mips_gdbarch_init (struct gdbarch_info info,
   if (wanted_abi != MIPS_ABI_UNKNOWN)
     mips_abi = wanted_abi;
 
-  /* We have to set deprecated_tm_print_insn_info before looking for a
-     pre-existing architecture, otherwise we may return before we get
-     a chance to set it up.  */
-  if (mips_abi == MIPS_ABI_N32 || mips_abi == MIPS_ABI_N64)
-    {
-      /* Set up the disassembler info, so that we get the right
-        register names from libopcodes.  */
-      if (mips_abi == MIPS_ABI_N32)
-       deprecated_tm_print_insn_info.disassembler_options = "gpr-names=n32";
-      else
-       deprecated_tm_print_insn_info.disassembler_options = "gpr-names=64";
-      deprecated_tm_print_insn_info.flavour = bfd_target_elf_flavour;
-      deprecated_tm_print_insn_info.arch = bfd_arch_mips;
-      if (info.bfd_arch_info != NULL
-         && info.bfd_arch_info->arch == bfd_arch_mips
-         && info.bfd_arch_info->mach)
-       deprecated_tm_print_insn_info.mach = info.bfd_arch_info->mach;
-      else
-       deprecated_tm_print_insn_info.mach = bfd_mach_mips8000;
-    }
-  else
-    /* This string is not recognized explicitly by the disassembler,
-       but it tells the disassembler to not try to guess the ABI from
-       the bfd elf headers, such that, if the user overrides the ABI
-       of a program linked as NewABI, the disassembly will follow the
-       register naming conventions specified by the user.  */
-    deprecated_tm_print_insn_info.disassembler_options = "gpr-names=32";
-
   if (gdbarch_debug)
     {
       fprintf_unfiltered (gdb_stdlog,
@@ -5931,8 +5892,8 @@ mips_gdbarch_init (struct gdbarch_info info,
       set_gdbarch_long_bit (gdbarch, 32);
       set_gdbarch_ptr_bit (gdbarch, 32);
       set_gdbarch_long_long_bit (gdbarch, 64);
-      set_gdbarch_reg_struct_has_addr (gdbarch, 
-                                      mips_o32_reg_struct_has_addr);
+      set_gdbarch_deprecated_reg_struct_has_addr
+       (gdbarch, mips_o32_reg_struct_has_addr);
       set_gdbarch_use_struct_convention (gdbarch, 
                                         always_use_struct_convention);
       break;
@@ -5950,8 +5911,8 @@ mips_gdbarch_init (struct gdbarch_info info,
       set_gdbarch_long_bit (gdbarch, 32);
       set_gdbarch_ptr_bit (gdbarch, 32);
       set_gdbarch_long_long_bit (gdbarch, 64);
-      set_gdbarch_reg_struct_has_addr (gdbarch, 
-                                      mips_o32_reg_struct_has_addr);
+      set_gdbarch_deprecated_reg_struct_has_addr
+       (gdbarch, mips_o32_reg_struct_has_addr);
       set_gdbarch_use_struct_convention (gdbarch, always_use_struct_convention);
       break;
     case MIPS_ABI_EABI32:
@@ -5968,8 +5929,8 @@ mips_gdbarch_init (struct gdbarch_info info,
       set_gdbarch_long_bit (gdbarch, 32);
       set_gdbarch_ptr_bit (gdbarch, 32);
       set_gdbarch_long_long_bit (gdbarch, 64);
-      set_gdbarch_reg_struct_has_addr (gdbarch, 
-                                      mips_eabi_reg_struct_has_addr);
+      set_gdbarch_deprecated_reg_struct_has_addr
+       (gdbarch, mips_eabi_reg_struct_has_addr);
       set_gdbarch_use_struct_convention (gdbarch, 
                                         mips_eabi_use_struct_convention);
       break;
@@ -5987,8 +5948,8 @@ mips_gdbarch_init (struct gdbarch_info info,
       set_gdbarch_long_bit (gdbarch, 64);
       set_gdbarch_ptr_bit (gdbarch, 64);
       set_gdbarch_long_long_bit (gdbarch, 64);
-      set_gdbarch_reg_struct_has_addr (gdbarch, 
-                                      mips_eabi_reg_struct_has_addr);
+      set_gdbarch_deprecated_reg_struct_has_addr
+       (gdbarch, mips_eabi_reg_struct_has_addr);
       set_gdbarch_use_struct_convention (gdbarch, 
                                         mips_eabi_use_struct_convention);
       break;
@@ -6008,8 +5969,8 @@ mips_gdbarch_init (struct gdbarch_info info,
       set_gdbarch_long_long_bit (gdbarch, 64);
       set_gdbarch_use_struct_convention (gdbarch, 
                                         mips_n32n64_use_struct_convention);
-      set_gdbarch_reg_struct_has_addr (gdbarch, 
-                                      mips_n32n64_reg_struct_has_addr);
+      set_gdbarch_deprecated_reg_struct_has_addr
+       (gdbarch, mips_n32n64_reg_struct_has_addr);
       break;
     case MIPS_ABI_N64:
       set_gdbarch_push_dummy_call (gdbarch, mips_n32n64_push_dummy_call);
@@ -6027,8 +5988,8 @@ mips_gdbarch_init (struct gdbarch_info info,
       set_gdbarch_long_long_bit (gdbarch, 64);
       set_gdbarch_use_struct_convention (gdbarch, 
                                         mips_n32n64_use_struct_convention);
-      set_gdbarch_reg_struct_has_addr (gdbarch, 
-                                      mips_n32n64_reg_struct_has_addr);
+      set_gdbarch_deprecated_reg_struct_has_addr
+       (gdbarch, mips_n32n64_reg_struct_has_addr);
       break;
     default:
       internal_error (__FILE__, __LINE__,
@@ -6080,11 +6041,8 @@ mips_gdbarch_init (struct gdbarch_info info,
 
   /* MIPS version of register names.  NOTE: At present the MIPS
      register name management is part way between the old -
-     #undef/#define REGISTER_NAMES and the new REGISTER_NAME(nr).
+     #undef/#define MIPS_REGISTER_NAMES and the new REGISTER_NAME(nr).
      Further work on it is required.  */
-  /* NOTE: many targets (esp. embedded) do not go thru the
-     gdbarch_register_name vector at all, instead bypassing it
-     by defining REGISTER_NAMES.  */
   set_gdbarch_register_name (gdbarch, mips_register_name);
   set_gdbarch_read_pc (gdbarch, mips_read_pc);
   set_gdbarch_write_pc (gdbarch, generic_target_write_pc);
@@ -6098,7 +6056,6 @@ mips_gdbarch_init (struct gdbarch_info info,
   /* There's a mess in stack frame creation.  See comments in
      blockframe.c near reference to DEPRECATED_INIT_FRAME_PC_FIRST.  */
   set_gdbarch_deprecated_init_frame_pc_first (gdbarch, mips_init_frame_pc_first);
-  set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_noop);
 
   /* Map debug register numbers onto internal register numbers.  */
   set_gdbarch_stab_reg_to_regnum (gdbarch, mips_stab_reg_to_regnum);
@@ -6113,7 +6070,10 @@ mips_gdbarch_init (struct gdbarch_info info,
 
   /* MIPS version of CALL_DUMMY */
 
-  set_gdbarch_call_dummy_address (gdbarch, mips_call_dummy_address);
+  /* NOTE: cagney/2003-08-05: Eventually call dummy location will be
+     replaced by a command, and all targets will default to on stack
+     (regardless of the stack's execute status).  */
+  set_gdbarch_call_dummy_location (gdbarch, AT_SYMBOL);
   set_gdbarch_deprecated_pop_frame (gdbarch, mips_pop_frame);
   set_gdbarch_frame_align (gdbarch, mips_frame_align);
   set_gdbarch_deprecated_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);
@@ -6147,6 +6107,16 @@ mips_gdbarch_init (struct gdbarch_info info,
   set_gdbarch_print_registers_info (gdbarch, mips_print_registers_info);
   set_gdbarch_pc_in_sigtramp (gdbarch, mips_pc_in_sigtramp);
 
+  set_gdbarch_print_insn (gdbarch, gdb_print_insn_mips);
+
+  /* FIXME: cagney/2003-08-29: The macros HAVE_STEPPABLE_WATCHPOINT,
+     HAVE_NONSTEPPABLE_WATCHPOINT, and HAVE_CONTINUABLE_WATCHPOINT
+     need to all be folded into the target vector.  Since they are
+     being used as guards for STOPPED_BY_WATCHPOINT, why not have
+     STOPPED_BY_WATCHPOINT return the type of watchpoint that the code
+     is sitting on?  */
+  set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1);
+
   /* Hook in OS ABI-specific overrides, if they have been registered.  */
   gdbarch_init_osabi (info, gdbarch);
 
@@ -6327,9 +6297,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
   fprintf_unfiltered (file,
                      "mips_dump_tdep: GDB_TARGET_IS_MIPS64 = %d\n",
                      GDB_TARGET_IS_MIPS64);
-  fprintf_unfiltered (file,
-                     "mips_dump_tdep: HAVE_NONSTEPPABLE_WATCHPOINT # %s\n",
-                     XSTRING (HAVE_NONSTEPPABLE_WATCHPOINT));
   fprintf_unfiltered (file,
                      "mips_dump_tdep:  HI_REGNUM = %d\n",
                      HI_REGNUM);
@@ -6425,12 +6392,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
   fprintf_unfiltered (file,
                      "mips_dump_tdep: RA_REGNUM = %d\n",
                      RA_REGNUM);
-  fprintf_unfiltered (file,
-                     "mips_dump_tdep: REGISTER_NAMES = delete?\n");
-  fprintf_unfiltered (file,
-                     "mips_dump_tdep: ROUND_DOWN = function?\n");
-  fprintf_unfiltered (file,
-                     "mips_dump_tdep: ROUND_UP = function?\n");
 #ifdef SAVED_BYTES
   fprintf_unfiltered (file,
                      "mips_dump_tdep: SAVED_BYTES = %d\n",
@@ -6561,8 +6522,6 @@ _initialize_mips_tdep (void)
     internal_error (__FILE__, __LINE__, "mips_abi_strings out of sync");
 
   gdbarch_register (bfd_arch_mips, mips_gdbarch_init, mips_dump_tdep);
-  if (!deprecated_tm_print_insn)        /* Someone may have already set it */
-    deprecated_tm_print_insn = gdb_print_insn_mips;
 
   /* Add root prefix command for all "set mips"/"show mips" commands */
   add_prefix_cmd ("mips", no_class, set_mips_command,
This page took 0.033077 seconds and 4 git commands to generate.