aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmair Javaid <omair.javaid@linaro.org>2014-01-04 00:15:32 +0500
committerWill Newton <will.newton@linaro.org>2014-01-15 16:47:07 +0000
commit9904a494c1f85d283ffa7c18ac5103d2ff2feba6 (patch)
tree00f563c19bec230bd22cfe30e26b5cbb3128ed13
parentf969241e66e5c302d66a28d3f6ae5ce6fee19350 (diff)
downloadgdb-9904a494c1f85d283ffa7c18ac5103d2ff2feba6.zip
gdb-9904a494c1f85d283ffa7c18ac5103d2ff2feba6.tar.gz
gdb-9904a494c1f85d283ffa7c18ac5103d2ff2feba6.tar.bz2
gdb: ARM: Fix for bug in pop instruction decoding
This patch fixes thumb push instruction recording by replacing base register from pc to sp. gdb/ChangeLog: 2014-01-15 Omair Javaid <omair.javaid@linaro.org> * arm-tdep.c (thumb_record_misc): Update to use sp as base register for push instruction recording.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/arm-tdep.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ccc8340..1070587 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2014-01-15 Omair Javaid <omair.javaid@linaro.org>
+ * arm-tdep.c (thumb_record_misc): Update to use sp as base
+ register for push instruction recording.
+
+2014-01-15 Omair Javaid <omair.javaid@linaro.org>
+
* arm-tdep.c (thumb_record_misc): Update to correct logical
error while recording ldm, ldmia and pop instructions.
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index c945cbd..009536a 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -12204,7 +12204,7 @@ thumb_record_misc (insn_decode_record *thumb_insn_r)
{
/* PUSH. */
register_bits = bits (thumb_insn_r->arm_insn, 0, 7);
- regcache_raw_read_unsigned (reg_cache, ARM_PC_REGNUM, &u_regval);
+ regcache_raw_read_unsigned (reg_cache, ARM_SP_REGNUM, &u_regval);
while (register_bits)
{
if (register_bits & 0x00000001)