This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
mips-tdep.c: Use is_mips16_addr() to test for the MIPS16 mode
- From: "Maciej W. Rozycki" <macro at mips dot com>
- To: gdb-patches at sourceware dot org
- Cc: "Maciej W. Rozycki" <macro at linux-mips dot org>
- Date: Fri, 20 Jul 2007 13:53:49 +0100 (BST)
- Subject: mips-tdep.c: Use is_mips16_addr() to test for the MIPS16 mode
Hello,
We have a function to check whether an address of instruction implies the
MIPS16 mode or not. However mips_next_pc() checks that directly. Here is
a fix. No regressions for mipsisa32-sde-elf, with mips-sim-sde32/-EB and
mips-sim-sde32/-mips16/-EB.
2007-07-20 Maciej W. Rozycki <macro@mips.com>
* mips-tdep.c (mips_next_pc): Use is_mips16_addr() instead of
a direct test.
OK to apply?
Maciej
gdb-mips_next_pc.diff
Index: binutils-quilt/src/gdb/mips-tdep.c
===================================================================
--- binutils-quilt.orig/src/gdb/mips-tdep.c 2007-07-19 18:15:07.000000000 +0100
+++ binutils-quilt/src/gdb/mips-tdep.c 2007-07-19 18:27:51.000000000 +0100
@@ -1437,11 +1437,11 @@
target monitor or stub is not developed enough to do a single_step.
It works by decoding the current instruction and predicting where a
branch will go. This isnt hard because all the data is available.
- The MIPS32 and MIPS16 variants are quite different */
+ The MIPS32 and MIPS16 variants are quite different. */
static CORE_ADDR
mips_next_pc (struct frame_info *frame, CORE_ADDR pc)
{
- if (pc & 0x01)
+ if (is_mips16_addr (pc))
return mips16_next_pc (frame, pc);
else
return mips32_next_pc (frame, pc);