aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.arch/arm-disp-step.S
diff options
context:
space:
mode:
authorYao Qi <yao@codesourcery.com>2011-02-15 14:26:34 +0000
committerYao Qi <yao@codesourcery.com>2011-02-15 14:26:34 +0000
commit494e194e77ee1e03d260268fc132dccf308f223e (patch)
tree49847f1526839f4fd742587aef1a9901ed36ed93 /gdb/testsuite/gdb.arch/arm-disp-step.S
parentd9492458a11ca366f79a4c8fb03e312bfe0b047e (diff)
downloadgdb-494e194e77ee1e03d260268fc132dccf308f223e.zip
gdb-494e194e77ee1e03d260268fc132dccf308f223e.tar.gz
gdb-494e194e77ee1e03d260268fc132dccf308f223e.tar.bz2
2011-02-15 Yao Qi <yao@codesourcery.com>
PR tdep/12352 * arm-tdep.c (copy_ldr_str_ldrb_strb): Replace PC with SP in order to store PC value on stack instead of text section. 2011-02-15 Yao Qi <yao@codesourcery.com> PR tdep/12352 * gdb.arch/arm-disp-step.S : New test for str instruction. * gdb.arch/arm-disp-step.exp : Likewise
Diffstat (limited to 'gdb/testsuite/gdb.arch/arm-disp-step.S')
-rw-r--r--gdb/testsuite/gdb.arch/arm-disp-step.S37
1 files changed, 37 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.arch/arm-disp-step.S b/gdb/testsuite/gdb.arch/arm-disp-step.S
index e1756e7..fb76974 100644
--- a/gdb/testsuite/gdb.arch/arm-disp-step.S
+++ b/gdb/testsuite/gdb.arch/arm-disp-step.S
@@ -48,6 +48,10 @@ test_ret_end:
bl test_ldm_stm_pc
#endif
+ /* Test str in ARM mode and Thumb-2 */
+#if !defined(__thumb__)
+ bl test_str_pc
+#endif
/* Return */
mov sp, r7
sub sp, sp, #4
@@ -118,3 +122,36 @@ test_ldm_stm_pc_ret:
.word test_ldm_stm_pc_ret
.size test_ldm_stm_pc, .-test_ldm_stm_pc
#endif
+
+#if !defined(__thumb__)
+#if defined (__thumb2__)
+ .code 16
+ .thumb_func
+#endif
+ .global test_str_pc
+ .type test_str_pc, %function
+test_str_pc:
+ str pc, [sp, #-4]
+ ldr r0, [sp, #-4]
+ sub r0, r0, pc
+ /* compute offset again without displaced stepping. */
+ str pc, [sp, #-4]
+ ldr r1, [sp, #-4]
+ sub r1, r1, pc
+
+ /* r0 should be equal to r1. */
+ cmp r0, r1
+ bne pc_offset_wrong
+
+ .global pc_offset_right
+pc_offset_right:
+ b test_str_pc_end
+
+ .global pc_offset_wrong
+pc_offset_wrong:
+ nop
+
+ .global test_str_pc_end
+test_str_pc_end:
+ bx lr
+#endif