1 /* Copyright 2009-2019 Free Software Foundation, Inc.
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 3 of the License, or
6 (at your option) any later version.
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with this program. If not, see <http://www.gnu.org/licenses/>.
16 This file is part of the gdb testsuite.
17 It tests displaced stepping over various insns that require special
26 /***********************************************/
38 /***********************************************/
40 /* test abs-jmp/rep-ret */
43 mov $test_abs_jmp_return,%rdx
45 mov $test_abs_jmp_subr,%rdx
51 .global test_rep_ret_end
55 /***********************************************/
60 mov $0x27,%eax /* getpid */
67 /***********************************************/
69 /* Test stepping over int3.
70 The prefixes are pointless, but it's possible, so we exercise it. */
83 /***********************************************/
86 GDB picks a spare register to hold the rip-relative address.
87 Exercise all the possibilities (rax-rdi, sans rsp). */
92 .global test_rip_rax_end
99 .global test_rip_rbx_end
105 add answer(%rip),%rcx
106 .global test_rip_rcx_end
112 add answer(%rip),%rdx
113 .global test_rip_rdx_end
119 add answer(%rip),%rbp
120 .global test_rip_rbp_end
126 add answer(%rip),%rsi
127 .global test_rip_rsi_end
133 add answer(%rip),%rdi
134 .global test_rip_rdi_end
138 /* skip over test data */
141 /* test rip-relative data */
145 /***********************************************/
154 /***********************************************/
156 /* subroutine to help test call/ret */
160 .global test_call_end
168 /***********************************************/
170 /* subroutine to help test abs-jmp/rep-ret */
174 .global test_abs_jmp_end