Automatic Copyright Year update after running gdb/copyright.py
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.arch / i386-disp-step.exp
1 # Copyright 2009-2022 Free Software Foundation, Inc.
2
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.
7 #
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.
12 #
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/>.
15
16 # This file is part of the gdb testsuite.
17
18 # Test i386 displaced stepping.
19
20
21 if { ![is_x86_like_target] } then {
22 verbose "Skipping x86 displaced stepping tests."
23 return
24 }
25
26 standard_testfile .S
27
28 if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
29 return -1
30 }
31
32 gdb_test "set displaced-stepping on" ""
33 gdb_test "show displaced-stepping" ".* displaced stepping .* is on.*"
34
35 if ![runto_main] then {
36 fail "can't run to main"
37 return 0
38 }
39
40 ##########################################
41
42 # Test call/ret.
43
44 gdb_test "break test_call" \
45 "Breakpoint.*at.* file .*$srcfile, line.*" \
46 "break test_call"
47 gdb_test "break test_call_end" \
48 "Breakpoint.*at.* file .*$srcfile, line.*" \
49 "break test_call_end"
50
51 gdb_test "break test_ret" \
52 "Breakpoint.*at.* file .*$srcfile, line.*" \
53 "break test_ret"
54 gdb_test "break test_ret_end" \
55 "Breakpoint.*at.* file .*$srcfile, line.*" \
56 "break test_ret_end"
57
58 gdb_test "continue" \
59 "Continuing.*Breakpoint.*, test_call ().*" \
60 "continue to test_call"
61 gdb_test "continue" \
62 "Continuing.*Breakpoint.*, test_call_end ().*" \
63 "continue to test_call_end"
64
65 gdb_test "continue" \
66 "Continuing.*Breakpoint.*, test_ret ().*" \
67 "continue to test_ret"
68 gdb_test "continue" \
69 "Continuing.*Breakpoint.*, test_ret_end ().*" \
70 "continue to test_ret_end"
71
72 ##########################################
73
74 # Absolute jump with leading prefixes.
75 # These don't occur in normal code, but gdb should still DTRT.
76
77 gdb_test "break test_prefixed_abs_jump" \
78 "Breakpoint.*at.* file .*$srcfile, line.*" \
79 "break test_prefixed_abs_jump"
80 gdb_test "break test_prefixed_abs_jump_end" \
81 "Breakpoint.*at.* file .*$srcfile, line.*" \
82 "break test_prefixed_abs_jump_end"
83
84 gdb_test "continue" \
85 "Continuing.*Breakpoint.*, test_prefixed_abs_jump ().*" \
86 "continue to test_prefixed_abs_jump"
87 gdb_test "continue" \
88 "Continuing.*Breakpoint.*, test_prefixed_abs_jump_end ().*" \
89 "continue to test_prefixed_abs_jump_end"
90
91 ##########################################
92
93 # Test syscall.
94
95 gdb_test "break test_syscall" \
96 "Breakpoint.*at.* file .*$srcfile, line.*" \
97 "break test_syscall"
98 gdb_test "break test_syscall_end" \
99 "Breakpoint.*at.* file .*$srcfile, line.*" \
100 "break test_syscall_end"
101
102 gdb_test "continue" \
103 "Continuing.*Breakpoint.*, test_syscall ().*" \
104 "continue to test_syscall"
105 gdb_test "continue" \
106 "Continuing.*Breakpoint.*, test_syscall_end ().*" \
107 "continue to test_syscall_end"
108
109 ##########################################
110
111 # Test prefixed syscall.
112 # These don't occur in normal code, but gdb should still DTRT.
113
114 gdb_test "break test_prefixed_syscall" \
115 "Breakpoint.*at.* file .*$srcfile, line.*" \
116 "break test_prefixed_syscall"
117 gdb_test "break test_prefixed_syscall_end" \
118 "Breakpoint.*at.* file .*$srcfile, line.*" \
119 "break test_prefixed_syscall_end"
120
121 gdb_test "continue" \
122 "Continuing.*Breakpoint.*, test_prefixed_syscall ().*" \
123 "continue to test_prefixed_syscall"
124 gdb_test "continue" \
125 "Continuing.*Breakpoint.*, test_prefixed_syscall_end ().*" \
126 "continue to test_prefixed_syscall_end"
127
128 ##########################################
129
130 # int3 (with prefixes)
131 # These don't occur in normal code, but gdb should still DTRT.
132
133 gdb_test "break test_int3" \
134 "Breakpoint.*at.* file .*$srcfile, line.*" \
135 "break test_int3"
136 gdb_test "break test_int3_end" \
137 "Breakpoint.*at.* file .*$srcfile, line.*" \
138 "break test_int3_end"
139
140 gdb_test "continue" \
141 "Continuing.*Breakpoint.*, test_int3 ().*" \
142 "continue to test_int3"
143
144 gdb_test "continue" \
145 "Continuing.*Breakpoint.*, test_int3_end ().*" \
146 "continue to test_int3_end"
147
148 ##########################################
149
150 # Done, run program to exit.
151
152 gdb_continue_to_end "i386-disp-step"
This page took 0.033663 seconds and 4 git commands to generate.