-# Copyright 2009, 2010 Free Software Foundation, Inc.
+# Copyright 2009-2024 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# Test i386 displaced stepping.
-if $tracelevel {
- strace $tracelevel
-}
-
-if ![istarget "i?86-*-linux*"] then {
- verbose "Skipping x86 displaced stepping tests."
- return
-}
+require is_x86_like_target
-set testfile "i386-disp-step"
-set srcfile ${testfile}.S
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .S
-set additional_flags "-Wa,-g"
+set opts {}
+lappend opts debug
+lappend opts nopie
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug $additional_flags]] != "" } {
- untested i386-disp-step.exp
+if { [prepare_for_testing "failed to prepare" $testfile $srcfile $opts] } {
return -1
}
-# Get things started.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
gdb_test "set displaced-stepping on" ""
gdb_test "show displaced-stepping" ".* displaced stepping .* is on.*"
-if ![runto_main] then {
- fail "Can't run to main"
+if {![runto_main]} {
return 0
}