aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2004-03-09 15:44:26 +0000
committerDaniel Jacobowitz <drow@false.org>2004-03-09 15:44:26 +0000
commitaa17d93ef598c597538deaa8f19217ee8ca0ec26 (patch)
tree81dc4804855b6cacc97436f9dbab5ad45ed506ff /gdb
parent58670637de158d29a389b48b82179e26b13d96ee (diff)
downloadgdb-aa17d93ef598c597538deaa8f19217ee8ca0ec26.zip
gdb-aa17d93ef598c597538deaa8f19217ee8ca0ec26.tar.gz
gdb-aa17d93ef598c597538deaa8f19217ee8ca0ec26.tar.bz2
* arm-tdep.c (thumb_get_next_pc): Handle Thumb BLX.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/arm-tdep.c7
2 files changed, 9 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 52df769..56fc35d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2004-03-09 Daniel Jacobowitz <drow@mvista.com>
+
+ * arm-tdep.c (thumb_get_next_pc): Handle Thumb BLX.
+
2004-03-08 Nathan J. Williams <nathanw@wasabisystems.com>
* MAINTAINERS (write after approval): Add myself.
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 06bfcb6..05c0f23 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -1651,13 +1651,16 @@ thumb_get_next_pc (CORE_ADDR pc)
{
nextpc = pc_val + (sbits (inst1, 0, 10) << 1);
}
- else if ((inst1 & 0xf800) == 0xf000) /* long branch with link */
+ else if ((inst1 & 0xf800) == 0xf000) /* long branch with link, and blx */
{
unsigned short inst2 = read_memory_integer (pc + 2, 2);
offset = (sbits (inst1, 0, 10) << 12) + (bits (inst2, 0, 10) << 1);
nextpc = pc_val + offset;
+ /* For BLX make sure to clear the low bits. */
+ if (bits (inst2, 11, 12) == 1)
+ nextpc = nextpc & 0xfffffffc;
}
- else if ((inst1 & 0xff80) == 0x4700) /* branch and exchange (bx) */
+ else if ((inst1 & 0xff00) == 0x4700) /* bx REG, blx REG */
{
if (bits (inst1, 3, 6) == 0x0f)
nextpc = pc_val;