Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* ARM singlestep bug
@ 2007-01-25 19:23 Paul Brook
  2007-01-25 19:25 ` Daniel Jacobowitz
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Brook @ 2007-01-25 19:23 UTC (permalink / raw)
  To: gdb-patches

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);


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-01-25 19:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-25 19:23 ARM singlestep bug Paul Brook
2007-01-25 19:25 ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox