• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Revision14e140b572b1ed8e69a9e6f40965325b4231fa58 (tree)
Time2004-03-10 00:46:06
AuthorDaniel Jacobowitz <drow@fals...>
CommiterDaniel Jacobowitz

Log Message

* arm-tdep.c (thumb_get_next_pc): Handle BX.
(arm_get_next_pc): Handle BX and BLX.

Change Summary

Incremental Difference

--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
1+2004-03-07 Daniel Jacobowitz <drow@mvista.com>
2+
3+ * arm-tdep.c (thumb_get_next_pc): Handle BX.
4+ (arm_get_next_pc): Handle BX and BLX.
5+
16 2004-03-05 David Carlton <carlton@kealia.com>
27
38 * cp-namespace.c (cp_lookup_transparent_type_loop): Fix recursion
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -1657,6 +1657,17 @@ thumb_get_next_pc (CORE_ADDR pc)
16571657 offset = (sbits (inst1, 0, 10) << 12) + (bits (inst2, 0, 10) << 1);
16581658 nextpc = pc_val + offset;
16591659 }
1660+ else if ((inst1 & 0xff80) == 0x4700) /* branch and exchange (bx) */
1661+ {
1662+ if (bits (inst1, 3, 6) == 0x0f)
1663+ nextpc = pc_val;
1664+ else
1665+ nextpc = read_register (bits (inst1, 3, 6));
1666+
1667+ nextpc = ADDR_BITS_REMOVE (nextpc);
1668+ if (nextpc == pc)
1669+ error ("Infinite loop detected");
1670+ }
16601671
16611672 return nextpc;
16621673 }
@@ -1697,6 +1708,20 @@ arm_get_next_pc (CORE_ADDR pc)
16971708 && bits (this_instr, 4, 7) == 9) /* multiply */
16981709 error ("Illegal update to pc in instruction");
16991710
1711+ /* BX <reg>, BLX <reg> */
1712+ if (bits (this_instr, 4, 28) == 0x12fff1
1713+ || bits (this_instr, 4, 28) == 0x12fff3)
1714+ {
1715+ rn = bits (this_instr, 0, 3);
1716+ result = (rn == 15) ? pc_val + 8 : read_register (rn);
1717+ nextpc = (CORE_ADDR) ADDR_BITS_REMOVE (result);
1718+
1719+ if (nextpc == pc)
1720+ error ("Infinite loop detected");
1721+
1722+ return nextpc;
1723+ }
1724+
17001725 /* Multiply into PC */
17011726 c = (status & FLAG_C) ? 1 : 0;
17021727 rn = bits (this_instr, 16, 19);
@@ -1862,6 +1887,10 @@ arm_get_next_pc (CORE_ADDR pc)
18621887 {
18631888 nextpc = BranchDest (pc, this_instr);
18641889
1890+ /* BLX */
1891+ if (bits (this_instr, 28, 31) == INST_NV)
1892+ nextpc |= bit (this_instr, 24) << 1;
1893+
18651894 nextpc = ADDR_BITS_REMOVE (nextpc);
18661895 if (nextpc == pc)
18671896 error ("Infinite loop detected");