1 # Copyright 2009 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.
27 if ![istarget "i?86-*-linux*"] then {
28 verbose "Skipping x86 displaced stepping tests."
32 set testfile "i386-disp-step"
33 set srcfile ${testfile}.S
34 set binfile ${objdir}/${subdir}/${testfile}
36 set additional_flags "-Wa,-g"
38 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug $additional_flags]] != "" } {
39 untested i386-disp-step.exp
47 gdb_reinitialize_dir $srcdir/$subdir
50 gdb_test "set displaced-stepping on" ""
51 gdb_test "show displaced-stepping" ".* displaced stepping .* is on.*"
53 if ![runto_main] then {
54 fail "Can't run to main"
58 ##########################################
62 gdb_test "break test_call" \
63 "Breakpoint.*at.* file .*$srcfile, line.*" \
65 gdb_test "break test_call_end" \
66 "Breakpoint.*at.* file .*$srcfile, line.*" \
69 gdb_test "break test_ret" \
70 "Breakpoint.*at.* file .*$srcfile, line.*" \
72 gdb_test "break test_ret_end" \
73 "Breakpoint.*at.* file .*$srcfile, line.*" \
77 "Continuing.*Breakpoint.*, test_call ().*" \
78 "continue to test_call"
80 "Continuing.*Breakpoint.*, test_call_end ().*" \
81 "continue to test_call_end"
84 "Continuing.*Breakpoint.*, test_ret ().*" \
85 "continue to test_ret"
87 "Continuing.*Breakpoint.*, test_ret_end ().*" \
88 "continue to test_ret_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 # Done, run program to exit.
112 gdb_continue_to_end "i386-disp-step"