diff options
author | Yao Qi <yao.qi@linaro.org> | 2015-04-10 10:33:01 +0100 |
---|---|---|
committer | Yao Qi <yao.qi@linaro.org> | 2015-04-10 10:33:01 +0100 |
commit | ef713951c571c8490ca57c17c88785c6df1ed840 (patch) | |
tree | 04c543ebae288bd41e2187b401aaa8cda5372c3a /gdb/testsuite/gdb.arch/arm-disp-step.S | |
parent | 906d60cf467b2d5a20ff04dbc4805a84ef313229 (diff) | |
download | gdb-ef713951c571c8490ca57c17c88785c6df1ed840.zip gdb-ef713951c571c8490ca57c17c88785c6df1ed840.tar.gz gdb-ef713951c571c8490ca57c17c88785c6df1ed840.tar.bz2 |
[arm] Fix displaced stepping for thumb alu reg instruction
Recent patch series "V2 All-stop on top of non-stop" causes a SIGSEGV
in the test case,
> -PASS: gdb.base/info-shared.exp: continue to breakpoint: library function #4
> +FAIL: gdb.base/info-shared.exp: continue to breakpoint: library function #4
>
> continue^M
> Continuing.^M
> ^M
> Program received signal SIGSEGV, Segmentation fault.^M
> 0x40021564 in ?? () gdb/testsuite/gdb.base/info-shared-solib1.so^M
> (gdb) FAIL: gdb.base/info-shared.exp: continue to breakpoint: library function #4
and an ARM displaced stepping bug is exposed. It can be reproduced by
the modified gdb.arch/arm-disp-step.exp as below,
continue^M
Continuing.^M
^M
Program received signal SIGSEGV, Segmentation fault.^M
0xa713cfcc in ?? ()^M
(gdb) FAIL: gdb.arch/arm-disp-step.exp: continue to breakpoint: continue to test_add_rn_pc_end
This patch is to fix it.
gdb:
2015-04-10 Yao Qi <yao.qi@linaro.org>
* arm-tdep.c (install_alu_reg): Update comment.
(thumb_copy_alu_reg): Remove local variable rn. Update
debugging message. Use r2 instead of r1 in the modified
instruction.
gdb/testsuite:
2015-04-10 Yao Qi <yao.qi@linaro.org>
* gdb.arch/arm-disp-step.S (main): Call test_add_rn_pc.
(test_add_rn_pc): New function.
* gdb.arch/arm-disp-step.exp (test_add_rn_pc): New proc.
(top level): Invoke test_add_rn_pc.
Diffstat (limited to 'gdb/testsuite/gdb.arch/arm-disp-step.S')
-rw-r--r-- | gdb/testsuite/gdb.arch/arm-disp-step.S | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.arch/arm-disp-step.S b/gdb/testsuite/gdb.arch/arm-disp-step.S index c9c9447..c3b1088 100644 --- a/gdb/testsuite/gdb.arch/arm-disp-step.S +++ b/gdb/testsuite/gdb.arch/arm-disp-step.S @@ -78,6 +78,11 @@ test_ret_end: #if !defined(__thumb__) bl test_str_pc #endif + + /* Test add with pc in Thumb and Thumb-2 */ +#if defined(__thumb__) + bl test_add_rn_pc +#endif /* Return */ mov sp, r7 sub sp, sp, #4 @@ -372,3 +377,17 @@ pc_offset_wrong: test_str_pc_end: bx lr #endif + +#if defined(__thumb__) + .global test_add_rn_pc + .code 16 + .thumb_func +test_add_rn_pc: + mov r3, 4 +test_add_rn_pc_start: + add r3, pc + .global test_add_rn_pc_end +test_add_rn_pc_end: + bx lr + .size test_add_rn_pc, .-test_add_rn_pc +#endif |