This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
ARM singlestep bug
- From: Paul Brook <paul at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Date: Thu, 25 Jan 2007 19:23:39 +0000
- Subject: ARM singlestep bug
The patch below fixes a bug in arm_get_next_pc. The test for the BX
instruction was incorrectly including the first bit of the condition code.
Bit 28 is clear on unconditonal BX instructions, so it works by chance most
of the time.
Ok?
Paul
2007-01-25 Paul Brook <paul@codesourcery.com>
gdb/
* arm-tdep.c (arm_get_next_pc): Fix bitfield off-by-one error.
Index: gdb/arm-tdep.c
===================================================================
--- gdb/arm-tdep.c (revision 158575)
+++ gdb/arm-tdep.c (working copy)
@@ -1693,8 +1693,8 @@ arm_get_next_pc (CORE_ADDR pc)
error (_("Invalid update to pc in instruction"));
/* BX <reg>, BLX <reg> */
- if (bits (this_instr, 4, 28) == 0x12fff1
- || bits (this_instr, 4, 28) == 0x12fff3)
+ if (bits (this_instr, 4, 27) == 0x12fff1
+ || bits (this_instr, 4, 27) == 0x12fff3)
{
rn = bits (this_instr, 0, 3);
result = (rn == 15) ? pc_val + 8 : read_register (rn);