* mips-tdep.c (mips32_next_pc): Handle JALX.
authorMaciej W. Rozycki <macro@linux-mips.org>
Tue, 10 Apr 2012 22:54:24 +0000 (22:54 +0000)
committerMaciej W. Rozycki <macro@linux-mips.org>
Tue, 10 Apr 2012 22:54:24 +0000 (22:54 +0000)
gdb/ChangeLog
gdb/mips-tdep.c

index b34fbf6..1312b1e 100644 (file)
@@ -1,3 +1,7 @@
+2011-04-10  Maciej W. Rozycki  <macro@codesourcery.com>
+
+       * mips-tdep.c (mips32_next_pc): Handle JALX.
+
 2012-04-10  Yao Qi  <yao@codesourcery.com>
 
        * Makefile.in (gnulib/Makefile): Remove duplicated dependency.
index 013b07c..7ec3583 100644 (file)
@@ -1203,6 +1203,16 @@ mips32_next_pc (struct frame_info *frame, CORE_ADDR pc)
               && (itype_rt (inst) & 2) == 0)
        /* BC1ANY4F, BC1ANY4T: 010001 01010 xxx0x */
        pc = mips32_bc1_pc (gdbarch, frame, inst, pc + 4, 4);
+      else if (itype_op (inst) == 29)
+       /* JALX: 011101 */
+       /* The new PC will be alternate mode.  */
+       {
+         unsigned long reg;
+
+         reg = jtype_target (inst) << 2;
+         /* Add 1 to indicate 16-bit mode -- invert ISA mode.  */
+         pc = ((pc + 4) & ~(CORE_ADDR) 0x0fffffff) + reg + 1;
+       }
       else
        pc += 4;                /* Not a branch, next instruction is easy.  */
     }
@@ -1295,14 +1305,6 @@ mips32_next_pc (struct frame_info *frame, CORE_ADDR pc)
            pc = reg + ((pc + 4) & ~(CORE_ADDR) 0x0fffffff);
          }
          break;
-         /* FIXME case JALX : */
-         {
-           unsigned long reg;
-           reg = jtype_target (inst) << 2;
-           pc = reg + ((pc + 4) & ~(CORE_ADDR) 0x0fffffff) + 1;  /* yes, +1 */
-           /* Add 1 to indicate 16 bit mode - Invert ISA mode */
-         }
-         break;                /* The new PC will be alternate mode */
        case 4:         /* BEQ, BEQL */
        equal_branch:
          if (get_frame_register_signed (frame, itype_rs (inst)) ==