[PATCH] Fix TBB TBH decoding in Thumb-2

Richard Earnshaw Richard.Earnshaw@buzzard.freeserve.co.uk
Wed Mar 31 22:13:00 GMT 2010


I discovered today that the TBB and TBH instructions weren't being
correctly decoded when single-stepping thumb-2 code.  It turned out to
be two problems.  Firstly TBH was being incorrectly tested for (actually
matching a TBB opcode.  Secondly, both TBB and TBH were using the wrong
base address for the jump when the base register was the PC (using the
current PC value rather than PC+4).

Fixed thusly:

2010-03-31  Richard Earnshaw  <rearnsha@arm.com>

	* arm-tdep.c (thumb_get_next_pc_raw): Correctly detect TBH
	instructions.  Use the PC+4 if the base of the TBB or TBH is the 
	PC register.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gdb.patch
Type: text/x-patch
Size: 2194 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20100331/6ca6c97c/attachment.bin>


More information about the Gdb-patches mailing list