aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2021-09-25 09:28:57 +0200
committerTom de Vries <tdevries@suse.de>2021-09-25 09:28:57 +0200
commit98bf5c02cfe9d13428a55c0da8d5f150d7c1fc54 (patch)
treedd14355db3a17a81c81669abf4ad792fb733615e /gdb
parent99d0d99649c12b2bdccaeb788d5d0f0d0dff4d5d (diff)
downloadbinutils-98bf5c02cfe9d13428a55c0da8d5f150d7c1fc54.zip
binutils-98bf5c02cfe9d13428a55c0da8d5f150d7c1fc54.tar.gz
binutils-98bf5c02cfe9d13428a55c0da8d5f150d7c1fc54.tar.bz2
[gdb/testsuite] Minimize gdb restarts
Minimize gdb restarts, applying the following rules: - don't use prepare_for_testing unless necessary - don't use clean_restart unless necessary Also, if possible, replace build_for_executable + clean_restart with prepare_for_testing for brevity. Touches 68 test-cases. Tested on x86_64-linux.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/gdb.arch/amd64-init-x87-values.exp2
-rw-r--r--gdb/testsuite/gdb.base/access-mem-running.exp2
-rw-r--r--gdb/testsuite/gdb.base/attach-pie-noexec.exp1
-rw-r--r--gdb/testsuite/gdb.base/bp-cmds-continue-ctrl-c.exp2
-rw-r--r--gdb/testsuite/gdb.base/bt-selected-frame.exp2
-rw-r--r--gdb/testsuite/gdb.base/catch-syscall.exp1
-rw-r--r--gdb/testsuite/gdb.base/condbreak.exp3
-rw-r--r--gdb/testsuite/gdb.base/cvexpr.exp2
-rw-r--r--gdb/testsuite/gdb.base/dprintf-bp-same-addr.exp2
-rw-r--r--gdb/testsuite/gdb.base/dprintf-detach.exp2
-rw-r--r--gdb/testsuite/gdb.base/duplicate-bp.exp2
-rw-r--r--gdb/testsuite/gdb.base/fork-print-inferior-events.exp2
-rw-r--r--gdb/testsuite/gdb.base/frameapply.exp3
-rw-r--r--gdb/testsuite/gdb.base/gcore-relro-pie.exp2
-rw-r--r--gdb/testsuite/gdb.base/gcore-tls-pie.exp2
-rw-r--r--gdb/testsuite/gdb.base/index-cache.exp2
-rw-r--r--gdb/testsuite/gdb.base/info_minsym.exp2
-rw-r--r--gdb/testsuite/gdb.base/info_qt.exp2
-rw-r--r--gdb/testsuite/gdb.base/killed-outside.exp2
-rw-r--r--gdb/testsuite/gdb.base/list.exp2
-rw-r--r--gdb/testsuite/gdb.base/many-headers.exp2
-rw-r--r--gdb/testsuite/gdb.base/msym-lang.exp2
-rw-r--r--gdb/testsuite/gdb.base/noreturn-finish.exp2
-rw-r--r--gdb/testsuite/gdb.base/noreturn-return.exp2
-rw-r--r--gdb/testsuite/gdb.base/pie-fork.exp2
-rw-r--r--gdb/testsuite/gdb.base/random-signal.exp2
-rw-r--r--gdb/testsuite/gdb.base/reread-readsym.exp3
-rw-r--r--gdb/testsuite/gdb.base/share-env-with-gdbserver.exp2
-rw-r--r--gdb/testsuite/gdb.base/stack-protector.exp2
-rw-r--r--gdb/testsuite/gdb.base/startup-with-shell.exp2
-rw-r--r--gdb/testsuite/gdb.base/step-over-exit.exp2
-rw-r--r--gdb/testsuite/gdb.base/watchpoint-hw-attach.exp2
-rw-r--r--gdb/testsuite/gdb.base/whatis.exp2
-rw-r--r--gdb/testsuite/gdb.cp/cplusfuncs.exp2
-rw-r--r--gdb/testsuite/gdb.cp/rvalue-ref-params.exp2
-rw-r--r--gdb/testsuite/gdb.cp/static-typedef-print.exp2
-rw-r--r--gdb/testsuite/gdb.cp/typedef-base.exp2
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-icycle.exp2
-rw-r--r--gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp8
-rw-r--r--gdb/testsuite/gdb.dwarf2/fission-absolute-dwo.exp4
-rw-r--r--gdb/testsuite/gdb.dwarf2/fission-relative-dwo.exp4
-rw-r--r--gdb/testsuite/gdb.fortran/array-slices.exp2
-rw-r--r--gdb/testsuite/gdb.fortran/nested-funcs-2.exp2
-rw-r--r--gdb/testsuite/gdb.fortran/subarray.exp5
-rw-r--r--gdb/testsuite/gdb.gdb/unittest.exp2
-rw-r--r--gdb/testsuite/gdb.mi/mi-fortran-modules.exp2
-rw-r--r--gdb/testsuite/gdb.mi/mi-info-sources.exp2
-rw-r--r--gdb/testsuite/gdb.mi/mi-linespec-err-cp.exp2
-rw-r--r--gdb/testsuite/gdb.mi/mi-sym-info.exp2
-rw-r--r--gdb/testsuite/gdb.multi/info-threads.exp2
-rw-r--r--gdb/testsuite/gdb.multi/multi-arch.exp4
-rw-r--r--gdb/testsuite/gdb.multi/multi-re-run.exp4
-rw-r--r--gdb/testsuite/gdb.multi/run-only-second-inf.exp2
-rw-r--r--gdb/testsuite/gdb.multi/tids-gid-reset.exp3
-rw-r--r--gdb/testsuite/gdb.multi/tids.exp2
-rw-r--r--gdb/testsuite/gdb.python/py-infthread.exp3
-rw-r--r--gdb/testsuite/gdb.server/connect-stopped-target.exp2
-rw-r--r--gdb/testsuite/gdb.server/exit-multiple-threads.exp2
-rw-r--r--gdb/testsuite/gdb.server/run-without-local-binary.exp2
-rw-r--r--gdb/testsuite/gdb.threads/access-mem-running-thread-exit.exp2
-rw-r--r--gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp5
-rw-r--r--gdb/testsuite/gdb.threads/break-while-running.exp2
-rw-r--r--gdb/testsuite/gdb.threads/clone-attach-detach.exp2
-rw-r--r--gdb/testsuite/gdb.threads/next-bp-other-thread.exp3
-rw-r--r--gdb/testsuite/gdb.threads/signal-sigtrap.exp3
-rw-r--r--gdb/testsuite/gdb.threads/step-bg-decr-pc-switch-thread.exp2
-rw-r--r--gdb/testsuite/gdb.threads/tid-reuse.exp2
-rw-r--r--gdb/testsuite/gdb.trace/qtro.exp1
68 files changed, 45 insertions, 115 deletions
diff --git a/gdb/testsuite/gdb.arch/amd64-init-x87-values.exp b/gdb/testsuite/gdb.arch/amd64-init-x87-values.exp
index 9ec5c17..1a74869 100644
--- a/gdb/testsuite/gdb.arch/amd64-init-x87-values.exp
+++ b/gdb/testsuite/gdb.arch/amd64-init-x87-values.exp
@@ -27,7 +27,7 @@ standard_testfile .S
set options [list debug \
additional_flags=-static \
additional_flags=-nostartfiles]
-if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $options] } {
+if { [build_executable "failed to prepare" ${testfile} ${srcfile} $options] } {
return -1
}
diff --git a/gdb/testsuite/gdb.base/access-mem-running.exp b/gdb/testsuite/gdb.base/access-mem-running.exp
index 6990d90..9dec5bc 100644
--- a/gdb/testsuite/gdb.base/access-mem-running.exp
+++ b/gdb/testsuite/gdb.base/access-mem-running.exp
@@ -17,7 +17,7 @@
standard_testfile
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug}] == -1} {
+if {[build_executable "failed to prepare" $testfile $srcfile {debug}] == -1} {
return -1
}
diff --git a/gdb/testsuite/gdb.base/attach-pie-noexec.exp b/gdb/testsuite/gdb.base/attach-pie-noexec.exp
index ae3d0bc..85161fa 100644
--- a/gdb/testsuite/gdb.base/attach-pie-noexec.exp
+++ b/gdb/testsuite/gdb.base/attach-pie-noexec.exp
@@ -24,7 +24,6 @@ if { [prepare_for_testing "failed to prepare" $executable "" [list debug pie]] }
return -1
}
-clean_restart $executable
set arch ""
set test "show architecture"
gdb_test_multiple $test $test {
diff --git a/gdb/testsuite/gdb.base/bp-cmds-continue-ctrl-c.exp b/gdb/testsuite/gdb.base/bp-cmds-continue-ctrl-c.exp
index d21f580a..c0c1fa2 100644
--- a/gdb/testsuite/gdb.base/bp-cmds-continue-ctrl-c.exp
+++ b/gdb/testsuite/gdb.base/bp-cmds-continue-ctrl-c.exp
@@ -32,7 +32,7 @@ if [target_info exists gdb,nointerrupts] {
standard_testfile
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
+if {[build_executable "failed to prepare" $testfile $srcfile debug]} {
return -1
}
diff --git a/gdb/testsuite/gdb.base/bt-selected-frame.exp b/gdb/testsuite/gdb.base/bt-selected-frame.exp
index ed1a048..c454f4c 100644
--- a/gdb/testsuite/gdb.base/bt-selected-frame.exp
+++ b/gdb/testsuite/gdb.base/bt-selected-frame.exp
@@ -17,7 +17,7 @@
standard_testfile
-if { [prepare_for_testing "failed to prepare" $testfile $srcfile debug] } {
+if { [build_executable "failed to prepare" $testfile $srcfile debug] } {
return -1
}
diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp
index a92730c..d7183d1 100644
--- a/gdb/testsuite/gdb.base/catch-syscall.exp
+++ b/gdb/testsuite/gdb.base/catch-syscall.exp
@@ -26,7 +26,6 @@ if { [prepare_for_testing "failed to prepare" $testfile ${testfile}.c] } {
}
# Check target supports catch syscall or not.
-clean_restart $binfile
if ![runto_main] then {
fail "can't run to main"
return
diff --git a/gdb/testsuite/gdb.base/condbreak.exp b/gdb/testsuite/gdb.base/condbreak.exp
index 3fd0f07..5bcc7e7 100644
--- a/gdb/testsuite/gdb.base/condbreak.exp
+++ b/gdb/testsuite/gdb.base/condbreak.exp
@@ -32,9 +32,6 @@ if [get_compiler_info] {
return -1
}
-clean_restart ${binfile}
-
-
set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
set bp_location6 [gdb_get_line_number "set breakpoint 6 here"]
set bp_location8 [gdb_get_line_number "set breakpoint 8 here" $srcfile2]
diff --git a/gdb/testsuite/gdb.base/cvexpr.exp b/gdb/testsuite/gdb.base/cvexpr.exp
index 6048699..c434c11 100644
--- a/gdb/testsuite/gdb.base/cvexpr.exp
+++ b/gdb/testsuite/gdb.base/cvexpr.exp
@@ -31,8 +31,6 @@ proc do_test {dir options} {
return 0
}
- clean_restart ${binfile}
-
gdb_test_no_output "set print sevenbit-strings"
gdb_test_no_output "set print address off"
gdb_test_no_output "set width 0"
diff --git a/gdb/testsuite/gdb.base/dprintf-bp-same-addr.exp b/gdb/testsuite/gdb.base/dprintf-bp-same-addr.exp
index 11fa710..58a5560 100644
--- a/gdb/testsuite/gdb.base/dprintf-bp-same-addr.exp
+++ b/gdb/testsuite/gdb.base/dprintf-bp-same-addr.exp
@@ -17,7 +17,7 @@
standard_testfile
-if [prepare_for_testing "failed to prepare" \
+if [build_executable "failed to prepare" \
${testfile} ${srcfile} {debug}] {
return -1
}
diff --git a/gdb/testsuite/gdb.base/dprintf-detach.exp b/gdb/testsuite/gdb.base/dprintf-detach.exp
index 1a94d26..aa06a5b 100644
--- a/gdb/testsuite/gdb.base/dprintf-detach.exp
+++ b/gdb/testsuite/gdb.base/dprintf-detach.exp
@@ -28,7 +28,7 @@ if { [use_gdb_stub] } then {
standard_testfile
set escapedbinfile [string_to_regexp ${binfile}]
-if [prepare_for_testing "failed to prepare for dprintf-detach" \
+if [build_executable "failed to prepare for dprintf-detach" \
${testfile} ${srcfile} {debug}] {
return -1
}
diff --git a/gdb/testsuite/gdb.base/duplicate-bp.exp b/gdb/testsuite/gdb.base/duplicate-bp.exp
index 77fa160..5516925 100644
--- a/gdb/testsuite/gdb.base/duplicate-bp.exp
+++ b/gdb/testsuite/gdb.base/duplicate-bp.exp
@@ -15,7 +15,7 @@
standard_testfile
-if { [prepare_for_testing "failed to prepare" ${testfile}] } {
+if { [build_executable "failed to prepare" ${testfile}] } {
return -1
}
diff --git a/gdb/testsuite/gdb.base/fork-print-inferior-events.exp b/gdb/testsuite/gdb.base/fork-print-inferior-events.exp
index eda0f50..051aeb7 100644
--- a/gdb/testsuite/gdb.base/fork-print-inferior-events.exp
+++ b/gdb/testsuite/gdb.base/fork-print-inferior-events.exp
@@ -34,7 +34,7 @@ if [gdb_debug_enabled] {
standard_testfile
-if { [prepare_for_testing "failed to prepare" $testfile $srcfile debug] } {
+if { [build_executable "failed to prepare" $testfile $srcfile debug] } {
return -1
}
diff --git a/gdb/testsuite/gdb.base/frameapply.exp b/gdb/testsuite/gdb.base/frameapply.exp
index 1c58000..346d229 100644
--- a/gdb/testsuite/gdb.base/frameapply.exp
+++ b/gdb/testsuite/gdb.base/frameapply.exp
@@ -24,9 +24,6 @@ if { [prepare_for_testing "failed to prepare" ${testfile}] } {
return -1
}
-clean_restart ${binfile}
-
-
if ![runto setup_done] then {
fail "can't run to setup_done"
return 0
diff --git a/gdb/testsuite/gdb.base/gcore-relro-pie.exp b/gdb/testsuite/gdb.base/gcore-relro-pie.exp
index 39142fe..6c2bfc3 100644
--- a/gdb/testsuite/gdb.base/gcore-relro-pie.exp
+++ b/gdb/testsuite/gdb.base/gcore-relro-pie.exp
@@ -19,7 +19,7 @@
standard_testfile
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
+if {[build_executable "failed to prepare" $testfile $srcfile \
{debug pie "ldflags=-Wl,-z,relro"}]} {
return -1
}
diff --git a/gdb/testsuite/gdb.base/gcore-tls-pie.exp b/gdb/testsuite/gdb.base/gcore-tls-pie.exp
index e514c42..bb635cb 100644
--- a/gdb/testsuite/gdb.base/gcore-tls-pie.exp
+++ b/gdb/testsuite/gdb.base/gcore-tls-pie.exp
@@ -23,7 +23,7 @@ if { [have_fuse_ld_gold] == 0} {
return -1
}
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
+if {[build_executable "failed to prepare" $testfile $srcfile \
{debug pie "ldflags=-fuse-ld=gold"}]} {
return -1
}
diff --git a/gdb/testsuite/gdb.base/index-cache.exp b/gdb/testsuite/gdb.base/index-cache.exp
index 496145e..8dd35ad 100644
--- a/gdb/testsuite/gdb.base/index-cache.exp
+++ b/gdb/testsuite/gdb.base/index-cache.exp
@@ -18,7 +18,7 @@
standard_testfile
-if { [prepare_for_testing "failed to prepare" $testfile $srcfile \
+if { [build_executable "failed to prepare" $testfile $srcfile \
{debug additional_flags=-Wl,--build-id}] } {
return
}
diff --git a/gdb/testsuite/gdb.base/info_minsym.exp b/gdb/testsuite/gdb.base/info_minsym.exp
index 7353bcf..fe3f4c5 100644
--- a/gdb/testsuite/gdb.base/info_minsym.exp
+++ b/gdb/testsuite/gdb.base/info_minsym.exp
@@ -27,8 +27,6 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {c}]} {
return -1
}
-clean_restart ${testfile}
-
gdb_test_no_output "info variables -q -t int minsym" \
"minsym variables do not match type"
gdb_test_no_output "info functions -q -t int minsym" \
diff --git a/gdb/testsuite/gdb.base/info_qt.exp b/gdb/testsuite/gdb.base/info_qt.exp
index 3f6e142..c6f242b 100644
--- a/gdb/testsuite/gdb.base/info_qt.exp
+++ b/gdb/testsuite/gdb.base/info_qt.exp
@@ -27,8 +27,6 @@ if { [prepare_for_testing "failed to prepare" ${testfile}] } {
return -1
}
-clean_restart ${binfile}
-
if ![runto setup_done] then {
fail "can't run to setup_done"
return 0
diff --git a/gdb/testsuite/gdb.base/killed-outside.exp b/gdb/testsuite/gdb.base/killed-outside.exp
index 3c5ce25..0e14d5a 100644
--- a/gdb/testsuite/gdb.base/killed-outside.exp
+++ b/gdb/testsuite/gdb.base/killed-outside.exp
@@ -80,7 +80,7 @@ proc test {cmds_after_kill} {
}
}
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile] == -1} {
+if {[build_executable "failed to prepare" $testfile $srcfile] == -1} {
return -1
}
diff --git a/gdb/testsuite/gdb.base/list.exp b/gdb/testsuite/gdb.base/list.exp
index 672c26a..6844b87 100644
--- a/gdb/testsuite/gdb.base/list.exp
+++ b/gdb/testsuite/gdb.base/list.exp
@@ -21,7 +21,7 @@ standard_testfile list0.c list1.c
# Need to download the header to the host.
gdb_remote_download host ${srcdir}/${subdir}/list0.h
-if {[prepare_for_testing "failed to prepare" $testfile [list $srcfile $srcfile2] \
+if {[build_executable "failed to prepare" $testfile [list $srcfile $srcfile2] \
{debug}]} {
return -1
}
diff --git a/gdb/testsuite/gdb.base/many-headers.exp b/gdb/testsuite/gdb.base/many-headers.exp
index 100c3e6..cc25b2e 100644
--- a/gdb/testsuite/gdb.base/many-headers.exp
+++ b/gdb/testsuite/gdb.base/many-headers.exp
@@ -26,7 +26,7 @@ if { [target_info gdb_protocol] != "" } {
standard_testfile
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
+if {[build_executable "failed to prepare" $testfile $srcfile debug]} {
return -1
}
diff --git a/gdb/testsuite/gdb.base/msym-lang.exp b/gdb/testsuite/gdb.base/msym-lang.exp
index 4b67986..72f817e 100644
--- a/gdb/testsuite/gdb.base/msym-lang.exp
+++ b/gdb/testsuite/gdb.base/msym-lang.exp
@@ -20,6 +20,4 @@ if {[prepare_for_testing "failed to prepare" $testfile [list $srcfile $srcfile2]
return -1
}
-clean_restart ${testfile}
-
gdb_test "info func foo" ".* foo\\(\\).* foo\\(\\).*"
diff --git a/gdb/testsuite/gdb.base/noreturn-finish.exp b/gdb/testsuite/gdb.base/noreturn-finish.exp
index 16e0439..34db7c0 100644
--- a/gdb/testsuite/gdb.base/noreturn-finish.exp
+++ b/gdb/testsuite/gdb.base/noreturn-finish.exp
@@ -46,6 +46,4 @@ proc noreturn_finish_test { } {
}
}
-clean_restart ${binfile}
-
noreturn_finish_test
diff --git a/gdb/testsuite/gdb.base/noreturn-return.exp b/gdb/testsuite/gdb.base/noreturn-return.exp
index 228625f..2942239 100644
--- a/gdb/testsuite/gdb.base/noreturn-return.exp
+++ b/gdb/testsuite/gdb.base/noreturn-return.exp
@@ -46,6 +46,4 @@ proc noreturn_test { } {
}
}
-clean_restart ${binfile}
-
noreturn_test
diff --git a/gdb/testsuite/gdb.base/pie-fork.exp b/gdb/testsuite/gdb.base/pie-fork.exp
index d093c19..5ab6521 100644
--- a/gdb/testsuite/gdb.base/pie-fork.exp
+++ b/gdb/testsuite/gdb.base/pie-fork.exp
@@ -20,7 +20,7 @@ standard_testfile
set opts [list debug pie]
-if [prepare_for_testing "failed to prepare" $testfile $srcfile $opts] {
+if [build_executable "failed to prepare" $testfile $srcfile $opts] {
return
}
diff --git a/gdb/testsuite/gdb.base/random-signal.exp b/gdb/testsuite/gdb.base/random-signal.exp
index 8511e83..b3d04a9 100644
--- a/gdb/testsuite/gdb.base/random-signal.exp
+++ b/gdb/testsuite/gdb.base/random-signal.exp
@@ -26,7 +26,7 @@ if [target_info exists gdb,nointerrupts] {
standard_testfile
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
+if {[build_executable "failed to prepare" $testfile $srcfile debug]} {
return -1
}
diff --git a/gdb/testsuite/gdb.base/reread-readsym.exp b/gdb/testsuite/gdb.base/reread-readsym.exp
index 673e566..597e46a 100644
--- a/gdb/testsuite/gdb.base/reread-readsym.exp
+++ b/gdb/testsuite/gdb.base/reread-readsym.exp
@@ -46,9 +46,6 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
return -1
}
-# Start with a fresh gdb.
-clean_restart ${testfile}
-
# Using the source command to read commands from a file is important,
# otherwise section data is freed and reallocated using the same
# memory locations and the bug is not exposed.
diff --git a/gdb/testsuite/gdb.base/share-env-with-gdbserver.exp b/gdb/testsuite/gdb.base/share-env-with-gdbserver.exp
index 261a51e..e848f27 100644
--- a/gdb/testsuite/gdb.base/share-env-with-gdbserver.exp
+++ b/gdb/testsuite/gdb.base/share-env-with-gdbserver.exp
@@ -23,7 +23,7 @@ if { [use_gdb_stub] } {
standard_testfile
-if { [prepare_for_testing "failed to prepare" $testfile $srcfile debug] } {
+if { [build_executable "failed to prepare" $testfile $srcfile debug] } {
return -1
}
diff --git a/gdb/testsuite/gdb.base/stack-protector.exp b/gdb/testsuite/gdb.base/stack-protector.exp
index f042630..5181ce8 100644
--- a/gdb/testsuite/gdb.base/stack-protector.exp
+++ b/gdb/testsuite/gdb.base/stack-protector.exp
@@ -44,8 +44,6 @@ proc simple_func_break_test { protection } {
return -1
}
- clean_restart ${binfile}
-
if { ![runto_main] } then {
fail "can't run to main"
return -1
diff --git a/gdb/testsuite/gdb.base/startup-with-shell.exp b/gdb/testsuite/gdb.base/startup-with-shell.exp
index 8662b89..a78ad53 100644
--- a/gdb/testsuite/gdb.base/startup-with-shell.exp
+++ b/gdb/testsuite/gdb.base/startup-with-shell.exp
@@ -30,7 +30,7 @@ if { [is_remote target] } {
standard_testfile
-if { [prepare_for_testing "failed to prepare" $testfile $srcfile debug] } {
+if { [build_executable "failed to prepare" $testfile $srcfile debug] } {
return -1
}
diff --git a/gdb/testsuite/gdb.base/step-over-exit.exp b/gdb/testsuite/gdb.base/step-over-exit.exp
index ff9666b..d9a47d3 100644
--- a/gdb/testsuite/gdb.base/step-over-exit.exp
+++ b/gdb/testsuite/gdb.base/step-over-exit.exp
@@ -35,8 +35,6 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
return -1
}
-# Start with a fresh gdb.
-clean_restart ${testfile}
if ![runto_main] {
fail "can't run to main"
return -1
diff --git a/gdb/testsuite/gdb.base/watchpoint-hw-attach.exp b/gdb/testsuite/gdb.base/watchpoint-hw-attach.exp
index 270bc6c..33adda7 100644
--- a/gdb/testsuite/gdb.base/watchpoint-hw-attach.exp
+++ b/gdb/testsuite/gdb.base/watchpoint-hw-attach.exp
@@ -30,8 +30,6 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
return -1
}
-clean_restart $binfile
-
if ![runto_main] {
untested "can't run to main"
return -1
diff --git a/gdb/testsuite/gdb.base/whatis.exp b/gdb/testsuite/gdb.base/whatis.exp
index ddeb031..90baf3e 100644
--- a/gdb/testsuite/gdb.base/whatis.exp
+++ b/gdb/testsuite/gdb.base/whatis.exp
@@ -51,8 +51,6 @@ proc do_test {dir options} {
return 0
}
- clean_restart ${binfile}
-
#
# Test whatis command with basic C types
#
diff --git a/gdb/testsuite/gdb.cp/cplusfuncs.exp b/gdb/testsuite/gdb.cp/cplusfuncs.exp
index 7374015..7d021a7 100644
--- a/gdb/testsuite/gdb.cp/cplusfuncs.exp
+++ b/gdb/testsuite/gdb.cp/cplusfuncs.exp
@@ -581,8 +581,6 @@ proc do_tests {} {
global binfile
global dm_type_int_star
- clean_restart $binfile
-
gdb_test_no_output "set width 0"
runto_main
diff --git a/gdb/testsuite/gdb.cp/rvalue-ref-params.exp b/gdb/testsuite/gdb.cp/rvalue-ref-params.exp
index 1fd3edb..e806662 100644
--- a/gdb/testsuite/gdb.cp/rvalue-ref-params.exp
+++ b/gdb/testsuite/gdb.cp/rvalue-ref-params.exp
@@ -20,7 +20,7 @@ if {[skip_cplus_tests]} { continue }
standard_testfile .cc
-if {[prepare_for_testing $testfile.exp $testfile $srcfile \
+if {[build_executable $testfile.exp $testfile $srcfile \
{debug c++ additional_flags="-std=gnu++11"}] == -1} {
return -1
}
diff --git a/gdb/testsuite/gdb.cp/static-typedef-print.exp b/gdb/testsuite/gdb.cp/static-typedef-print.exp
index 5a6cdbd..3c8e286a 100644
--- a/gdb/testsuite/gdb.cp/static-typedef-print.exp
+++ b/gdb/testsuite/gdb.cp/static-typedef-print.exp
@@ -25,8 +25,6 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
return -1
}
-clean_restart $testfile
-
if ![runto_main] {
untested "could not run to main"
return -1
diff --git a/gdb/testsuite/gdb.cp/typedef-base.exp b/gdb/testsuite/gdb.cp/typedef-base.exp
index 8376e19..7edc164 100644
--- a/gdb/testsuite/gdb.cp/typedef-base.exp
+++ b/gdb/testsuite/gdb.cp/typedef-base.exp
@@ -27,8 +27,6 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
return -1
}
-clean_restart $testfile
-
if ![runto_main] {
untested "could not run to main"
return -1
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-icycle.exp b/gdb/testsuite/gdb.dwarf2/dw2-icycle.exp
index bfe6a9c..9351985 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-icycle.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-icycle.exp
@@ -24,7 +24,7 @@ if {![dwarf2_support]} {
standard_testfile .S main.c
-if { [prepare_for_testing "failed to prepare" ${testfile} \
+if { [build_executable "failed to prepare" ${testfile} \
[list $srcfile $srcfile2] {nodebug}] } {
return -1
}
diff --git a/gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp b/gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp
index 3cf6b07..dab19d0 100644
--- a/gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp
+++ b/gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp
@@ -27,12 +27,6 @@ standard_testfile main.c .S
set executable ${testfile}
set asm_file [standard_output_file ${srcfile2}]
-# We need to know the size of integer types in order to write some of the
-# debugging info we'd like to generate.
-if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] {
- return -1
-}
-
# Create the DWARF.
Dwarf::assemble $asm_file {
global srcdir subdir srcfile
@@ -83,8 +77,6 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
return -1
}
-clean_restart ${binfile}
-
# Expand cu1. This will enqueue cu2.
gdb_test "ptype foo" "type = int"
diff --git a/gdb/testsuite/gdb.dwarf2/fission-absolute-dwo.exp b/gdb/testsuite/gdb.dwarf2/fission-absolute-dwo.exp
index 2483349..082a09d 100644
--- a/gdb/testsuite/gdb.dwarf2/fission-absolute-dwo.exp
+++ b/gdb/testsuite/gdb.dwarf2/fission-absolute-dwo.exp
@@ -27,10 +27,6 @@ if {![dwarf2_support]} {
standard_testfile .c -dw.S
-if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
- return -1
-}
-
set asm_file [standard_output_file $srcfile2]
Dwarf::assemble $asm_file {
global srcfile binfile objdir
diff --git a/gdb/testsuite/gdb.dwarf2/fission-relative-dwo.exp b/gdb/testsuite/gdb.dwarf2/fission-relative-dwo.exp
index 566d756..8faa6ea 100644
--- a/gdb/testsuite/gdb.dwarf2/fission-relative-dwo.exp
+++ b/gdb/testsuite/gdb.dwarf2/fission-relative-dwo.exp
@@ -25,10 +25,6 @@ if {![dwarf2_support]} {
standard_testfile .c -dw.S
-if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
- return -1
-}
-
set asm_file [standard_output_file $srcfile2]
Dwarf::assemble $asm_file {
global srcfile gdb_test_file_name
diff --git a/gdb/testsuite/gdb.fortran/array-slices.exp b/gdb/testsuite/gdb.fortran/array-slices.exp
index f9671ec..8200a0c 100644
--- a/gdb/testsuite/gdb.fortran/array-slices.exp
+++ b/gdb/testsuite/gdb.fortran/array-slices.exp
@@ -38,7 +38,7 @@ if {[skip_fortran_tests]} { return -1 }
standard_testfile ".f90"
load_lib fortran.exp
-if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
+if {[build_executable ${testfile}.exp ${testfile} ${srcfile} \
{debug f90}]} {
return -1
}
diff --git a/gdb/testsuite/gdb.fortran/nested-funcs-2.exp b/gdb/testsuite/gdb.fortran/nested-funcs-2.exp
index 9ab3ee5..f679529 100644
--- a/gdb/testsuite/gdb.fortran/nested-funcs-2.exp
+++ b/gdb/testsuite/gdb.fortran/nested-funcs-2.exp
@@ -20,7 +20,7 @@ load_lib "fortran.exp"
standard_testfile ".f90"
-if {[prepare_for_testing ${testfile}.exp ${testfile} \
+if {[build_executable ${testfile}.exp ${testfile} \
${srcfile} {debug f90}]} {
return -1
}
diff --git a/gdb/testsuite/gdb.fortran/subarray.exp b/gdb/testsuite/gdb.fortran/subarray.exp
index 8c7d5a9..d41443a 100644
--- a/gdb/testsuite/gdb.fortran/subarray.exp
+++ b/gdb/testsuite/gdb.fortran/subarray.exp
@@ -27,11 +27,6 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} {
return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
if ![fortran_runto_main] then {
perror "couldn't run to main"
continue
diff --git a/gdb/testsuite/gdb.gdb/unittest.exp b/gdb/testsuite/gdb.gdb/unittest.exp
index 3622243..670205f 100644
--- a/gdb/testsuite/gdb.gdb/unittest.exp
+++ b/gdb/testsuite/gdb.gdb/unittest.exp
@@ -24,7 +24,7 @@ set do_xml_test [expr ![gdb_skip_xml_test]]
standard_testfile
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
+if {[build_executable "failed to prepare" $testfile $srcfile debug]} {
return -1
}
diff --git a/gdb/testsuite/gdb.mi/mi-fortran-modules.exp b/gdb/testsuite/gdb.mi/mi-fortran-modules.exp
index 0606995..fc1fa41 100644
--- a/gdb/testsuite/gdb.mi/mi-fortran-modules.exp
+++ b/gdb/testsuite/gdb.mi/mi-fortran-modules.exp
@@ -23,7 +23,7 @@ set MIFLAGS "-i=mi"
standard_testfile "mi-fortran-modules.f90" "mi-fortran-modules-2.f90"
-if {[prepare_for_testing "failed to prepare" ${testfile} \
+if {[build_executable "failed to prepare" ${testfile} \
[list $srcfile2 $srcfile] {debug f90}]} {
return -1
}
diff --git a/gdb/testsuite/gdb.mi/mi-info-sources.exp b/gdb/testsuite/gdb.mi/mi-info-sources.exp
index a43e939..7451af6 100644
--- a/gdb/testsuite/gdb.mi/mi-info-sources.exp
+++ b/gdb/testsuite/gdb.mi/mi-info-sources.exp
@@ -20,7 +20,7 @@ set MIFLAGS "-i=mi"
standard_testfile .c -base.c
-if {[prepare_for_testing $testfile.exp $testfile \
+if {[build_executable $testfile.exp $testfile \
[list $srcfile $srcfile2] debug]} {
untested $testfile.exp
return -1
diff --git a/gdb/testsuite/gdb.mi/mi-linespec-err-cp.exp b/gdb/testsuite/gdb.mi/mi-linespec-err-cp.exp
index 4f7150b..dacbdd8 100644
--- a/gdb/testsuite/gdb.mi/mi-linespec-err-cp.exp
+++ b/gdb/testsuite/gdb.mi/mi-linespec-err-cp.exp
@@ -27,7 +27,7 @@ set MIFLAGS "-i=mi"
standard_testfile .cc
set exefile $testfile
-if {[prepare_for_testing "failed to prepare" $exefile $srcfile {debug c++}]} {
+if {[build_executable "failed to prepare" $exefile $srcfile {debug c++}]} {
return -1
}
diff --git a/gdb/testsuite/gdb.mi/mi-sym-info.exp b/gdb/testsuite/gdb.mi/mi-sym-info.exp
index dfe23ec..5eb7201 100644
--- a/gdb/testsuite/gdb.mi/mi-sym-info.exp
+++ b/gdb/testsuite/gdb.mi/mi-sym-info.exp
@@ -28,7 +28,7 @@ set MIFLAGS "-i=mi"
standard_testfile mi-sym-info-1.c mi-sym-info-2.c
-if {[prepare_for_testing "failed to prepare" ${testfile} \
+if {[build_executable "failed to prepare" ${testfile} \
[list $srcfile $srcfile2] {debug}]} {
return -1
}
diff --git a/gdb/testsuite/gdb.multi/info-threads.exp b/gdb/testsuite/gdb.multi/info-threads.exp
index 8ebd03b..cc8b22a 100644
--- a/gdb/testsuite/gdb.multi/info-threads.exp
+++ b/gdb/testsuite/gdb.multi/info-threads.exp
@@ -24,8 +24,6 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {pthreads d
return -1
}
-clean_restart ${testfile}
-
if { ![runto_main] } then {
return -1
}
diff --git a/gdb/testsuite/gdb.multi/multi-arch.exp b/gdb/testsuite/gdb.multi/multi-arch.exp
index e859282..c1c7791 100644
--- a/gdb/testsuite/gdb.multi/multi-arch.exp
+++ b/gdb/testsuite/gdb.multi/multi-arch.exp
@@ -52,7 +52,7 @@ if [istarget "s390*-*-*"] {
set march2 "-m32"
}
-if { [prepare_for_testing "failed to prepare" ${exec1} "${srcfile1}" \
+if { [build_executable "failed to prepare" ${exec1} "${srcfile1}" \
[list debug additional_flags=${march1}]] } {
return -1
}
@@ -70,7 +70,7 @@ if [istarget "aarch64*-*-*"] {
lappend options "additional_flags=${march2}"
}
-if { [prepare_for_testing "failed to prepare" ${exec2} "${srcfile2}" \
+if { [build_executable "failed to prepare" ${exec2} "${srcfile2}" \
$options]} {
return -1
}
diff --git a/gdb/testsuite/gdb.multi/multi-re-run.exp b/gdb/testsuite/gdb.multi/multi-re-run.exp
index 8bf126e..6eda6fa 100644
--- a/gdb/testsuite/gdb.multi/multi-re-run.exp
+++ b/gdb/testsuite/gdb.multi/multi-re-run.exp
@@ -31,14 +31,14 @@ set srcfile2 multi-re-run-2.c
set binfile2 [standard_output_file ${exec2}]
with_test_prefix "exec1" {
- if { [prepare_for_testing "failed to prepare" ${exec1} "${srcfile1}" \
+ if { [build_executable "failed to prepare" ${exec1} "${srcfile1}" \
[list pthreads debug]] } {
return -1
}
}
with_test_prefix "exec2" {
- if { [prepare_for_testing "failed to prepare" ${exec2} "${srcfile2}" \
+ if { [build_executable "failed to prepare" ${exec2} "${srcfile2}" \
[list pthreads debug]] } {
return -1
}
diff --git a/gdb/testsuite/gdb.multi/run-only-second-inf.exp b/gdb/testsuite/gdb.multi/run-only-second-inf.exp
index e5d1249..69ff07b 100644
--- a/gdb/testsuite/gdb.multi/run-only-second-inf.exp
+++ b/gdb/testsuite/gdb.multi/run-only-second-inf.exp
@@ -24,7 +24,7 @@ if {[use_gdb_stub]} {
return 0
}
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug}]} {
+if {[build_executable "failed to prepare" $testfile $srcfile {debug}]} {
return -1
}
diff --git a/gdb/testsuite/gdb.multi/tids-gid-reset.exp b/gdb/testsuite/gdb.multi/tids-gid-reset.exp
index d8dac7c..e1755f9 100644
--- a/gdb/testsuite/gdb.multi/tids-gid-reset.exp
+++ b/gdb/testsuite/gdb.multi/tids-gid-reset.exp
@@ -22,7 +22,8 @@
standard_testfile
-if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {pthreads debug}] } {
+if { [build_executable "failed to prepare" ${testfile} ${srcfile} \
+ {pthreads debug}] } {
return -1
}
diff --git a/gdb/testsuite/gdb.multi/tids.exp b/gdb/testsuite/gdb.multi/tids.exp
index f1d6db6..1bf04c5 100644
--- a/gdb/testsuite/gdb.multi/tids.exp
+++ b/gdb/testsuite/gdb.multi/tids.exp
@@ -31,8 +31,6 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {pthreads d
return -1
}
-clean_restart ${testfile}
-
if { ![runto_main] } then {
return -1
}
diff --git a/gdb/testsuite/gdb.python/py-infthread.exp b/gdb/testsuite/gdb.python/py-infthread.exp
index aa0b802..e68986b 100644
--- a/gdb/testsuite/gdb.python/py-infthread.exp
+++ b/gdb/testsuite/gdb.python/py-infthread.exp
@@ -24,9 +24,6 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
return -1
}
-# Start with a fresh gdb.
-clean_restart ${testfile}
-
# Skip all tests if Python scripting is not enabled.
if { [skip_python_tests] } { continue }
diff --git a/gdb/testsuite/gdb.server/connect-stopped-target.exp b/gdb/testsuite/gdb.server/connect-stopped-target.exp
index 06a4e98..bab3b88 100644
--- a/gdb/testsuite/gdb.server/connect-stopped-target.exp
+++ b/gdb/testsuite/gdb.server/connect-stopped-target.exp
@@ -27,7 +27,7 @@ if {[skip_gdbserver_tests]} {
standard_testfile
set executable ${testfile}
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
+if {[build_executable "failed to prepare" $testfile $srcfile debug]} {
return -1
}
diff --git a/gdb/testsuite/gdb.server/exit-multiple-threads.exp b/gdb/testsuite/gdb.server/exit-multiple-threads.exp
index a74f7d1..27c09b2 100644
--- a/gdb/testsuite/gdb.server/exit-multiple-threads.exp
+++ b/gdb/testsuite/gdb.server/exit-multiple-threads.exp
@@ -135,7 +135,7 @@ foreach_with_prefix test { exit signal } {
set func "run_${test}_test"
set executable "$binfile-${test}"
- if [prepare_for_testing "failed to prepare" $executable $srcfile \
+ if [build_executable "failed to prepare" $executable $srcfile \
[list debug pthreads additional_flags=-D${def}]] {
return -1
}
diff --git a/gdb/testsuite/gdb.server/run-without-local-binary.exp b/gdb/testsuite/gdb.server/run-without-local-binary.exp
index 395eddc..7c96c9b 100644
--- a/gdb/testsuite/gdb.server/run-without-local-binary.exp
+++ b/gdb/testsuite/gdb.server/run-without-local-binary.exp
@@ -21,7 +21,7 @@ if {[skip_gdbserver_tests]} {
standard_testfile normal.c
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
+if {[build_executable "failed to prepare" $testfile $srcfile debug]} {
return -1
}
diff --git a/gdb/testsuite/gdb.threads/access-mem-running-thread-exit.exp b/gdb/testsuite/gdb.threads/access-mem-running-thread-exit.exp
index ea228e4..b2fef9f 100644
--- a/gdb/testsuite/gdb.threads/access-mem-running-thread-exit.exp
+++ b/gdb/testsuite/gdb.threads/access-mem-running-thread-exit.exp
@@ -35,7 +35,7 @@
standard_testfile
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug pthreads}] == -1} {
+if {[build_executable "failed to prepare" $testfile $srcfile {debug pthreads}] == -1} {
return -1
}
diff --git a/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp b/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp
index cb63257..255e483 100644
--- a/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp
+++ b/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp
@@ -62,8 +62,6 @@ proc test {} {
global gdb_prompt
global decimal
- clean_restart ${binfile}
-
set test_spawn_id [spawn_wait_for_attach $binfile]
set testpid [spawn_id_get_pid $test_spawn_id]
@@ -170,7 +168,8 @@ proc test {} {
# failure.
set options { "additional_flags=-DTIMEOUT=$timeout" debug pthreads }
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile $options] == -1} {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
+ $options] == -1} {
return -1
}
diff --git a/gdb/testsuite/gdb.threads/break-while-running.exp b/gdb/testsuite/gdb.threads/break-while-running.exp
index 68d9bf8..de39824 100644
--- a/gdb/testsuite/gdb.threads/break-while-running.exp
+++ b/gdb/testsuite/gdb.threads/break-while-running.exp
@@ -24,7 +24,7 @@
standard_testfile
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug pthreads}] == -1} {
+if {[build_executable "failed to prepare" $testfile $srcfile {debug pthreads}] == -1} {
return -1
}
diff --git a/gdb/testsuite/gdb.threads/clone-attach-detach.exp b/gdb/testsuite/gdb.threads/clone-attach-detach.exp
index 4c6813b..2232857 100644
--- a/gdb/testsuite/gdb.threads/clone-attach-detach.exp
+++ b/gdb/testsuite/gdb.threads/clone-attach-detach.exp
@@ -33,8 +33,6 @@ if [prepare_for_testing "failed to prepare" $testfile $srcfile {debug}] {
return -1
}
-clean_restart ${binfile}
-
set test_spawn_id [spawn_wait_for_attach $binfile]
set testpid [spawn_id_get_pid $test_spawn_id]
diff --git a/gdb/testsuite/gdb.threads/next-bp-other-thread.exp b/gdb/testsuite/gdb.threads/next-bp-other-thread.exp
index 1abbe58..d168f6b3e 100644
--- a/gdb/testsuite/gdb.threads/next-bp-other-thread.exp
+++ b/gdb/testsuite/gdb.threads/next-bp-other-thread.exp
@@ -20,7 +20,8 @@
standard_testfile
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug pthreads}] == -1} {
+if {[build_executable "failed to prepare" $testfile $srcfile \
+ {debug pthreads}] == -1} {
return -1
}
diff --git a/gdb/testsuite/gdb.threads/signal-sigtrap.exp b/gdb/testsuite/gdb.threads/signal-sigtrap.exp
index 92488a5..f5dc7fe 100644
--- a/gdb/testsuite/gdb.threads/signal-sigtrap.exp
+++ b/gdb/testsuite/gdb.threads/signal-sigtrap.exp
@@ -23,7 +23,8 @@ if [target_info exists gdb,nosignals] {
return -1
}
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug pthreads}]} {
+if {[build_executable "failed to prepare" $testfile $srcfile \
+ {debug pthreads}]} {
return -1
}
diff --git a/gdb/testsuite/gdb.threads/step-bg-decr-pc-switch-thread.exp b/gdb/testsuite/gdb.threads/step-bg-decr-pc-switch-thread.exp
index 55ebd40..c6c6cce 100644
--- a/gdb/testsuite/gdb.threads/step-bg-decr-pc-switch-thread.exp
+++ b/gdb/testsuite/gdb.threads/step-bg-decr-pc-switch-thread.exp
@@ -34,8 +34,6 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug pthreads}
return -1
}
-clean_restart $binfile
-
if ![runto_main] {
continue
}
diff --git a/gdb/testsuite/gdb.threads/tid-reuse.exp b/gdb/testsuite/gdb.threads/tid-reuse.exp
index 1d93a55..8ac1f5b 100644
--- a/gdb/testsuite/gdb.threads/tid-reuse.exp
+++ b/gdb/testsuite/gdb.threads/tid-reuse.exp
@@ -22,8 +22,6 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile { debug pthreads
return -1
}
-clean_restart ${binfile}
-
if ![runto_main] {
fail "can't run to main"
return -1
diff --git a/gdb/testsuite/gdb.trace/qtro.exp b/gdb/testsuite/gdb.trace/qtro.exp
index 91a6612..0fadfa6 100644
--- a/gdb/testsuite/gdb.trace/qtro.exp
+++ b/gdb/testsuite/gdb.trace/qtro.exp
@@ -25,7 +25,6 @@ standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug nopie}]} {
return -1
}
-clean_restart $testfile
if ![runto_main] {
fail "can't run to main to check for trace support"