1 /* Copyright 2009-2024 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 callq setup_signal_handler
30 /***********************************************/
42 /***********************************************/
44 /* test abs-jmp/rep-ret */
47 mov $test_abs_jmp_return,%rdx
49 mov $test_abs_jmp_subr,%rdx
55 .global test_rep_ret_end
59 /***********************************************/
64 mov $0x27,%eax /* getpid */
71 /***********************************************/
73 /* Test stepping over int3.
74 The prefixes are pointless, but it's possible, so we exercise it. */
87 /***********************************************/
90 GDB picks a spare register to hold the rip-relative address.
91 Exercise all the possibilities (rax-rdi, sans rsp). */
96 .global test_rip_rax_end
102 add answer(%rip),%rbx
103 .global test_rip_rbx_end
109 add answer(%rip),%rcx
110 .global test_rip_rcx_end
116 add answer(%rip),%rdx
117 .global test_rip_rdx_end
123 add answer(%rip),%rbp
124 .global test_rip_rbp_end
130 add answer(%rip),%rsi
131 .global test_rip_rsi_end
137 add answer(%rip),%rdi
138 .global test_rip_rdi_end
150 /* skip over test data */
153 /* test rip-relative data */
160 /***********************************************/
169 /***********************************************/
171 /* subroutine to help test call/ret */
175 .global test_call_end
183 /***********************************************/
185 /* subroutine to help test abs-jmp/rep-ret */
189 .global test_abs_jmp_end
197 .section .note.GNU-stack,"",@progbits