aboutsummaryrefslogtreecommitdiff
path: root/gdb/mips-tdep.c
diff options
context:
space:
mode:
authorMark Alexander <marka@cygnus>1997-02-04 17:18:56 +0000
committerMark Alexander <marka@cygnus>1997-02-04 17:18:56 +0000
commit7d9e8fac1a0cef8cb4ae8e2e851bf51db54e5ecc (patch)
tree7b7360590200f826b6317ab3627872bf6fa43e51 /gdb/mips-tdep.c
parentb348b9fd0eaa0a02916e4b1e32fc047016058d57 (diff)
downloadgdb-7d9e8fac1a0cef8cb4ae8e2e851bf51db54e5ecc.zip
gdb-7d9e8fac1a0cef8cb4ae8e2e851bf51db54e5ecc.tar.gz
gdb-7d9e8fac1a0cef8cb4ae8e2e851bf51db54e5ecc.tar.bz2
* mips-tdep.c (mips16_get_imm): Fix calculation of extended immediate.
(mips16_heuristic_proc_desc): Recognize jal(x) instruction.
Diffstat (limited to 'gdb/mips-tdep.c')
-rw-r--r--gdb/mips-tdep.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index 75f10d1..5369259 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -651,7 +651,7 @@ mips16_get_imm (prev_inst, inst, nbits, scale, is_signed)
if ((prev_inst & 0xf800) == 0xf000) /* prev instruction was EXTEND? */
{
- offset = ((prev_inst & 0x1f) << 11) | (prev_inst & 0x7e00);
+ offset = ((prev_inst & 0x1f) << 11) | (prev_inst & 0x7e0);
if (offset & 0x8000) /* check for negative extend */
offset = 0 - (0x10000 - (offset & 0xffff));
return offset | (inst & 0x1f);
@@ -788,6 +788,8 @@ mips16_heuristic_proc_desc(start_pc, limit_pc, next_frame, sp)
temp_saved_regs.regs[reg] = sp + offset;
}
}
+ else if ((inst & 0xf800) == 0x1800) /* jal(x) */
+ cur_pc += MIPS16_INSTLEN; /* 32-bit instruction */
}
}