* mips-tdep.c (mips_about_to_return): Remove dead MIPS16 support

code.  Handle JR.HB correctly.
This commit is contained in:
Maciej W. Rozycki 2012-04-24 19:56:02 +00:00
parent 742c84f629
commit 6321c22a8c
2 changed files with 15 additions and 10 deletions

View File

@ -1,3 +1,8 @@
2012-04-24 Maciej W. Rozycki <macro@codesourcery.com>
* mips-tdep.c (mips_about_to_return): Remove dead MIPS16 support
code. Handle JR.HB correctly.
2012-04-24 Maciej W. Rozycki <macro@codesourcery.com>
* mips-tdep.c

View File

@ -2763,16 +2763,16 @@ mips_software_single_step (struct frame_info *frame)
static int
mips_about_to_return (struct gdbarch *gdbarch, CORE_ADDR pc)
{
if (mips_pc_is_mips16 (pc))
/* This mips16 case isn't necessarily reliable. Sometimes the compiler
generates a "jr $ra"; other times it generates code to load
the return address from the stack to an accessible register (such
as $a3), then a "jr" using that register. This second case
is almost impossible to distinguish from an indirect jump
used for switch statements, so we don't even try. */
return mips_fetch_instruction (gdbarch, pc) == 0xe820; /* jr $ra */
else
return mips_fetch_instruction (gdbarch, pc) == 0x3e00008; /* jr $ra */
ULONGEST insn;
ULONGEST hint;
/* This used to check for MIPS16, but this piece of code is never
called for MIPS16 functions. */
gdb_assert (!mips_pc_is_mips16 (pc));
insn = mips_fetch_instruction (gdbarch, pc);
hint = 0x7c0;
return (insn & ~hint) == 0x3e00008; /* jr(.hb) $ra */
}