bfd_set_input_error
[deliverable/binutils-gdb.git] / gdb / mips-tdep.c
index aaf7872d43de0724224cbdae176f82fac3a6b33f..5fc061878734c4e89178cab37a94940701548879 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for the MIPS architecture, for GDB, the GNU Debugger.
 
-   Copyright (C) 1988-2016 Free Software Foundation, Inc.
+   Copyright (C) 1988-2017 Free Software Foundation, Inc.
 
    Contributed by Alessandro Forin(af@cs.cmu.edu) at CMU
    and by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin.
@@ -44,6 +44,7 @@
 #include "symcat.h"
 #include "sim-regno.h"
 #include "dis-asm.h"
+#include "disasm.h"
 #include "frame-unwind.h"
 #include "frame-base.h"
 #include "trad-frame.h"
@@ -270,6 +271,9 @@ mips_isa_regsize (struct gdbarch *gdbarch)
          / gdbarch_bfd_arch_info (gdbarch)->bits_per_byte);
 }
 
+/* Max saved register size.  */
+#define MAX_MIPS_ABI_REGSIZE 8
+
 /* Return the currently configured (or set) saved register size.  */
 
 unsigned int
@@ -607,7 +611,7 @@ mips_register_name (struct gdbarch *gdbarch, int regno)
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   /* GPR names for all ABIs other than n32/n64.  */
-  static char *mips_gpr_names[] = {
+  static const char *mips_gpr_names[] = {
     "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3",
     "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7",
     "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7",
@@ -615,7 +619,7 @@ mips_register_name (struct gdbarch *gdbarch, int regno)
   };
 
   /* GPR names for n32 and n64 ABIs.  */
-  static char *mips_n32_n64_gpr_names[] = {
+  static const char *mips_n32_n64_gpr_names[] = {
     "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3",
     "a4", "a5", "a6", "a7", "t0", "t1", "t2", "t3",
     "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7",
@@ -1544,7 +1548,7 @@ mips32_relative_offset (ULONGEST inst)
    number of the floating condition bits tested by the branch.  */
 
 static CORE_ADDR
-mips32_bc1_pc (struct gdbarch *gdbarch, struct frame_info *frame,
+mips32_bc1_pc (struct gdbarch *gdbarch, struct regcache *regcache,
               ULONGEST inst, CORE_ADDR pc, int count)
 {
   int fcsr = mips_regnum (gdbarch)->fp_control_status;
@@ -1558,7 +1562,7 @@ mips32_bc1_pc (struct gdbarch *gdbarch, struct frame_info *frame,
     /* No way to handle; it'll most likely trap anyway.  */
     return pc;
 
-  fcs = get_frame_register_unsigned (frame, fcsr);
+  fcs = regcache_raw_get_unsigned (regcache, fcsr);
   cond = ((fcs >> 24) & 0xfe) | ((fcs >> 23) & 0x01);
 
   if (((cond >> cnum) & mask) != mask * !tf)
@@ -1602,9 +1606,9 @@ is_octeon_bbit_op (int op, struct gdbarch *gdbarch)
    branch prediction.  */
 
 static CORE_ADDR
-mips32_next_pc (struct frame_info *frame, CORE_ADDR pc)
+mips32_next_pc (struct regcache *regcache, CORE_ADDR pc)
 {
-  struct gdbarch *gdbarch = get_frame_arch (frame);
+  struct gdbarch *gdbarch = get_regcache_arch (regcache);
   unsigned long inst;
   int op;
   inst = mips_fetch_instruction (gdbarch, ISA_MIPS, pc, NULL);
@@ -1631,15 +1635,15 @@ mips32_next_pc (struct frame_info *frame, CORE_ADDR pc)
        }
       else if (op == 17 && itype_rs (inst) == 8)
        /* BC1F, BC1FL, BC1T, BC1TL: 010001 01000 */
-       pc = mips32_bc1_pc (gdbarch, frame, inst, pc + 4, 1);
+       pc = mips32_bc1_pc (gdbarch, regcache, inst, pc + 4, 1);
       else if (op == 17 && itype_rs (inst) == 9
               && (itype_rt (inst) & 2) == 0)
        /* BC1ANY2F, BC1ANY2T: 010001 01001 xxx0x */
-       pc = mips32_bc1_pc (gdbarch, frame, inst, pc + 4, 2);
+       pc = mips32_bc1_pc (gdbarch, regcache, inst, pc + 4, 2);
       else if (op == 17 && itype_rs (inst) == 10
               && (itype_rt (inst) & 2) == 0)
        /* BC1ANY4F, BC1ANY4T: 010001 01010 xxx0x */
-       pc = mips32_bc1_pc (gdbarch, frame, inst, pc + 4, 4);
+       pc = mips32_bc1_pc (gdbarch, regcache, inst, pc + 4, 4);
       else if (op == 29)
        /* JALX: 011101 */
        /* The new PC will be alternate mode.  */
@@ -1661,8 +1665,8 @@ mips32_next_pc (struct frame_info *frame, CORE_ADDR pc)
          if (op == 54 || op == 62)
            bit += 32;
 
-         if (((get_frame_register_signed (frame,
-                                          itype_rs (inst)) >> bit) & 1)
+         if (((regcache_raw_get_signed (regcache,
+                                        itype_rs (inst)) >> bit) & 1)
               == branch_if)
            pc += mips32_relative_offset (inst) + 4;
           else
@@ -1685,15 +1689,15 @@ mips32_next_pc (struct frame_info *frame, CORE_ADDR pc)
            case 8:             /* JR */
            case 9:             /* JALR */
              /* Set PC to that address.  */
-             pc = get_frame_register_signed (frame, rtype_rs (inst));
+             pc = regcache_raw_get_signed (regcache, rtype_rs (inst));
              break;
            case 12:            /* SYSCALL */
              {
                struct gdbarch_tdep *tdep;
 
-               tdep = gdbarch_tdep (get_frame_arch (frame));
+               tdep = gdbarch_tdep (gdbarch);
                if (tdep->syscall_next_pc != NULL)
-                 pc = tdep->syscall_next_pc (frame);
+                 pc = tdep->syscall_next_pc (get_current_frame ());
                else
                  pc += 4;
              }
@@ -1713,7 +1717,7 @@ mips32_next_pc (struct frame_info *frame, CORE_ADDR pc)
              case 16:          /* BLTZAL */
              case 18:          /* BLTZALL */
              less_branch:
-               if (get_frame_register_signed (frame, itype_rs (inst)) < 0)
+               if (regcache_raw_get_signed (regcache, itype_rs (inst)) < 0)
                  pc += mips32_relative_offset (inst) + 4;
                else
                  pc += 8;      /* after the delay slot */
@@ -1722,7 +1726,7 @@ mips32_next_pc (struct frame_info *frame, CORE_ADDR pc)
              case 3:           /* BGEZL */
              case 17:          /* BGEZAL */
              case 19:          /* BGEZALL */
-               if (get_frame_register_signed (frame, itype_rs (inst)) >= 0)
+               if (regcache_raw_get_signed (regcache, itype_rs (inst)) >= 0)
                  pc += mips32_relative_offset (inst) + 4;
                else
                  pc += 8;      /* after the delay slot */
@@ -1739,8 +1743,8 @@ mips32_next_pc (struct frame_info *frame, CORE_ADDR pc)
                      /* No way to handle; it'll most likely trap anyway.  */
                      break;
 
-                   if ((get_frame_register_unsigned (frame,
-                                                     dspctl) & 0x7f) >= pos)
+                   if ((regcache_raw_get_unsigned (regcache,
+                                                   dspctl) & 0x7f) >= pos)
                      pc += mips32_relative_offset (inst);
                    else
                      pc += 4;
@@ -1763,22 +1767,22 @@ mips32_next_pc (struct frame_info *frame, CORE_ADDR pc)
          break;
        case 4:         /* BEQ, BEQL */
        equal_branch:
-         if (get_frame_register_signed (frame, itype_rs (inst)) ==
-             get_frame_register_signed (frame, itype_rt (inst)))
+         if (regcache_raw_get_signed (regcache, itype_rs (inst)) ==
+             regcache_raw_get_signed (regcache, itype_rt (inst)))
            pc += mips32_relative_offset (inst) + 4;
          else
            pc += 8;
          break;
        case 5:         /* BNE, BNEL */
        neq_branch:
-         if (get_frame_register_signed (frame, itype_rs (inst)) !=
-             get_frame_register_signed (frame, itype_rt (inst)))
+         if (regcache_raw_get_signed (regcache, itype_rs (inst)) !=
+             regcache_raw_get_signed (regcache, itype_rt (inst)))
            pc += mips32_relative_offset (inst) + 4;
          else
            pc += 8;
          break;
        case 6:         /* BLEZ, BLEZL */
-         if (get_frame_register_signed (frame, itype_rs (inst)) <= 0)
+         if (regcache_raw_get_signed (regcache, itype_rs (inst)) <= 0)
            pc += mips32_relative_offset (inst) + 4;
          else
            pc += 8;
@@ -1786,7 +1790,7 @@ mips32_next_pc (struct frame_info *frame, CORE_ADDR pc)
        case 7:
        default:
        greater_branch: /* BGTZ, BGTZL */
-         if (get_frame_register_signed (frame, itype_rs (inst)) > 0)
+         if (regcache_raw_get_signed (regcache, itype_rs (inst)) > 0)
            pc += mips32_relative_offset (inst) + 4;
          else
            pc += 8;
@@ -1840,7 +1844,7 @@ micromips_pc_insn_size (struct gdbarch *gdbarch, CORE_ADDR pc)
    examined by the branch.  */
 
 static CORE_ADDR
-micromips_bc1_pc (struct gdbarch *gdbarch, struct frame_info *frame,
+micromips_bc1_pc (struct gdbarch *gdbarch, struct regcache *regcache,
                  ULONGEST insn, CORE_ADDR pc, int count)
 {
   int fcsr = mips_regnum (gdbarch)->fp_control_status;
@@ -1854,7 +1858,7 @@ micromips_bc1_pc (struct gdbarch *gdbarch, struct frame_info *frame,
     /* No way to handle; it'll most likely trap anyway.  */
     return pc;
 
-  fcs = get_frame_register_unsigned (frame, fcsr);
+  fcs = regcache_raw_get_unsigned (regcache, fcsr);
   cond = ((fcs >> 24) & 0xfe) | ((fcs >> 23) & 0x01);
 
   if (((cond >> cnum) & mask) != mask * !tf)
@@ -1869,9 +1873,9 @@ micromips_bc1_pc (struct gdbarch *gdbarch, struct frame_info *frame,
    after the instruction at the address PC.  */
 
 static CORE_ADDR
-micromips_next_pc (struct frame_info *frame, CORE_ADDR pc)
+micromips_next_pc (struct regcache *regcache, CORE_ADDR pc)
 {
-  struct gdbarch *gdbarch = get_frame_arch (frame);
+  struct gdbarch *gdbarch = get_regcache_arch (regcache);
   ULONGEST insn;
 
   insn = mips_fetch_instruction (gdbarch, ISA_MICROMIPS, pc, NULL);
@@ -1891,7 +1895,7 @@ micromips_next_pc (struct frame_info *frame, CORE_ADDR pc)
              && (b6s10_ext (insn) & 0x2bf) == 0x3c)
                                /* JALR, JALR.HB: 000000 000x111100 111100 */
                                /* JALRS, JALRS.HB: 000000 010x111100 111100 */
-           pc = get_frame_register_signed (frame, b0s5_reg (insn >> 16));
+           pc = regcache_raw_get_signed (regcache, b0s5_reg (insn >> 16));
          break;
 
        case 0x10: /* POOL32I: bits 010000 */
@@ -1900,8 +1904,8 @@ micromips_next_pc (struct frame_info *frame, CORE_ADDR pc)
            case 0x00: /* BLTZ: bits 010000 00000 */
            case 0x01: /* BLTZAL: bits 010000 00001 */
            case 0x11: /* BLTZALS: bits 010000 10001 */
-             if (get_frame_register_signed (frame,
-                                            b0s5_reg (insn >> 16)) < 0)
+             if (regcache_raw_get_signed (regcache,
+                                          b0s5_reg (insn >> 16)) < 0)
                pc += micromips_relative_offset16 (insn);
              else
                pc += micromips_pc_insn_size (gdbarch, pc);
@@ -1910,38 +1914,38 @@ micromips_next_pc (struct frame_info *frame, CORE_ADDR pc)
            case 0x02: /* BGEZ: bits 010000 00010 */
            case 0x03: /* BGEZAL: bits 010000 00011 */
            case 0x13: /* BGEZALS: bits 010000 10011 */
-             if (get_frame_register_signed (frame,
-                                            b0s5_reg (insn >> 16)) >= 0)
+             if (regcache_raw_get_signed (regcache,
+                                          b0s5_reg (insn >> 16)) >= 0)
                pc += micromips_relative_offset16 (insn);
              else
                pc += micromips_pc_insn_size (gdbarch, pc);
              break;
 
            case 0x04: /* BLEZ: bits 010000 00100 */
-             if (get_frame_register_signed (frame,
-                                            b0s5_reg (insn >> 16)) <= 0)
+             if (regcache_raw_get_signed (regcache,
+                                          b0s5_reg (insn >> 16)) <= 0)
                pc += micromips_relative_offset16 (insn);
              else
                pc += micromips_pc_insn_size (gdbarch, pc);
              break;
 
            case 0x05: /* BNEZC: bits 010000 00101 */
-             if (get_frame_register_signed (frame,
-                                            b0s5_reg (insn >> 16)) != 0)
+             if (regcache_raw_get_signed (regcache,
+                                          b0s5_reg (insn >> 16)) != 0)
                pc += micromips_relative_offset16 (insn);
              break;
 
            case 0x06: /* BGTZ: bits 010000 00110 */
-             if (get_frame_register_signed (frame,
-                                            b0s5_reg (insn >> 16)) > 0)
+             if (regcache_raw_get_signed (regcache,
+                                          b0s5_reg (insn >> 16)) > 0)
                pc += micromips_relative_offset16 (insn);
              else
                pc += micromips_pc_insn_size (gdbarch, pc);
              break;
 
            case 0x07: /* BEQZC: bits 010000 00111 */
-             if (get_frame_register_signed (frame,
-                                            b0s5_reg (insn >> 16)) == 0)
+             if (regcache_raw_get_signed (regcache,
+                                          b0s5_reg (insn >> 16)) == 0)
                pc += micromips_relative_offset16 (insn);
              break;
 
@@ -1962,8 +1966,8 @@ micromips_next_pc (struct frame_info *frame, CORE_ADDR pc)
                  /* No way to handle; it'll most likely trap anyway.  */
                  break;
 
-               if ((get_frame_register_unsigned (frame,
-                                                 dspctl) & 0x7f) >= pos)
+               if ((regcache_raw_get_unsigned (regcache,
+                                               dspctl) & 0x7f) >= pos)
                  pc += micromips_relative_offset16 (insn);
                else
                  pc += micromips_pc_insn_size (gdbarch, pc);
@@ -1975,14 +1979,14 @@ micromips_next_pc (struct frame_info *frame, CORE_ADDR pc)
            case 0x1d: /* BC1T: bits 010000 11101 xxx00 */
                       /* BC1ANY2T: bits 010000 11101 xxx01 */
              if (((insn >> 16) & 0x2) == 0x0)
-               pc = micromips_bc1_pc (gdbarch, frame, insn, pc,
+               pc = micromips_bc1_pc (gdbarch, regcache, insn, pc,
                                       ((insn >> 16) & 0x1) + 1);
              break;
 
            case 0x1e: /* BC1ANY4F: bits 010000 11110 xxx01 */
            case 0x1f: /* BC1ANY4T: bits 010000 11111 xxx01 */
              if (((insn >> 16) & 0x3) == 0x1)
-               pc = micromips_bc1_pc (gdbarch, frame, insn, pc, 4);
+               pc = micromips_bc1_pc (gdbarch, regcache, insn, pc, 4);
              break;
            }
          break;
@@ -1994,16 +1998,16 @@ micromips_next_pc (struct frame_info *frame, CORE_ADDR pc)
          break;
 
        case 0x25: /* BEQ: bits 100101 */
-           if (get_frame_register_signed (frame, b0s5_reg (insn >> 16))
-               == get_frame_register_signed (frame, b5s5_reg (insn >> 16)))
+           if (regcache_raw_get_signed (regcache, b0s5_reg (insn >> 16))
+               == regcache_raw_get_signed (regcache, b5s5_reg (insn >> 16)))
              pc += micromips_relative_offset16 (insn);
            else
              pc += micromips_pc_insn_size (gdbarch, pc);
          break;
 
        case 0x2d: /* BNE: bits 101101 */
-           if (get_frame_register_signed (frame, b0s5_reg (insn >> 16))
-               != get_frame_register_signed (frame, b5s5_reg (insn >> 16)))
+         if (regcache_raw_get_signed (regcache, b0s5_reg (insn >> 16))
+               != regcache_raw_get_signed (regcache, b5s5_reg (insn >> 16)))
              pc += micromips_relative_offset16 (insn);
            else
              pc += micromips_pc_insn_size (gdbarch, pc);
@@ -2022,17 +2026,17 @@ micromips_next_pc (struct frame_info *frame, CORE_ADDR pc)
        case 0x11: /* POOL16C: bits 010001 */
          if ((b5s5_op (insn) & 0x1c) == 0xc)
            /* JR16, JRC, JALR16, JALRS16: 010001 011xx */
-           pc = get_frame_register_signed (frame, b0s5_reg (insn));
+           pc = regcache_raw_get_signed (regcache, b0s5_reg (insn));
          else if (b5s5_op (insn) == 0x18)
            /* JRADDIUSP: bits 010001 11000 */
-           pc = get_frame_register_signed (frame, MIPS_RA_REGNUM);
+           pc = regcache_raw_get_signed (regcache, MIPS_RA_REGNUM);
          break;
 
        case 0x23: /* BEQZ16: bits 100011 */
          {
            int rs = mips_reg3_to_reg[b7s3_reg (insn)];
 
-           if (get_frame_register_signed (frame, rs) == 0)
+           if (regcache_raw_get_signed (regcache, rs) == 0)
              pc += micromips_relative_offset7 (insn);
            else
              pc += micromips_pc_insn_size (gdbarch, pc);
@@ -2043,7 +2047,7 @@ micromips_next_pc (struct frame_info *frame, CORE_ADDR pc)
          {
            int rs = mips_reg3_to_reg[b7s3_reg (insn)];
 
-           if (get_frame_register_signed (frame, rs) != 0)
+           if (regcache_raw_get_signed (regcache, rs) != 0)
              pc += micromips_relative_offset7 (insn);
            else
              pc += micromips_pc_insn_size (gdbarch, pc);
@@ -2222,10 +2226,10 @@ add_offset_16 (CORE_ADDR pc, int offset)
 }
 
 static CORE_ADDR
-extended_mips16_next_pc (struct frame_info *frame, CORE_ADDR pc,
+extended_mips16_next_pc (regcache *regcache, CORE_ADDR pc,
                         unsigned int extension, unsigned int insn)
 {
-  struct gdbarch *gdbarch = get_frame_arch (frame);
+  struct gdbarch *gdbarch = get_regcache_arch (regcache);
   int op = (insn >> 11);
   switch (op)
     {
@@ -2253,7 +2257,7 @@ extended_mips16_next_pc (struct frame_info *frame, CORE_ADDR pc,
        struct upk_mips16 upk;
        int reg;
        unpack_mips16 (gdbarch, pc, extension, insn, ritype, &upk);
-       reg = get_frame_register_signed (frame, mips_reg3_to_reg[upk.regx]);
+       reg = regcache_raw_get_signed (regcache, mips_reg3_to_reg[upk.regx]);
        if (reg == 0)
          pc = add_offset_16 (pc, upk.offset);
        else
@@ -2265,7 +2269,7 @@ extended_mips16_next_pc (struct frame_info *frame, CORE_ADDR pc,
        struct upk_mips16 upk;
        int reg;
        unpack_mips16 (gdbarch, pc, extension, insn, ritype, &upk);
-       reg = get_frame_register_signed (frame, mips_reg3_to_reg[upk.regx]);
+       reg = regcache_raw_get_signed (regcache, mips_reg3_to_reg[upk.regx]);
        if (reg != 0)
          pc = add_offset_16 (pc, upk.offset);
        else
@@ -2278,7 +2282,8 @@ extended_mips16_next_pc (struct frame_info *frame, CORE_ADDR pc,
        int reg;
        unpack_mips16 (gdbarch, pc, extension, insn, i8type, &upk);
        /* upk.regx contains the opcode */
-       reg = get_frame_register_signed (frame, 24);  /* Test register is 24 */
+       /* Test register is 24 */
+       reg = regcache_raw_get_signed (regcache, 24);
        if (((upk.regx == 0) && (reg == 0))     /* BTEZ */
            || ((upk.regx == 1) && (reg != 0))) /* BTNEZ */
          pc = add_offset_16 (pc, upk.offset);
@@ -2300,7 +2305,7 @@ extended_mips16_next_pc (struct frame_info *frame, CORE_ADDR pc,
              reg = mips_reg3_to_reg[upk.regx];
            else
              reg = 31;         /* Function return instruction.  */
-           pc = get_frame_register_signed (frame, reg);
+           pc = regcache_raw_get_signed (regcache, reg);
          }
        else
          pc += 2;
@@ -2312,7 +2317,7 @@ extended_mips16_next_pc (struct frame_info *frame, CORE_ADDR pc,
          that.  */
       {
        pc += 2;
-       pc = extended_mips16_next_pc (frame, pc, insn,
+       pc = extended_mips16_next_pc (regcache, pc, insn,
                                      fetch_mips_16 (gdbarch, pc));
        break;
       }
@@ -2326,11 +2331,11 @@ extended_mips16_next_pc (struct frame_info *frame, CORE_ADDR pc,
 }
 
 static CORE_ADDR
-mips16_next_pc (struct frame_info *frame, CORE_ADDR pc)
+mips16_next_pc (struct regcache *regcache, CORE_ADDR pc)
 {
-  struct gdbarch *gdbarch = get_frame_arch (frame);
+  struct gdbarch *gdbarch = get_regcache_arch (regcache);
   unsigned int insn = fetch_mips_16 (gdbarch, pc);
-  return extended_mips16_next_pc (frame, pc, 0, insn);
+  return extended_mips16_next_pc (regcache, pc, 0, insn);
 }
 
 /* The mips_next_pc function supports single_step when the remote
@@ -2339,16 +2344,16 @@ mips16_next_pc (struct frame_info *frame, CORE_ADDR pc)
    branch will go.  This isn't hard because all the data is available.
    The MIPS32, MIPS16 and microMIPS variants are quite different.  */
 static CORE_ADDR
-mips_next_pc (struct frame_info *frame, CORE_ADDR pc)
+mips_next_pc (struct regcache *regcache, CORE_ADDR pc)
 {
-  struct gdbarch *gdbarch = get_frame_arch (frame);
+  struct gdbarch *gdbarch = get_regcache_arch (regcache);
 
   if (mips_pc_is_mips16 (gdbarch, pc))
-    return mips16_next_pc (frame, pc);
+    return mips16_next_pc (regcache, pc);
   else if (mips_pc_is_micromips (gdbarch, pc))
-    return micromips_next_pc (frame, pc);
+    return micromips_next_pc (regcache, pc);
   else
-    return mips32_next_pc (frame, pc);
+    return mips32_next_pc (regcache, pc);
 }
 
 /* Return non-zero if the MIPS16 instruction INSN is a compact branch
@@ -3877,9 +3882,8 @@ mips_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr)
 #define SC_OPCODE 0x38
 #define SCD_OPCODE 0x3c
 
-static int
-mips_deal_with_atomic_sequence (struct gdbarch *gdbarch,
-                               struct address_space *aspace, CORE_ADDR pc)
+static std::vector<CORE_ADDR>
+mips_deal_with_atomic_sequence (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
   CORE_ADDR breaks[2] = {-1, -1};
   CORE_ADDR loc = pc;
@@ -3893,7 +3897,7 @@ mips_deal_with_atomic_sequence (struct gdbarch *gdbarch,
   insn = mips_fetch_instruction (gdbarch, ISA_MIPS, loc, NULL);
   /* Assume all atomic sequences start with a ll/lld instruction.  */
   if (itype_op (insn) != LL_OPCODE && itype_op (insn) != LLD_OPCODE)
-    return 0;
+    return {};
 
   /* Assume that no atomic sequence is longer than "atomic_sequence_length" 
      instructions.  */
@@ -3910,7 +3914,7 @@ mips_deal_with_atomic_sequence (struct gdbarch *gdbarch,
        {
        case 0: /* SPECIAL */
          if (rtype_funct (insn) >> 1 == 4) /* JR, JALR */
-           return 0; /* fallback to the standard single-step code.  */
+           return {}; /* fallback to the standard single-step code.  */
          break;
        case 1: /* REGIMM */
          is_branch = ((itype_rt (insn) & 0xc) == 0 /* B{LT,GE}Z* */
@@ -3919,7 +3923,7 @@ mips_deal_with_atomic_sequence (struct gdbarch *gdbarch,
          break;
        case 2: /* J */
        case 3: /* JAL */
-         return 0; /* fallback to the standard single-step code.  */
+         return {}; /* fallback to the standard single-step code.  */
        case 4: /* BEQ */
        case 5: /* BNE */
        case 6: /* BLEZ */
@@ -3945,8 +3949,8 @@ mips_deal_with_atomic_sequence (struct gdbarch *gdbarch,
        {
          branch_bp = loc + mips32_relative_offset (insn) + 4;
          if (last_breakpoint >= 1)
-           return 0; /* More than one branch found, fallback to the
-                        standard single-step code.  */
+           return {}; /* More than one branch found, fallback to the
+                         standard single-step code.  */
          breaks[1] = branch_bp;
          last_breakpoint++;
        }
@@ -3957,7 +3961,7 @@ mips_deal_with_atomic_sequence (struct gdbarch *gdbarch,
 
   /* Assume that the atomic sequence ends with a sc/scd instruction.  */
   if (itype_op (insn) != SC_OPCODE && itype_op (insn) != SCD_OPCODE)
-    return 0;
+    return {};
 
   loc += MIPS_INSN32_SIZE;
 
@@ -3969,16 +3973,17 @@ mips_deal_with_atomic_sequence (struct gdbarch *gdbarch,
   if (last_breakpoint && pc <= breaks[1] && breaks[1] <= breaks[0])
     last_breakpoint = 0;
 
+  std::vector<CORE_ADDR> next_pcs;
+
   /* Effectively inserts the breakpoints.  */
   for (index = 0; index <= last_breakpoint; index++)
-    insert_single_step_breakpoint (gdbarch, aspace, breaks[index]);
+    next_pcs.push_back (breaks[index]);
 
-  return 1;
+  return next_pcs;
 }
 
-static int
+static std::vector<CORE_ADDR>
 micromips_deal_with_atomic_sequence (struct gdbarch *gdbarch,
-                                    struct address_space *aspace,
                                     CORE_ADDR pc)
 {
   const int atomic_sequence_length = 16; /* Instruction sequence length.  */
@@ -3995,12 +4000,12 @@ micromips_deal_with_atomic_sequence (struct gdbarch *gdbarch,
   /* Assume all atomic sequences start with a ll/lld instruction.  */
   insn = mips_fetch_instruction (gdbarch, ISA_MICROMIPS, loc, NULL);
   if (micromips_op (insn) != 0x18)     /* POOL32C: bits 011000 */
-    return 0;
+    return {};
   loc += MIPS_INSN16_SIZE;
   insn <<= 16;
   insn |= mips_fetch_instruction (gdbarch, ISA_MICROMIPS, loc, NULL);
   if ((b12s4_op (insn) & 0xb) != 0x3)  /* LL, LLD: bits 011000 0x11 */
-    return 0;
+    return {};
   loc += MIPS_INSN16_SIZE;
 
   /* Assume all atomic sequences end with an sc/scd instruction.  Assume
@@ -4070,7 +4075,7 @@ micromips_deal_with_atomic_sequence (struct gdbarch *gdbarch,
            case 0x35: /* J: bits 110101 */
            case 0x3d: /* JAL: bits 111101 */
            case 0x3c: /* JALX: bits 111100 */
-             return 0; /* Fall back to the standard single-step code. */
+             return {}; /* Fall back to the standard single-step code. */
 
            case 0x18: /* POOL32C: bits 011000 */
              if ((b12s4_op (insn) & 0xb) == 0xb)
@@ -4097,24 +4102,24 @@ micromips_deal_with_atomic_sequence (struct gdbarch *gdbarch,
                  && b5s5_op (insn) != 0x18)
                                /* JRADDIUSP: bits 010001 11000 */
                break;
-             return 0; /* Fall back to the standard single-step code. */
+             return {}; /* Fall back to the standard single-step code. */
 
            case 0x33: /* B16: bits 110011 */
-             return 0; /* Fall back to the standard single-step code. */
+             return {}; /* Fall back to the standard single-step code. */
            }
          break;
        }
       if (is_branch)
        {
          if (last_breakpoint >= 1)
-           return 0; /* More than one branch found, fallback to the
-                        standard single-step code.  */
+           return {}; /* More than one branch found, fallback to the
+                         standard single-step code.  */
          breaks[1] = branch_bp;
          last_breakpoint++;
        }
     }
   if (!sc_found)
-    return 0;
+    return {};
 
   /* Insert a breakpoint right after the end of the atomic sequence.  */
   breaks[0] = loc;
@@ -4124,23 +4129,24 @@ micromips_deal_with_atomic_sequence (struct gdbarch *gdbarch,
   if (last_breakpoint && pc <= breaks[1] && breaks[1] <= breaks[0])
     last_breakpoint = 0;
 
+  std::vector<CORE_ADDR> next_pcs;
+
   /* Effectively inserts the breakpoints.  */
   for (index = 0; index <= last_breakpoint; index++)
-    insert_single_step_breakpoint (gdbarch, aspace, breaks[index]);
+    next_pcs.push_back (breaks[index]);
 
-  return 1;
+  return next_pcs;
 }
 
-static int
-deal_with_atomic_sequence (struct gdbarch *gdbarch,
-                          struct address_space *aspace, CORE_ADDR pc)
+static std::vector<CORE_ADDR>
+deal_with_atomic_sequence (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
   if (mips_pc_is_mips (pc))
-    return mips_deal_with_atomic_sequence (gdbarch, aspace, pc);
+    return mips_deal_with_atomic_sequence (gdbarch, pc);
   else if (mips_pc_is_micromips (gdbarch, pc))
-    return micromips_deal_with_atomic_sequence (gdbarch, aspace, pc);
+    return micromips_deal_with_atomic_sequence (gdbarch, pc);
   else
-    return 0;
+    return {};
 }
 
 /* mips_software_single_step() is called just before we want to resume
@@ -4148,21 +4154,21 @@ deal_with_atomic_sequence (struct gdbarch *gdbarch,
    or kernel single-step support (MIPS on GNU/Linux for example).  We find
    the target of the coming instruction and breakpoint it.  */
 
-int
-mips_software_single_step (struct frame_info *frame)
+std::vector<CORE_ADDR>
+mips_software_single_step (struct regcache *regcache)
 {
-  struct gdbarch *gdbarch = get_frame_arch (frame);
-  struct address_space *aspace = get_frame_address_space (frame);
+  struct gdbarch *gdbarch = get_regcache_arch (regcache);
   CORE_ADDR pc, next_pc;
 
-  pc = get_frame_pc (frame);
-  if (deal_with_atomic_sequence (gdbarch, aspace, pc))
-    return 1;
+  pc = regcache_read_pc (regcache);
+  std::vector<CORE_ADDR> next_pcs = deal_with_atomic_sequence (gdbarch, pc);
 
-  next_pc = mips_next_pc (frame, pc);
+  if (!next_pcs.empty ())
+    return next_pcs;
 
-  insert_single_step_breakpoint (gdbarch, aspace, next_pc);
-  return 1;
+  next_pc = mips_next_pc (regcache, pc);
+
+  return {next_pc};
 }
 
 /* Test whether the PC points to the return instruction at the
@@ -4473,7 +4479,7 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
   int stack_offset = 0;
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   CORE_ADDR func_addr = find_function_addr (function, NULL);
-  int regsize = mips_abi_regsize (gdbarch);
+  int abi_regsize = mips_abi_regsize (gdbarch);
 
   /* For shared libraries, "t9" needs to point at the function
      address.  */
@@ -4496,7 +4502,7 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
      than necessary for EABI, because the first few arguments are
      passed in registers, but that's OK.  */
   for (argnum = 0; argnum < nargs; argnum++)
-    len += align_up (TYPE_LENGTH (value_type (args[argnum])), regsize);
+    len += align_up (TYPE_LENGTH (value_type (args[argnum])), abi_regsize);
   sp -= align_up (len, 16);
 
   if (mips_debug)
@@ -4525,7 +4531,9 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
   for (argnum = 0; argnum < nargs; argnum++)
     {
       const gdb_byte *val;
-      gdb_byte valbuf[MAX_REGISTER_SIZE];
+      /* This holds the address of structures that are passed by
+        reference.  */
+      gdb_byte ref_valbuf[MAX_MIPS_ABI_REGSIZE];
       struct value *arg = args[argnum];
       struct type *arg_type = check_typedef (value_type (arg));
       int len = TYPE_LENGTH (arg_type);
@@ -4538,14 +4546,15 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 
       /* The EABI passes structures that do not fit in a register by
          reference.  */
-      if (len > regsize
+      if (len > abi_regsize
          && (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION))
        {
-         store_unsigned_integer (valbuf, regsize, byte_order,
+         gdb_assert (abi_regsize <= ARRAY_SIZE (ref_valbuf));
+         store_unsigned_integer (ref_valbuf, abi_regsize, byte_order,
                                  value_address (arg));
          typecode = TYPE_CODE_PTR;
-         len = regsize;
-         val = valbuf;
+         len = abi_regsize;
+         val = ref_valbuf;
          if (mips_debug)
            fprintf_unfiltered (gdb_stdlog, " push");
        }
@@ -4557,7 +4566,7 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
          up before the check to see if there are any FP registers
          left.  Non MIPS_EABI targets also pass the FP in the integer
          registers so also round up normal registers.  */
-      if (regsize < 8 && fp_register_arg_p (gdbarch, typecode, arg_type))
+      if (abi_regsize < 8 && fp_register_arg_p (gdbarch, typecode, arg_type))
        {
          if ((float_argreg & 1))
            float_argreg++;
@@ -4623,12 +4632,12 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
          /* Copy the argument to general registers or the stack in
             register-sized pieces.  Large arguments are split between
             registers and stack.  */
-         /* Note: structs whose size is not a multiple of regsize
+         /* Note: structs whose size is not a multiple of abi_regsize
             are treated specially: Irix cc passes
             them in registers where gcc sometimes puts them on the
             stack.  For maximum compatibility, we will put them in
             both places.  */
-         int odd_sized_struct = (len > regsize && len % regsize != 0);
+         int odd_sized_struct = (len > abi_regsize && len % abi_regsize != 0);
 
          /* Note: Floating-point values that didn't fit into an FP
             register are only written to memory.  */
@@ -4636,7 +4645,7 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
            {
              /* Remember if the argument was written to the stack.  */
              int stack_used_p = 0;
-             int partial_len = (len < regsize ? len : regsize);
+             int partial_len = (len < abi_regsize ? len : abi_regsize);
 
              if (mips_debug)
                fprintf_unfiltered (gdb_stdlog, " -- partial=%d",
@@ -4654,15 +4663,15 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
                  stack_used_p = 1;
                  if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
                    {
-                     if (regsize == 8
+                     if (abi_regsize == 8
                          && (typecode == TYPE_CODE_INT
                              || typecode == TYPE_CODE_PTR
                              || typecode == TYPE_CODE_FLT) && len <= 4)
-                       longword_offset = regsize - len;
+                       longword_offset = abi_regsize - len;
                      else if ((typecode == TYPE_CODE_STRUCT
                                || typecode == TYPE_CODE_UNION)
-                              && TYPE_LENGTH (arg_type) < regsize)
-                       longword_offset = regsize - len;
+                              && TYPE_LENGTH (arg_type) < abi_regsize)
+                       longword_offset = abi_regsize - len;
                    }
 
                  if (mips_debug)
@@ -4703,7 +4712,7 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
                  if (mips_debug)
                    fprintf_filtered (gdb_stdlog, " - reg=%d val=%s",
                                      argreg,
-                                     phex (regval, regsize));
+                                     phex (regval, abi_regsize));
                  regcache_cooked_write_signed (regcache, argreg, regval);
                  argreg++;
                }
@@ -4718,7 +4727,7 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
                 only needs to be adjusted when it has been used.  */
 
              if (stack_used_p)
-               stack_offset += align_up (partial_len, regsize);
+               stack_offset += align_up (partial_len, abi_regsize);
            }
        }
       if (mips_debug)
@@ -5756,7 +5765,6 @@ mips_o32_return_value (struct gdbarch *gdbarch, struct value *function,
       /* A struct that contains one or two floats.  Each value is part
          in the least significant part of their floating point
          register..  */
-      gdb_byte reg[MAX_REGISTER_SIZE];
       int regnum;
       int field;
       for (field = 0, regnum = mips_regnum (gdbarch)->fp0;
@@ -6356,7 +6364,6 @@ mips_print_register (struct ui_file *file, struct frame_info *frame,
 
   get_formatted_print_options (&opts, 'x');
   val_print_scalar_formatted (value_type (val),
-                             value_contents_for_printing (val),
                              value_embedded_offset (val),
                              val,
                              &opts, 0, file);
@@ -6472,7 +6479,8 @@ print_gp_register_row (struct ui_file *file, struct frame_info *frame,
 {
   struct gdbarch *gdbarch = get_frame_arch (frame);
   /* Do values for GP (int) regs.  */
-  gdb_byte raw_buffer[MAX_REGISTER_SIZE];
+  const gdb_byte *raw_buffer;
+  struct value *value;
   int ncols = (mips_abi_regsize (gdbarch) == 8 ? 4 : 8);    /* display cols
                                                               per row.  */
   int col, byte;
@@ -6531,14 +6539,23 @@ print_gp_register_row (struct ui_file *file, struct frame_info *frame,
        break;                  /* End row: large register.  */
 
       /* OK: get the data in raw format.  */
-      if (!deprecated_frame_register_read (frame, regnum, raw_buffer))
-       error (_("can't read register %d (%s)"),
-              regnum, gdbarch_register_name (gdbarch, regnum));
+      value = get_frame_register_value (frame, regnum);
+      if (value_optimized_out (value)
+       || !value_entirely_available (value))
+       {
+         fprintf_filtered (file, "%*s ",
+                           (int) mips_abi_regsize (gdbarch) * 2,
+                           (mips_abi_regsize (gdbarch) == 4 ? "<unavl>"
+                            : "<unavailable>"));
+         col++;
+         continue;
+       }
+      raw_buffer = value_contents_all (value);
       /* pad small registers */
       for (byte = 0;
           byte < (mips_abi_regsize (gdbarch)
                   - register_size (gdbarch, regnum)); byte++)
-       printf_filtered ("  ");
+       fprintf_filtered (file, "  ");
       /* Now print the register value in hex, endian order.  */
       if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
        for (byte =
@@ -6877,9 +6894,9 @@ set_mips_command (char *args, int from_tty)
 /* Commands to show/set the MIPS FPU type.  */
 
 static void
-show_mipsfpu_command (char *args, int from_tty)
+show_mipsfpu_command (const char *args, int from_tty)
 {
-  char *fpu;
+  const char *fpu;
 
   if (gdbarch_bfd_arch_info (target_gdbarch ())->arch != bfd_arch_mips)
     {
@@ -6922,7 +6939,7 @@ set_mipsfpu_command (char *args, int from_tty)
 }
 
 static void
-set_mipsfpu_single_command (char *args, int from_tty)
+set_mipsfpu_single_command (const char *args, int from_tty)
 {
   struct gdbarch_info info;
   gdbarch_info_init (&info);
@@ -6936,7 +6953,7 @@ set_mipsfpu_single_command (char *args, int from_tty)
 }
 
 static void
-set_mipsfpu_double_command (char *args, int from_tty)
+set_mipsfpu_double_command (const char *args, int from_tty)
 {
   struct gdbarch_info info;
   gdbarch_info_init (&info);
@@ -6950,7 +6967,7 @@ set_mipsfpu_double_command (char *args, int from_tty)
 }
 
 static void
-set_mipsfpu_none_command (char *args, int from_tty)
+set_mipsfpu_none_command (const char *args, int from_tty)
 {
   struct gdbarch_info info;
   gdbarch_info_init (&info);
@@ -6964,7 +6981,7 @@ set_mipsfpu_none_command (char *args, int from_tty)
 }
 
 static void
-set_mipsfpu_auto_command (char *args, int from_tty)
+set_mipsfpu_auto_command (const char *args, int from_tty)
 {
   mips_fpu_type_auto = 1;
 }
@@ -6982,7 +6999,9 @@ reinit_frame_cache_sfunc (char *args, int from_tty,
 static int
 gdb_print_insn_mips (bfd_vma memaddr, struct disassemble_info *info)
 {
-  struct gdbarch *gdbarch = (struct gdbarch *) info->application_data;
+  gdb_disassembler *di
+    = static_cast<gdb_disassembler *>(info->application_data);
+  struct gdbarch *gdbarch = di->arch ();
 
   /* FIXME: cagney/2003-06-26: Is this even necessary?  The
      disassembler needs to be able to locally determine the ISA, and
@@ -7006,11 +7025,7 @@ gdb_print_insn_mips (bfd_vma memaddr, struct disassemble_info *info)
        register naming conventions specified by the user.  */
     info->disassembler_options = "gpr-names=32";
 
-  /* Call the appropriate disassembler based on the target endian-ness.  */
-  if (info->endian == BFD_ENDIAN_BIG)
-    return print_insn_big_mips (memaddr, info);
-  else
-    return print_insn_little_mips (memaddr, info);
+  return default_print_insn (memaddr, info);
 }
 
 static int
@@ -7035,6 +7050,8 @@ gdb_print_insn_mips_n64 (bfd_vma memaddr, struct disassemble_info *info)
   return gdb_print_insn_mips (memaddr, info);
 }
 
+/* Implement the breakpoint_kind_from_pc gdbarch method.  */
+
 static int
 mips_breakpoint_kind_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr)
 {
@@ -7061,6 +7078,8 @@ mips_breakpoint_kind_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr)
     return MIPS_BP_KIND_MIPS32;
 }
 
+/* Implement the sw_breakpoint_from_kind gdbarch method.  */
+
 static const gdb_byte *
 mips_sw_breakpoint_from_kind (struct gdbarch *gdbarch, int kind, int *size)
 {
@@ -7118,24 +7137,6 @@ mips_sw_breakpoint_from_kind (struct gdbarch *gdbarch, int kind, int *size)
     };
 }
 
-/* This function implements gdbarch_breakpoint_from_pc.  It uses the
-   program counter value to determine whether a 16- or 32-bit breakpoint
-   should be used.  It returns a pointer to a string of bytes that encode a
-   breakpoint instruction, stores the length of the string to *lenptr, and
-   adjusts pc (if necessary) to point to the actual memory location where
-   the breakpoint should be inserted.  */
-
-GDBARCH_BREAKPOINT_FROM_PC (mips)
-
-/* Determine the remote breakpoint kind suitable for the PC.  */
-
-static void
-mips_remote_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr,
-                               int *kindptr)
-{
-  *kindptr = mips_breakpoint_kind_from_pc (gdbarch, pcptr);
-}
-
 /* Return non-zero if the standard MIPS instruction INST has a branch
    delay slot (i.e. it is a jump or branch instruction).  This function
    is based on mips32_next_pc.  */
@@ -8450,7 +8451,7 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
        break;
       }
   else if (arches != NULL)
-    fpu_type = gdbarch_tdep (arches->gdbarch)->mips_fpu_type;
+    fpu_type = MIPS_FPU_TYPE (arches->gdbarch);
   else
     fpu_type = MIPS_FPU_DOUBLE;
   if (gdbarch_debug)
@@ -8490,7 +8491,7 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
          != mips64_transfers_32bit_regs_p)
        continue;
       /* Be pedantic about which FPU is selected.  */
-      if (gdbarch_tdep (arches->gdbarch)->mips_fpu_type != fpu_type)
+      if (MIPS_FPU_TYPE (arches->gdbarch) != fpu_type)
        continue;
 
       if (tdesc_data != NULL)
@@ -8499,7 +8500,7 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
     }
 
   /* Need a new architecture.  Fill in a target specific vector.  */
-  tdep = XNEW (struct gdbarch_tdep);
+  tdep = XCNEW (struct gdbarch_tdep);
   gdbarch = gdbarch_alloc (&info, tdep);
   tdep->elf_flags = elf_flags;
   tdep->mips64_transfers_32bit_regs_p = mips64_transfers_32bit_regs_p;
@@ -8731,9 +8732,8 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_value_to_register (gdbarch, mips_value_to_register);
 
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
-  SET_GDBARCH_BREAKPOINT_MANIPULATION (mips);
-  set_gdbarch_remote_breakpoint_from_pc (gdbarch,
-                                        mips_remote_breakpoint_from_pc);
+  set_gdbarch_breakpoint_kind_from_pc (gdbarch, mips_breakpoint_kind_from_pc);
+  set_gdbarch_sw_breakpoint_from_kind (gdbarch, mips_sw_breakpoint_from_kind);
   set_gdbarch_adjust_breakpoint_address (gdbarch,
                                         mips_adjust_breakpoint_address);
 
@@ -8785,7 +8785,7 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   mips_register_g_packet_guesses (gdbarch);
 
   /* Hook in OS ABI-specific overrides, if they have been registered.  */
-  info.tdep_info = tdesc_data;
+  info.tdesc_data = tdesc_data;
   gdbarch_init_osabi (info, gdbarch);
 
   /* The hook may have adjusted num_regs, fetch the final value and
@@ -8907,6 +8907,24 @@ show_mips_compression (struct ui_file *file, int from_tty,
                    value);
 }
 
+/* Return a textual name for MIPS FPU type FPU_TYPE.  */
+
+static const char *
+mips_fpu_type_str (enum mips_fpu_type fpu_type)
+{
+  switch (fpu_type)
+    {
+    case MIPS_FPU_NONE:
+      return "none";
+    case MIPS_FPU_SINGLE:
+      return "single";
+    case MIPS_FPU_DOUBLE:
+      return "double";
+    default:
+      return "???";
+    }
+}
+
 static void
 mips_dump_tdep (struct gdbarch *gdbarch, struct ui_file *file)
 {
@@ -8957,23 +8975,15 @@ mips_dump_tdep (struct gdbarch *gdbarch, struct ui_file *file)
   fprintf_unfiltered (file,
                      "mips_dump_tdep: MIPS_DEFAULT_FPU_TYPE = %d (%s)\n",
                      MIPS_DEFAULT_FPU_TYPE,
-                     (MIPS_DEFAULT_FPU_TYPE == MIPS_FPU_NONE ? "none"
-                      : MIPS_DEFAULT_FPU_TYPE == MIPS_FPU_SINGLE ? "single"
-                      : MIPS_DEFAULT_FPU_TYPE == MIPS_FPU_DOUBLE ? "double"
-                      : "???"));
+                     mips_fpu_type_str (MIPS_DEFAULT_FPU_TYPE));
   fprintf_unfiltered (file, "mips_dump_tdep: MIPS_EABI = %d\n",
                      MIPS_EABI (gdbarch));
   fprintf_unfiltered (file,
                      "mips_dump_tdep: MIPS_FPU_TYPE = %d (%s)\n",
                      MIPS_FPU_TYPE (gdbarch),
-                     (MIPS_FPU_TYPE (gdbarch) == MIPS_FPU_NONE ? "none"
-                      : MIPS_FPU_TYPE (gdbarch) == MIPS_FPU_SINGLE ? "single"
-                      : MIPS_FPU_TYPE (gdbarch) == MIPS_FPU_DOUBLE ? "double"
-                      : "???"));
+                     mips_fpu_type_str (MIPS_FPU_TYPE (gdbarch)));
 }
 
-extern initialize_file_ftype _initialize_mips_tdep; /* -Wmissing-prototypes */
-
 void
 _initialize_mips_tdep (void)
 {
This page took 0.042275 seconds and 4 git commands to generate.