1 # Copyright 2009-2023 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.
18 # Test i386 displaced stepping.
21 if {![is_x86_like_target]} {
22 verbose "Skipping x86 displaced stepping tests."
28 if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
32 gdb_test "set displaced-stepping on" ""
33 gdb_test "show displaced-stepping" ".* displaced stepping .* is on.*"
39 ##########################################
43 gdb_test "break test_call" \
44 "Breakpoint.*at.* file .*$srcfile, line.*" \
46 gdb_test "break test_call_end" \
47 "Breakpoint.*at.* file .*$srcfile, line.*" \
50 gdb_test "break test_ret" \
51 "Breakpoint.*at.* file .*$srcfile, line.*" \
53 gdb_test "break test_ret_end" \
54 "Breakpoint.*at.* file .*$srcfile, line.*" \
58 "Continuing.*Breakpoint.*, test_call ().*" \
59 "continue to test_call"
61 "Continuing.*Breakpoint.*, test_call_end ().*" \
62 "continue to test_call_end"
65 "Continuing.*Breakpoint.*, test_ret ().*" \
66 "continue to test_ret"
68 "Continuing.*Breakpoint.*, test_ret_end ().*" \
69 "continue to test_ret_end"
71 ##########################################
73 # Absolute jump with leading prefixes.
74 # These don't occur in normal code, but gdb should still DTRT.
76 gdb_test "break test_prefixed_abs_jump" \
77 "Breakpoint.*at.* file .*$srcfile, line.*" \
78 "break test_prefixed_abs_jump"
79 gdb_test "break test_prefixed_abs_jump_end" \
80 "Breakpoint.*at.* file .*$srcfile, line.*" \
81 "break test_prefixed_abs_jump_end"
84 "Continuing.*Breakpoint.*, test_prefixed_abs_jump ().*" \
85 "continue to test_prefixed_abs_jump"
87 "Continuing.*Breakpoint.*, test_prefixed_abs_jump_end ().*" \
88 "continue to test_prefixed_abs_jump_end"
90 ##########################################
94 gdb_test "break test_syscall" \
95 "Breakpoint.*at.* file .*$srcfile, line.*" \
97 gdb_test "break test_syscall_end" \
98 "Breakpoint.*at.* file .*$srcfile, line.*" \
99 "break test_syscall_end"
101 gdb_test "continue" \
102 "Continuing.*Breakpoint.*, test_syscall ().*" \
103 "continue to test_syscall"
104 gdb_test "continue" \
105 "Continuing.*Breakpoint.*, test_syscall_end ().*" \
106 "continue to test_syscall_end"
108 ##########################################
110 # Test prefixed syscall.
111 # These don't occur in normal code, but gdb should still DTRT.
113 gdb_test "break test_prefixed_syscall" \
114 "Breakpoint.*at.* file .*$srcfile, line.*" \
115 "break test_prefixed_syscall"
116 gdb_test "break test_prefixed_syscall_end" \
117 "Breakpoint.*at.* file .*$srcfile, line.*" \
118 "break test_prefixed_syscall_end"
120 gdb_test "continue" \
121 "Continuing.*Breakpoint.*, test_prefixed_syscall ().*" \
122 "continue to test_prefixed_syscall"
123 gdb_test "continue" \
124 "Continuing.*Breakpoint.*, test_prefixed_syscall_end ().*" \
125 "continue to test_prefixed_syscall_end"
127 ##########################################
129 # int3 (with prefixes)
130 # These don't occur in normal code, but gdb should still DTRT.
132 gdb_test "break test_int3" \
133 "Breakpoint.*at.* file .*$srcfile, line.*" \
135 gdb_test "break test_int3_end" \
136 "Breakpoint.*at.* file .*$srcfile, line.*" \
137 "break test_int3_end"
139 gdb_test "continue" \
140 "Continuing.*Breakpoint.*, test_int3 ().*" \
141 "continue to test_int3"
143 gdb_test "continue" \
144 "Continuing.*Breakpoint.*, test_int3_end ().*" \
145 "continue to test_int3_end"
147 ##########################################
149 # Done, run program to exit.
151 gdb_continue_to_end "i386-disp-step"