From 123365d04655abc19425e3798b64bccc35a3fa15 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Tue, 2 Sep 2025 14:42:05 +0200 Subject: [PATCH] [gdb/testsuite] Fix clean_restart in gdb.threads Fix clean_restart in the test-cases in gdb.threads. Tested on x86_64-linux. --- .../gdb.threads/access-mem-running-thread-exit.exp | 2 +- gdb/testsuite/gdb.threads/async.exp | 2 +- gdb/testsuite/gdb.threads/attach-non-stop.exp | 2 +- gdb/testsuite/gdb.threads/attach-stopped.exp | 2 +- gdb/testsuite/gdb.threads/bp_in_thread.exp | 2 +- gdb/testsuite/gdb.threads/break-while-running.exp | 2 +- gdb/testsuite/gdb.threads/check-libthread-db.exp | 6 +++--- gdb/testsuite/gdb.threads/detach-step-over.exp | 2 +- gdb/testsuite/gdb.threads/execl.exp | 2 +- gdb/testsuite/gdb.threads/foll-fork-other-thread.exp | 2 +- gdb/testsuite/gdb.threads/fork-child-threads.exp | 2 +- gdb/testsuite/gdb.threads/fork-thread-pending.exp | 4 ++-- .../gdb.threads/forking-threads-plus-breakpoint.exp | 4 ++-- gdb/testsuite/gdb.threads/hand-call-in-threads.exp | 2 +- gdb/testsuite/gdb.threads/inf-thr-count.exp | 2 +- .../infcall-from-bp-cond-other-thread-event.exp | 2 +- .../gdb.threads/infcall-from-bp-cond-simple.exp | 2 +- .../gdb.threads/infcall-from-bp-cond-single.exp | 2 +- .../gdb.threads/infcall-from-bp-cond-timeout.exp | 2 +- gdb/testsuite/gdb.threads/info-threads-options.exp | 2 +- .../gdb.threads/interrupt-while-step-over.exp | 2 +- gdb/testsuite/gdb.threads/interrupted-hand-call.exp | 2 +- gdb/testsuite/gdb.threads/killed.exp | 2 +- gdb/testsuite/gdb.threads/leader-exit-attach.exp | 2 +- gdb/testsuite/gdb.threads/linux-dp.exp | 2 +- .../gdb.threads/local-watch-wrong-thread.exp | 2 +- .../gdb.threads/main-thread-exit-during-detach.exp | 2 +- gdb/testsuite/gdb.threads/manythreads.exp | 2 +- gdb/testsuite/gdb.threads/multi-create.exp | 2 +- .../gdb.threads/multiple-successive-infcall.exp | 2 +- gdb/testsuite/gdb.threads/next-bp-other-thread.exp | 2 +- .../gdb.threads/next-fork-exec-other-thread.exp | 2 +- gdb/testsuite/gdb.threads/next-fork-other-thread.exp | 2 +- .../gdb.threads/pending-fork-event-detach-ns.exp | 2 +- .../gdb.threads/pending-fork-event-detach.exp | 3 ++- gdb/testsuite/gdb.threads/pending-step.exp | 2 +- gdb/testsuite/gdb.threads/print-threads.exp | 2 +- .../gdb.threads/process-dies-while-detaching.exp | 12 +++++++----- .../gdb.threads/process-dies-while-handling-bp.exp | 2 +- gdb/testsuite/gdb.threads/pthread_cond_wait.exp | 2 +- gdb/testsuite/gdb.threads/pthreads.exp | 2 +- gdb/testsuite/gdb.threads/queue-signal.exp | 2 +- gdb/testsuite/gdb.threads/schedlock-new-thread.exp | 2 +- gdb/testsuite/gdb.threads/schedlock-thread-exit.exp | 2 +- .../gdb.threads/signal-command-handle-nopass.exp | 2 +- .../signal-command-multiple-signals-pending.exp | 2 +- .../gdb.threads/signal-delivered-right-thread.exp | 2 +- gdb/testsuite/gdb.threads/signal-sigtrap.exp | 2 +- gdb/testsuite/gdb.threads/sigthread.exp | 2 +- gdb/testsuite/gdb.threads/staticthreads.exp | 4 ++-- gdb/testsuite/gdb.threads/step-N-all-progress.exp | 2 +- gdb/testsuite/gdb.threads/step-over-exec.exp | 3 ++- .../step-over-thread-exit-while-stop-all-threads.exp | 2 +- gdb/testsuite/gdb.threads/step-over-thread-exit.exp | 2 +- gdb/testsuite/gdb.threads/stepi-over-clone.exp | 2 +- gdb/testsuite/gdb.threads/switch-threads.exp | 2 +- gdb/testsuite/gdb.threads/thread-bp-deleted.exp | 2 +- gdb/testsuite/gdb.threads/thread-execl.exp | 2 +- gdb/testsuite/gdb.threads/thread-find.exp | 2 +- gdb/testsuite/gdb.threads/thread-specific-bp.exp | 2 +- gdb/testsuite/gdb.threads/thread-specific.exp | 2 +- gdb/testsuite/gdb.threads/thread-unwindonsignal.exp | 2 +- gdb/testsuite/gdb.threads/thread_check.exp | 2 +- gdb/testsuite/gdb.threads/threadapply.exp | 6 +++--- gdb/testsuite/gdb.threads/threadcrash.exp | 4 ++-- gdb/testsuite/gdb.threads/threxit-hop-specific.exp | 2 +- gdb/testsuite/gdb.threads/tls-core.exp | 4 ++-- gdb/testsuite/gdb.threads/tls-nodebug-pie.exp | 2 +- gdb/testsuite/gdb.threads/tls-nodebug.exp | 2 +- gdb/testsuite/gdb.threads/tls-shared.exp | 2 +- gdb/testsuite/gdb.threads/tls-so_extern.exp | 2 +- gdb/testsuite/gdb.threads/tls.exp | 2 +- .../gdb.threads/vfork-follow-child-exec.exp | 2 +- .../gdb.threads/vfork-follow-child-exit.exp | 2 +- gdb/testsuite/gdb.threads/vfork-multi-thread.exp | 2 +- gdb/testsuite/gdb.threads/watchthreads.exp | 2 +- gdb/testsuite/gdb.threads/watchthreads2.exp | 2 +- gdb/testsuite/gdb.threads/wp-replication.exp | 2 +- 78 files changed, 95 insertions(+), 91 deletions(-) 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 fec31c3203a..6846b3881a2 100644 --- a/gdb/testsuite/gdb.threads/access-mem-running-thread-exit.exp +++ b/gdb/testsuite/gdb.threads/access-mem-running-thread-exit.exp @@ -51,7 +51,7 @@ proc test { non_stop } { save_vars { GDBFLAGS } { append GDBFLAGS " -ex \"set non-stop $non_stop\"" - clean_restart ${binfile} + clean_restart ${::testfile} } if ![runto setup_done] { diff --git a/gdb/testsuite/gdb.threads/async.exp b/gdb/testsuite/gdb.threads/async.exp index b1e562a29b5..63473334e70 100644 --- a/gdb/testsuite/gdb.threads/async.exp +++ b/gdb/testsuite/gdb.threads/async.exp @@ -32,7 +32,7 @@ proc test_current_thread {expected_thr} { global gdb_prompt global binfile - clean_restart $binfile + clean_restart $::testfile if {![runto "all_started"]} { return diff --git a/gdb/testsuite/gdb.threads/attach-non-stop.exp b/gdb/testsuite/gdb.threads/attach-non-stop.exp index 9404eddfadf..b8da5b14450 100644 --- a/gdb/testsuite/gdb.threads/attach-non-stop.exp +++ b/gdb/testsuite/gdb.threads/attach-non-stop.exp @@ -37,7 +37,7 @@ proc test {target_non_stop non_stop cmd} { save_vars { GDBFLAGS } { append GDBFLAGS " -ex \"maint set target-non-stop $target_non_stop\"" append GDBFLAGS " -ex \"set non-stop $non_stop\"" - clean_restart $binfile + clean_restart $::testfile } set test_spawn_id [spawn_wait_for_attach $binfile] diff --git a/gdb/testsuite/gdb.threads/attach-stopped.exp b/gdb/testsuite/gdb.threads/attach-stopped.exp index e628adf2faa..a3926d94d3b 100644 --- a/gdb/testsuite/gdb.threads/attach-stopped.exp +++ b/gdb/testsuite/gdb.threads/attach-stopped.exp @@ -43,7 +43,7 @@ proc corefunc { threadtype } { # Stop the program remote_exec build "kill -s STOP ${testpid}" - clean_restart $binfile + clean_restart $::testfile # Verify that we can attach to the stopped process. diff --git a/gdb/testsuite/gdb.threads/bp_in_thread.exp b/gdb/testsuite/gdb.threads/bp_in_thread.exp index c63f17922cf..5180c18dbec 100644 --- a/gdb/testsuite/gdb.threads/bp_in_thread.exp +++ b/gdb/testsuite/gdb.threads/bp_in_thread.exp @@ -24,7 +24,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab return -1 } -clean_restart $binfile +clean_restart $::testfile runto_main diff --git a/gdb/testsuite/gdb.threads/break-while-running.exp b/gdb/testsuite/gdb.threads/break-while-running.exp index fbc2b59d195..fb7994d8d7c 100644 --- a/gdb/testsuite/gdb.threads/break-while-running.exp +++ b/gdb/testsuite/gdb.threads/break-while-running.exp @@ -39,7 +39,7 @@ proc test { update_thread_list always_inserted non_stop } { global gdb_prompt global decimal - clean_restart $binfile + clean_restart $::testfile gdb_test_no_output "set non-stop $non_stop" gdb_test_no_output "set breakpoint always-inserted $always_inserted" diff --git a/gdb/testsuite/gdb.threads/check-libthread-db.exp b/gdb/testsuite/gdb.threads/check-libthread-db.exp index b97ab4936d0..6d631852deb 100644 --- a/gdb/testsuite/gdb.threads/check-libthread-db.exp +++ b/gdb/testsuite/gdb.threads/check-libthread-db.exp @@ -40,7 +40,7 @@ set initial_thread_re "($thread_re1|$thread_re2)" with_test_prefix "user-initiated check" { # User-initiated check with libthread_db not loaded. - clean_restart ${binfile} + clean_restart ${::testfile} gdb_test "maint show check-libthread-db" \ "Whether to check libthread_db at load time is off." @@ -85,7 +85,7 @@ with_test_prefix "automated load-time check" { # Automated load-time check with NPTL possibly uninitialized. with_test_prefix "libpthread.so possibly not initialized" { - clean_restart ${binfile} + clean_restart ${::testfile} gdb_test_no_output "maint set check-libthread-db 1" gdb_test_no_output "set debug libthread-db 1" @@ -104,7 +104,7 @@ with_test_prefix "automated load-time check" { # Automated load-time check with NPTL fully operational. if { [can_spawn_for_attach] } { with_test_prefix "libpthread.so fully initialized" { - clean_restart ${binfile} + clean_restart ${::testfile} gdb_test_no_output "maint set check-libthread-db 1" gdb_test_no_output "set debug libthread-db 1" diff --git a/gdb/testsuite/gdb.threads/detach-step-over.exp b/gdb/testsuite/gdb.threads/detach-step-over.exp index 8a1cb292c3d..176746417b5 100644 --- a/gdb/testsuite/gdb.threads/detach-step-over.exp +++ b/gdb/testsuite/gdb.threads/detach-step-over.exp @@ -66,7 +66,7 @@ proc start_gdb_for_test {condition_eval target_non_stop non_stop displaced} { append ::GDBFLAGS " -ex \"set non-stop $non_stop\"" append ::GDBFLAGS " -ex \"set displaced $displaced\"" append ::GDBFLAGS " -ex \"set schedule-multiple on\"" - clean_restart $::binfile + clean_restart $::testfile } gdb_test_no_output "set breakpoint condition-evaluation $condition_eval" diff --git a/gdb/testsuite/gdb.threads/execl.exp b/gdb/testsuite/gdb.threads/execl.exp index 502d3870690..a42dce95eed 100644 --- a/gdb/testsuite/gdb.threads/execl.exp +++ b/gdb/testsuite/gdb.threads/execl.exp @@ -31,7 +31,7 @@ if {[gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile1}" executable {deb return -1 } -clean_restart ${binfile} +clean_restart ${::testfile} if { [is_remote target] } { gdb_remote_download target $binfile1 } diff --git a/gdb/testsuite/gdb.threads/foll-fork-other-thread.exp b/gdb/testsuite/gdb.threads/foll-fork-other-thread.exp index 8ab540c98c4..29ec34cee66 100644 --- a/gdb/testsuite/gdb.threads/foll-fork-other-thread.exp +++ b/gdb/testsuite/gdb.threads/foll-fork-other-thread.exp @@ -46,7 +46,7 @@ proc do_test { fork_func follow target-non-stop non-stop displaced-stepping } { save_vars { ::GDBFLAGS } { append ::GDBFLAGS " -ex \"maintenance set target-non-stop ${target-non-stop}\"" append ::GDBFLAGS " -ex \"set non-stop ${non-stop}\"" - clean_restart ${::binfile}-${fork_func} + clean_restart ${::testfile}-${fork_func} } gdb_test_no_output "set displaced-stepping ${displaced-stepping}" diff --git a/gdb/testsuite/gdb.threads/fork-child-threads.exp b/gdb/testsuite/gdb.threads/fork-child-threads.exp index ba9dfc241f6..d1b413c6429 100644 --- a/gdb/testsuite/gdb.threads/fork-child-threads.exp +++ b/gdb/testsuite/gdb.threads/fork-child-threads.exp @@ -21,7 +21,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab return -1 } -clean_restart ${binfile} +clean_restart ${::testfile} if {![runto_main]} { return 0 diff --git a/gdb/testsuite/gdb.threads/fork-thread-pending.exp b/gdb/testsuite/gdb.threads/fork-thread-pending.exp index 538e1ca6f3f..e0e3625ea3d 100644 --- a/gdb/testsuite/gdb.threads/fork-thread-pending.exp +++ b/gdb/testsuite/gdb.threads/fork-thread-pending.exp @@ -21,7 +21,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab return -1 } -clean_restart ${binfile} +clean_restart ${::testfile} if {![runto_main]} { return 0 @@ -75,7 +75,7 @@ gdb_test_multiple "info threads" "$test" { # Start over, but this time, don't switch away from the fork event thread. -clean_restart $binfile +clean_restart $::testfile if {![runto_main]} { return 0 } diff --git a/gdb/testsuite/gdb.threads/forking-threads-plus-breakpoint.exp b/gdb/testsuite/gdb.threads/forking-threads-plus-breakpoint.exp index c668a655522..d65fe83d606 100644 --- a/gdb/testsuite/gdb.threads/forking-threads-plus-breakpoint.exp +++ b/gdb/testsuite/gdb.threads/forking-threads-plus-breakpoint.exp @@ -37,7 +37,7 @@ proc probe_displaced_stepping_support {} { global binfile gdb_prompt with_test_prefix "probe displaced-stepping support" { - clean_restart $binfile + clean_restart $::testfile gdb_test_no_output "set displaced on" if {![runto_main]} { @@ -76,7 +76,7 @@ proc do_test { cond_bp_target detach_on_fork displaced } { save_vars { GDBFLAGS } { set GDBFLAGS [concat $GDBFLAGS " -ex \"set non-stop on\""] - clean_restart $binfile + clean_restart $::testfile } if {![runto_main]} { diff --git a/gdb/testsuite/gdb.threads/hand-call-in-threads.exp b/gdb/testsuite/gdb.threads/hand-call-in-threads.exp index d1be1d0be63..fd934f50178 100644 --- a/gdb/testsuite/gdb.threads/hand-call-in-threads.exp +++ b/gdb/testsuite/gdb.threads/hand-call-in-threads.exp @@ -44,7 +44,7 @@ proc get_dummy_frame_number { } { return "" } -clean_restart ${binfile} +clean_restart ${::testfile} if { ![runto_main] } { return 0 diff --git a/gdb/testsuite/gdb.threads/inf-thr-count.exp b/gdb/testsuite/gdb.threads/inf-thr-count.exp index 61533ab3820..5272f5c901a 100644 --- a/gdb/testsuite/gdb.threads/inf-thr-count.exp +++ b/gdb/testsuite/gdb.threads/inf-thr-count.exp @@ -44,7 +44,7 @@ if {[build_executable "failed to prepare" $testfile $srcfile \ # the inferior while it is running. save_vars {GDBFLAGS} { append GDBFLAGS { -ex "set non-stop on"} - clean_restart $binfile + clean_restart $::testfile } if ![runto_main] { diff --git a/gdb/testsuite/gdb.threads/infcall-from-bp-cond-other-thread-event.exp b/gdb/testsuite/gdb.threads/infcall-from-bp-cond-other-thread-event.exp index 62a183c9bc8..35a1fe5f06f 100644 --- a/gdb/testsuite/gdb.threads/infcall-from-bp-cond-other-thread-event.exp +++ b/gdb/testsuite/gdb.threads/infcall-from-bp-cond-other-thread-event.exp @@ -53,7 +53,7 @@ proc start_gdb_and_runto_main { target_async target_non_stop } { append ::GDBFLAGS \ " -ex \"maintenance set target-async ${target_async}\"" - clean_restart ${::binfile} + clean_restart ${::testfile} } if { ![runto_main] } { diff --git a/gdb/testsuite/gdb.threads/infcall-from-bp-cond-simple.exp b/gdb/testsuite/gdb.threads/infcall-from-bp-cond-simple.exp index 0f068c6f777..ed9899821a1 100644 --- a/gdb/testsuite/gdb.threads/infcall-from-bp-cond-simple.exp +++ b/gdb/testsuite/gdb.threads/infcall-from-bp-cond-simple.exp @@ -42,7 +42,7 @@ proc start_gdb_and_runto_main { target_async target_non_stop } { append ::GDBFLAGS \ " -ex \"maintenance set target-async ${target_async}\"" - clean_restart ${::binfile} + clean_restart ${::testfile} } if { ![runto_main] } { diff --git a/gdb/testsuite/gdb.threads/infcall-from-bp-cond-single.exp b/gdb/testsuite/gdb.threads/infcall-from-bp-cond-single.exp index c404a7d3895..bc12fb4f6ac 100644 --- a/gdb/testsuite/gdb.threads/infcall-from-bp-cond-single.exp +++ b/gdb/testsuite/gdb.threads/infcall-from-bp-cond-single.exp @@ -38,7 +38,7 @@ proc start_gdb_and_runto_main { target_async target_non_stop } { append ::GDBFLAGS \ " -ex \"maintenance set target-async ${target_async}\"" - clean_restart ${::binfile} + clean_restart ${::testfile} } if { ![runto_main] } { diff --git a/gdb/testsuite/gdb.threads/infcall-from-bp-cond-timeout.exp b/gdb/testsuite/gdb.threads/infcall-from-bp-cond-timeout.exp index 9dbaa4fce0b..03c69599bf9 100644 --- a/gdb/testsuite/gdb.threads/infcall-from-bp-cond-timeout.exp +++ b/gdb/testsuite/gdb.threads/infcall-from-bp-cond-timeout.exp @@ -52,7 +52,7 @@ proc run_test { target_async target_non_stop non_stop other_thread_bp unwind } { append ::GDBFLAGS " -ex \"maint non-stop $non_stop\"" append ::GDBFLAGS " -ex \"maintenance set target-async ${target_async}\"" - clean_restart ${::binfile} + clean_restart ${::testfile} } if {![runto_main]} { diff --git a/gdb/testsuite/gdb.threads/info-threads-options.exp b/gdb/testsuite/gdb.threads/info-threads-options.exp index 38e4e67f08b..e6c68e23d92 100644 --- a/gdb/testsuite/gdb.threads/info-threads-options.exp +++ b/gdb/testsuite/gdb.threads/info-threads-options.exp @@ -24,7 +24,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ save_vars { GDBFLAGS } { append GDBFLAGS " -ex \"set non-stop on\"" - clean_restart $binfile + clean_restart $::testfile } if ![runto_main] { diff --git a/gdb/testsuite/gdb.threads/interrupt-while-step-over.exp b/gdb/testsuite/gdb.threads/interrupt-while-step-over.exp index 05587eb417a..44e4d6405e1 100644 --- a/gdb/testsuite/gdb.threads/interrupt-while-step-over.exp +++ b/gdb/testsuite/gdb.threads/interrupt-while-step-over.exp @@ -169,7 +169,7 @@ proc testdriver {displaced} { save_vars { GDBFLAGS } { append GDBFLAGS " -ex \"set non-stop on\"" - clean_restart $binfile + clean_restart $::testfile } gdb_test_no_output "set displaced-stepping $displaced" diff --git a/gdb/testsuite/gdb.threads/interrupted-hand-call.exp b/gdb/testsuite/gdb.threads/interrupted-hand-call.exp index 3a2bc63ad65..15c48b175e5 100644 --- a/gdb/testsuite/gdb.threads/interrupted-hand-call.exp +++ b/gdb/testsuite/gdb.threads/interrupted-hand-call.exp @@ -28,7 +28,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab return -1 } -clean_restart ${binfile} +clean_restart ${::testfile} if { ![runto_main] } { return 0 diff --git a/gdb/testsuite/gdb.threads/killed.exp b/gdb/testsuite/gdb.threads/killed.exp index b1cec80b000..1fa83af5be2 100644 --- a/gdb/testsuite/gdb.threads/killed.exp +++ b/gdb/testsuite/gdb.threads/killed.exp @@ -62,7 +62,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab } -clean_restart ${binfile} +clean_restart ${::testfile} gdb_run_cmd gdb_test "" "" "run program to completion" diff --git a/gdb/testsuite/gdb.threads/leader-exit-attach.exp b/gdb/testsuite/gdb.threads/leader-exit-attach.exp index 641d6b5823c..2df4a186727 100644 --- a/gdb/testsuite/gdb.threads/leader-exit-attach.exp +++ b/gdb/testsuite/gdb.threads/leader-exit-attach.exp @@ -31,7 +31,7 @@ set testpid [spawn_id_get_pid $test_spawn_id] # Wait a bit for the leader thread to exit, before attaching. sleep 2 -clean_restart ${binfile} +clean_restart ${::testfile} # Save this early as we may not be able to talk with GDBserver anymore # when we need to check it. diff --git a/gdb/testsuite/gdb.threads/linux-dp.exp b/gdb/testsuite/gdb.threads/linux-dp.exp index 1652f78a52a..35cc255f1c7 100644 --- a/gdb/testsuite/gdb.threads/linux-dp.exp +++ b/gdb/testsuite/gdb.threads/linux-dp.exp @@ -44,7 +44,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab return -1 } -clean_restart ${binfile} +clean_restart ${::testfile} gdb_test_no_output "set print sevenbit-strings" runto_main diff --git a/gdb/testsuite/gdb.threads/local-watch-wrong-thread.exp b/gdb/testsuite/gdb.threads/local-watch-wrong-thread.exp index 3006b833794..a63f0beed16 100644 --- a/gdb/testsuite/gdb.threads/local-watch-wrong-thread.exp +++ b/gdb/testsuite/gdb.threads/local-watch-wrong-thread.exp @@ -28,7 +28,7 @@ if {[gdb_compile_pthreads \ return -1 } -clean_restart ${binfile} +clean_restart ${::testfile} gdb_test_no_output "set can-use-hw-watchpoints 1" "" diff --git a/gdb/testsuite/gdb.threads/main-thread-exit-during-detach.exp b/gdb/testsuite/gdb.threads/main-thread-exit-during-detach.exp index 20e7bc470c5..1ce0194442c 100644 --- a/gdb/testsuite/gdb.threads/main-thread-exit-during-detach.exp +++ b/gdb/testsuite/gdb.threads/main-thread-exit-during-detach.exp @@ -50,7 +50,7 @@ if {[build_executable "failed to prepare" $testfile $srcfile \ proc run_test { spawn_inferior } { save_vars { ::GDBFLAGS } { append ::GDBFLAGS " -ex \"set non-stop on\"" - clean_restart $::binfile + clean_restart $::testfile } # Setup the inferior. When complete the main thread (#1) will diff --git a/gdb/testsuite/gdb.threads/manythreads.exp b/gdb/testsuite/gdb.threads/manythreads.exp index ae51c5a7dea..2cd296f3151 100644 --- a/gdb/testsuite/gdb.threads/manythreads.exp +++ b/gdb/testsuite/gdb.threads/manythreads.exp @@ -31,7 +31,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab return -1 } -clean_restart ${binfile} +clean_restart ${::testfile} gdb_test_no_output "set print sevenbit-strings" runto_main diff --git a/gdb/testsuite/gdb.threads/multi-create.exp b/gdb/testsuite/gdb.threads/multi-create.exp index 966d44d185d..cb86aacc5bc 100644 --- a/gdb/testsuite/gdb.threads/multi-create.exp +++ b/gdb/testsuite/gdb.threads/multi-create.exp @@ -21,7 +21,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ return -1 } -clean_restart ${binfile} +clean_restart ${::testfile} runto_main # Run to the beginning of create_function several times. Make sure diff --git a/gdb/testsuite/gdb.threads/multiple-successive-infcall.exp b/gdb/testsuite/gdb.threads/multiple-successive-infcall.exp index 1aa925304d2..2694ce58e89 100644 --- a/gdb/testsuite/gdb.threads/multiple-successive-infcall.exp +++ b/gdb/testsuite/gdb.threads/multiple-successive-infcall.exp @@ -23,7 +23,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ return -1 } -clean_restart "${binfile}" +clean_restart "${::testfile}" if {![runto_main]} { return 0 diff --git a/gdb/testsuite/gdb.threads/next-bp-other-thread.exp b/gdb/testsuite/gdb.threads/next-bp-other-thread.exp index cf8d6873440..6b696ddf455 100644 --- a/gdb/testsuite/gdb.threads/next-bp-other-thread.exp +++ b/gdb/testsuite/gdb.threads/next-bp-other-thread.exp @@ -28,7 +28,7 @@ if {[build_executable "failed to prepare" $testfile $srcfile \ # Test all "set scheduler-locking" variants. foreach schedlock {"off" "step" "on" } { with_test_prefix "schedlock=$schedlock" { - clean_restart $binfile + clean_restart $::testfile if ![runto_main] { continue diff --git a/gdb/testsuite/gdb.threads/next-fork-exec-other-thread.exp b/gdb/testsuite/gdb.threads/next-fork-exec-other-thread.exp index 3a971274784..82e85a69271 100644 --- a/gdb/testsuite/gdb.threads/next-fork-exec-other-thread.exp +++ b/gdb/testsuite/gdb.threads/next-fork-exec-other-thread.exp @@ -67,7 +67,7 @@ proc do_test { fork_func target-non-stop non-stop displaced-stepping } { save_vars { ::GDBFLAGS } { append ::GDBFLAGS " -ex \"maintenance set target-non-stop ${target-non-stop}\"" append ::GDBFLAGS " -ex \"set non-stop ${non-stop}\"" - clean_restart ${::binfile}-${fork_func} + clean_restart ${::testfile}-${fork_func} } gdb_test_no_output "set displaced-stepping ${displaced-stepping}" diff --git a/gdb/testsuite/gdb.threads/next-fork-other-thread.exp b/gdb/testsuite/gdb.threads/next-fork-other-thread.exp index 1cd6685215c..93490917fd8 100644 --- a/gdb/testsuite/gdb.threads/next-fork-other-thread.exp +++ b/gdb/testsuite/gdb.threads/next-fork-other-thread.exp @@ -58,7 +58,7 @@ proc do_test { fork_func target-non-stop non-stop displaced-stepping } { save_vars { ::GDBFLAGS } { append ::GDBFLAGS " -ex \"maintenance set target-non-stop ${target-non-stop}\"" append ::GDBFLAGS " -ex \"set non-stop ${non-stop}\"" - clean_restart ${::binfile}-${fork_func} + clean_restart ${::testfile}-${fork_func} } gdb_test_no_output "set displaced-stepping ${displaced-stepping}" diff --git a/gdb/testsuite/gdb.threads/pending-fork-event-detach-ns.exp b/gdb/testsuite/gdb.threads/pending-fork-event-detach-ns.exp index 29a011e1a7d..9cc4978acdd 100644 --- a/gdb/testsuite/gdb.threads/pending-fork-event-detach-ns.exp +++ b/gdb/testsuite/gdb.threads/pending-fork-event-detach-ns.exp @@ -52,7 +52,7 @@ proc do_test { } { save_vars { ::GDBFLAGS } { append ::GDBFLAGS " -ex \"set non-stop on\"" - clean_restart $::binfile + clean_restart $::testfile } if { ![runto break_here_first] } { diff --git a/gdb/testsuite/gdb.threads/pending-fork-event-detach.exp b/gdb/testsuite/gdb.threads/pending-fork-event-detach.exp index e627241caed..fa864882309 100644 --- a/gdb/testsuite/gdb.threads/pending-fork-event-detach.exp +++ b/gdb/testsuite/gdb.threads/pending-fork-event-detach.exp @@ -93,7 +93,8 @@ proc do_test { target-non-stop who_forks fork_function stop_mode } { save_vars { ::GDBFLAGS } { append ::GDBFLAGS " -ex \"maintenance set target-non-stop ${target-non-stop}\"" - clean_restart $this_binfile + clean_restart + gdb_load $this_binfile } if {![runto_main]} { diff --git a/gdb/testsuite/gdb.threads/pending-step.exp b/gdb/testsuite/gdb.threads/pending-step.exp index 1c2422efb80..d31f87984ca 100644 --- a/gdb/testsuite/gdb.threads/pending-step.exp +++ b/gdb/testsuite/gdb.threads/pending-step.exp @@ -54,7 +54,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab return -1 } -clean_restart ${binfile} +clean_restart ${::testfile} if {![runto_main]} { return 0 diff --git a/gdb/testsuite/gdb.threads/print-threads.exp b/gdb/testsuite/gdb.threads/print-threads.exp index 51a14b21f30..3d2dc1493bd 100644 --- a/gdb/testsuite/gdb.threads/print-threads.exp +++ b/gdb/testsuite/gdb.threads/print-threads.exp @@ -32,7 +32,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab # Now we can proceed with the real testing. -clean_restart ${binfile} +clean_restart ${::testfile} gdb_test_no_output "set print sevenbit-strings" #gdb_test_no_output "set print address off" diff --git a/gdb/testsuite/gdb.threads/process-dies-while-detaching.exp b/gdb/testsuite/gdb.threads/process-dies-while-detaching.exp index 776c08e388d..6c6a4b1938d 100644 --- a/gdb/testsuite/gdb.threads/process-dies-while-detaching.exp +++ b/gdb/testsuite/gdb.threads/process-dies-while-detaching.exp @@ -43,6 +43,7 @@ # threads are reaped. We test that as well. standard_testfile +set testfile_base $testfile # Test that GDBserver exits. @@ -214,7 +215,7 @@ proc test_detach {multi_process cmd} { with_test_prefix "detach" { global binfile - clean_restart ${binfile} + clean_restart ${::testfile} if ![runto_main] { return -1 @@ -242,7 +243,7 @@ proc test_detach_watch {wp multi_process cmd} { with_test_prefix "watchpoint:$wp" { global binfile decimal - clean_restart ${binfile} + clean_restart ${::testfile} if ![runto_main] { return -1 @@ -290,7 +291,7 @@ proc test_detach_killed_outside {multi_process cmd} { with_test_prefix "killed outside" { global binfile - clean_restart ${binfile} + clean_restart ${::testfile} if ![runto_main] { return -1 @@ -334,14 +335,15 @@ proc do_test {multi_process cmd} { return } - set binfile [standard_output_file ${testfile}-$multi_process-$cmd] + set testfile $::testfile_base-$multi_process-$cmd + set binfile [standard_output_file $testfile] set options {debug pthreads} if {$multi_process} { lappend options "additional_flags=-DMULTIPROCESS" } if {[build_executable "failed to build" \ - $testfile-$multi_process-$cmd $srcfile $options] == -1} { + $testfile $srcfile $options] == -1} { return -1 } diff --git a/gdb/testsuite/gdb.threads/process-dies-while-handling-bp.exp b/gdb/testsuite/gdb.threads/process-dies-while-handling-bp.exp index 26dc8cce98a..a990dc91a24 100644 --- a/gdb/testsuite/gdb.threads/process-dies-while-handling-bp.exp +++ b/gdb/testsuite/gdb.threads/process-dies-while-handling-bp.exp @@ -42,7 +42,7 @@ proc do_test { non_stop cond_bp_target } { save_vars { GDBFLAGS } { set GDBFLAGS [concat $GDBFLAGS " -ex \"set non-stop $non_stop\""] - clean_restart $binfile + clean_restart $::testfile } if {![runto_main]} { diff --git a/gdb/testsuite/gdb.threads/pthread_cond_wait.exp b/gdb/testsuite/gdb.threads/pthread_cond_wait.exp index c1be1cd8447..e914db054ed 100644 --- a/gdb/testsuite/gdb.threads/pthread_cond_wait.exp +++ b/gdb/testsuite/gdb.threads/pthread_cond_wait.exp @@ -25,7 +25,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab return -1 } -clean_restart ${binfile} +clean_restart ${::testfile} runto_main gdb_test "break break_me" \ diff --git a/gdb/testsuite/gdb.threads/pthreads.exp b/gdb/testsuite/gdb.threads/pthreads.exp index 0437e74bdf7..04ae91e29d5 100644 --- a/gdb/testsuite/gdb.threads/pthreads.exp +++ b/gdb/testsuite/gdb.threads/pthreads.exp @@ -34,7 +34,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab return -1 } -clean_restart ${binfile} +clean_restart ${::testfile} gdb_test_no_output "set print sevenbit-strings" #gdb_test_no_output "set print address off" diff --git a/gdb/testsuite/gdb.threads/queue-signal.exp b/gdb/testsuite/gdb.threads/queue-signal.exp index f791ffab9f6..34abc3b8dd0 100644 --- a/gdb/testsuite/gdb.threads/queue-signal.exp +++ b/gdb/testsuite/gdb.threads/queue-signal.exp @@ -20,7 +20,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ return -1 } -clean_restart ${binfile} +clean_restart ${::testfile} if ![runto_main] { return 0 diff --git a/gdb/testsuite/gdb.threads/schedlock-new-thread.exp b/gdb/testsuite/gdb.threads/schedlock-new-thread.exp index c3981375132..5fda4b8859a 100644 --- a/gdb/testsuite/gdb.threads/schedlock-new-thread.exp +++ b/gdb/testsuite/gdb.threads/schedlock-new-thread.exp @@ -31,7 +31,7 @@ proc test {non-stop schedlock} { save_vars ::GDBFLAGS { append ::GDBFLAGS " -ex \"set non-stop ${non-stop}\"" set sl [expr $schedlock == "on" ? 1 : 0] - clean_restart $::binfile-$sl + clean_restart $::testfile-$sl } set linenum1 [gdb_get_line_number "set break 1 here"] diff --git a/gdb/testsuite/gdb.threads/schedlock-thread-exit.exp b/gdb/testsuite/gdb.threads/schedlock-thread-exit.exp index 434b0587720..137f65242f5 100644 --- a/gdb/testsuite/gdb.threads/schedlock-thread-exit.exp +++ b/gdb/testsuite/gdb.threads/schedlock-thread-exit.exp @@ -28,7 +28,7 @@ if { [build_executable "failed to prepare" ${testfile} ${srcfile} \ } proc do_test { } { - clean_restart $::binfile + clean_restart $::testfile # One of the launched threads will report a stop on thread_func. Some # others will also stop on thread_func and have a pending status. diff --git a/gdb/testsuite/gdb.threads/signal-command-handle-nopass.exp b/gdb/testsuite/gdb.threads/signal-command-handle-nopass.exp index 2586800cc93..6d344e3f652 100644 --- a/gdb/testsuite/gdb.threads/signal-command-handle-nopass.exp +++ b/gdb/testsuite/gdb.threads/signal-command-handle-nopass.exp @@ -35,7 +35,7 @@ proc test { step_over } { global srcfile binfile tdlabel_re with_test_prefix "step-over $step_over" { - clean_restart ${binfile} + clean_restart ${::testfile} if {![runto_main]} { return 0 diff --git a/gdb/testsuite/gdb.threads/signal-command-multiple-signals-pending.exp b/gdb/testsuite/gdb.threads/signal-command-multiple-signals-pending.exp index 73f88c16d9e..acb018bc7ae 100644 --- a/gdb/testsuite/gdb.threads/signal-command-multiple-signals-pending.exp +++ b/gdb/testsuite/gdb.threads/signal-command-multiple-signals-pending.exp @@ -32,7 +32,7 @@ proc test { schedlock } { global srcfile binfile tdlabel_re with_test_prefix "schedlock $schedlock" { - clean_restart ${binfile} + clean_restart ${::testfile} if {![runto_main]} { return 0 diff --git a/gdb/testsuite/gdb.threads/signal-delivered-right-thread.exp b/gdb/testsuite/gdb.threads/signal-delivered-right-thread.exp index 7445cadc1bd..9de09084c7b 100644 --- a/gdb/testsuite/gdb.threads/signal-delivered-right-thread.exp +++ b/gdb/testsuite/gdb.threads/signal-delivered-right-thread.exp @@ -29,7 +29,7 @@ proc test { command } { global srcfile binfile tdlabel_re with_test_prefix "$command" { - clean_restart ${binfile} + clean_restart ${::testfile} if {![runto_main]} { return 0 diff --git a/gdb/testsuite/gdb.threads/signal-sigtrap.exp b/gdb/testsuite/gdb.threads/signal-sigtrap.exp index 8154ddf2ee0..849d628d9f9 100644 --- a/gdb/testsuite/gdb.threads/signal-sigtrap.exp +++ b/gdb/testsuite/gdb.threads/signal-sigtrap.exp @@ -32,7 +32,7 @@ proc test { sigtrap_thread } { global srcfile binfile tdlabel_re with_test_prefix "sigtrap thread $sigtrap_thread" { - clean_restart ${binfile} + clean_restart ${::testfile} if {![runto "thread_function"]} { return 0 diff --git a/gdb/testsuite/gdb.threads/sigthread.exp b/gdb/testsuite/gdb.threads/sigthread.exp index 9d2f9b530eb..dea8eb8513d 100644 --- a/gdb/testsuite/gdb.threads/sigthread.exp +++ b/gdb/testsuite/gdb.threads/sigthread.exp @@ -24,7 +24,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ return -1 } -clean_restart ${binfile} +clean_restart ${::testfile} if {![runto_main]} { return 0 diff --git a/gdb/testsuite/gdb.threads/staticthreads.exp b/gdb/testsuite/gdb.threads/staticthreads.exp index 0374666177b..bbe11abf8f3 100644 --- a/gdb/testsuite/gdb.threads/staticthreads.exp +++ b/gdb/testsuite/gdb.threads/staticthreads.exp @@ -34,7 +34,7 @@ foreach_with_prefix have_tls { "-DHAVE_TLS" "" } { } } -clean_restart ${binfile} +clean_restart ${::testfile} gdb_test_no_output "set print sevenbit-strings" @@ -94,7 +94,7 @@ gdb_test_multiple "quit" "$test" { pass "$test" } } -clean_restart ${binfile} +clean_restart ${::testfile} if { "$have_tls" != "" } { diff --git a/gdb/testsuite/gdb.threads/step-N-all-progress.exp b/gdb/testsuite/gdb.threads/step-N-all-progress.exp index c874d79fbdd..031e36a7521 100644 --- a/gdb/testsuite/gdb.threads/step-N-all-progress.exp +++ b/gdb/testsuite/gdb.threads/step-N-all-progress.exp @@ -31,7 +31,7 @@ proc test {non-stop target-non-stop} { save_vars ::GDBFLAGS { append ::GDBFLAGS " -ex \"maintenance set target-non-stop ${target-non-stop}\"" append ::GDBFLAGS " -ex \"set non-stop ${non-stop}\"" - clean_restart $::binfile + clean_restart $::testfile } if { ![runto_main] } { diff --git a/gdb/testsuite/gdb.threads/step-over-exec.exp b/gdb/testsuite/gdb.threads/step-over-exec.exp index 7c553f2c19c..b06f3a479e3 100644 --- a/gdb/testsuite/gdb.threads/step-over-exec.exp +++ b/gdb/testsuite/gdb.threads/step-over-exec.exp @@ -71,7 +71,8 @@ proc do_test { execr_thread different_text_segments displaced_stepping } { return -1 } - clean_restart ${execr_binfile} + clean_restart + gdb_load $execr_binfile gdb_test_no_output "set displaced-stepping $displaced_stepping" diff --git a/gdb/testsuite/gdb.threads/step-over-thread-exit-while-stop-all-threads.exp b/gdb/testsuite/gdb.threads/step-over-thread-exit-while-stop-all-threads.exp index cf10bdc8a2a..fdd2b2705f4 100644 --- a/gdb/testsuite/gdb.threads/step-over-thread-exit-while-stop-all-threads.exp +++ b/gdb/testsuite/gdb.threads/step-over-thread-exit-while-stop-all-threads.exp @@ -29,7 +29,7 @@ if { [build_executable "failed to prepare" $testfile \ proc test {displaced-stepping target-non-stop} { save_vars ::GDBFLAGS { append ::GDBFLAGS " -ex \"maintenance set target-non-stop ${target-non-stop}\"" - clean_restart $::binfile + clean_restart $::testfile } gdb_test_no_output "set displaced-stepping ${displaced-stepping}" diff --git a/gdb/testsuite/gdb.threads/step-over-thread-exit.exp b/gdb/testsuite/gdb.threads/step-over-thread-exit.exp index 31037a7af98..8ed2b2128a5 100644 --- a/gdb/testsuite/gdb.threads/step-over-thread-exit.exp +++ b/gdb/testsuite/gdb.threads/step-over-thread-exit.exp @@ -55,7 +55,7 @@ proc test {step_over_mode non-stop target-non-stop schedlock cmd ns_stop_all} { save_vars ::GDBFLAGS { append ::GDBFLAGS " -ex \"maintenance set target-non-stop ${target-non-stop}\"" append ::GDBFLAGS " -ex \"set non-stop ${non-stop}\"" - clean_restart $::binfile + clean_restart $::testfile } if { $step_over_mode == "none" } { diff --git a/gdb/testsuite/gdb.threads/stepi-over-clone.exp b/gdb/testsuite/gdb.threads/stepi-over-clone.exp index 5da123ec854..d6f1680900f 100644 --- a/gdb/testsuite/gdb.threads/stepi-over-clone.exp +++ b/gdb/testsuite/gdb.threads/stepi-over-clone.exp @@ -106,7 +106,7 @@ proc test {non_stop displaced third_thread} { save_vars { GDBFLAGS } { append GDBFLAGS " -ex \"set non-stop $non_stop\"" append GDBFLAGS " -ex \"set displaced $displaced\"" - clean_restart $binfile + clean_restart $::testfile } runto_main diff --git a/gdb/testsuite/gdb.threads/switch-threads.exp b/gdb/testsuite/gdb.threads/switch-threads.exp index d43603cbb07..1f67a450a82 100644 --- a/gdb/testsuite/gdb.threads/switch-threads.exp +++ b/gdb/testsuite/gdb.threads/switch-threads.exp @@ -29,7 +29,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab return -1 } -clean_restart ${binfile} +clean_restart ${::testfile} runto_main diff --git a/gdb/testsuite/gdb.threads/thread-bp-deleted.exp b/gdb/testsuite/gdb.threads/thread-bp-deleted.exp index 8cabb709c0c..80012299d99 100644 --- a/gdb/testsuite/gdb.threads/thread-bp-deleted.exp +++ b/gdb/testsuite/gdb.threads/thread-bp-deleted.exp @@ -38,7 +38,7 @@ set is_remote \ # This test requires background execution, which relies on non-stop mode. save_vars { GDBFLAGS } { append GDBFLAGS " -ex \"maint set target-non-stop on\"" - clean_restart ${binfile} + clean_restart ${::testfile} } if {![runto_main]} { diff --git a/gdb/testsuite/gdb.threads/thread-execl.exp b/gdb/testsuite/gdb.threads/thread-execl.exp index 04ba518027d..13a6ef4f378 100644 --- a/gdb/testsuite/gdb.threads/thread-execl.exp +++ b/gdb/testsuite/gdb.threads/thread-execl.exp @@ -35,7 +35,7 @@ proc do_test { schedlock } { set prefix "schedlock $schedlock" } with_test_prefix "$prefix" { - clean_restart ${binfile} + clean_restart ${::testfile} if {$schedlock == "non-stop"} { gdb_test_no_output "set non-stop 1" diff --git a/gdb/testsuite/gdb.threads/thread-find.exp b/gdb/testsuite/gdb.threads/thread-find.exp index 456f7d335d3..171b94b5a93 100644 --- a/gdb/testsuite/gdb.threads/thread-find.exp +++ b/gdb/testsuite/gdb.threads/thread-find.exp @@ -21,7 +21,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab return -1 } -clean_restart ${binfile} +clean_restart ${::testfile} gdb_test_no_output "set print sevenbit-strings" runto_main diff --git a/gdb/testsuite/gdb.threads/thread-specific-bp.exp b/gdb/testsuite/gdb.threads/thread-specific-bp.exp index c4858f2f4f6..8f48b61eb6c 100644 --- a/gdb/testsuite/gdb.threads/thread-specific-bp.exp +++ b/gdb/testsuite/gdb.threads/thread-specific-bp.exp @@ -118,7 +118,7 @@ proc check_thread_specific_breakpoint {non_stop} { foreach_with_prefix non_stop {on off} { save_vars { GDBFLAGS } { append GDBFLAGS " -ex \"set non-stop $non_stop\"" - clean_restart $binfile + clean_restart $::testfile } check_thread_specific_breakpoint $non_stop diff --git a/gdb/testsuite/gdb.threads/thread-specific.exp b/gdb/testsuite/gdb.threads/thread-specific.exp index bf9c63b5e9e..d1e6f4dea5a 100644 --- a/gdb/testsuite/gdb.threads/thread-specific.exp +++ b/gdb/testsuite/gdb.threads/thread-specific.exp @@ -62,7 +62,7 @@ proc get_thread_list { } { return $thr_list } -clean_restart ${binfile} +clean_restart ${::testfile} gdb_test_no_output "set print sevenbit-strings" gdb_test_no_output "set width 0" diff --git a/gdb/testsuite/gdb.threads/thread-unwindonsignal.exp b/gdb/testsuite/gdb.threads/thread-unwindonsignal.exp index 5f4ac1f6ecb..dc74714d45e 100644 --- a/gdb/testsuite/gdb.threads/thread-unwindonsignal.exp +++ b/gdb/testsuite/gdb.threads/thread-unwindonsignal.exp @@ -28,7 +28,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab return -1 } -clean_restart ${binfile} +clean_restart ${::testfile} if { ![runto_main] } { return 0 diff --git a/gdb/testsuite/gdb.threads/thread_check.exp b/gdb/testsuite/gdb.threads/thread_check.exp index ee5f35a8a4f..9f92066bddd 100644 --- a/gdb/testsuite/gdb.threads/thread_check.exp +++ b/gdb/testsuite/gdb.threads/thread_check.exp @@ -39,7 +39,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab } -clean_restart ${binfile} +clean_restart ${::testfile} if {![runto_main]} { return 1 diff --git a/gdb/testsuite/gdb.threads/threadapply.exp b/gdb/testsuite/gdb.threads/threadapply.exp index 9110617b7e1..34de56194f6 100644 --- a/gdb/testsuite/gdb.threads/threadapply.exp +++ b/gdb/testsuite/gdb.threads/threadapply.exp @@ -25,7 +25,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab return -1 } -clean_restart ${binfile} +clean_restart ${::testfile} # # Run to `main' where we begin our tests. @@ -73,7 +73,7 @@ proc thr_apply_detach {thread_set} { global binfile global break_line - clean_restart ${binfile} + clean_restart ${::testfile} if ![runto_main] { return -1 @@ -112,7 +112,7 @@ proc kill_and_remove_inferior {thread_set} { set any "\[^\r\n\]*" set ws "\[ \t\]\+" - clean_restart ${binfile} + clean_restart ${::testfile} with_test_prefix "start inferior 1" { runto_main diff --git a/gdb/testsuite/gdb.threads/threadcrash.exp b/gdb/testsuite/gdb.threads/threadcrash.exp index 15d2a2041cf..76d2c6c2541 100644 --- a/gdb/testsuite/gdb.threads/threadcrash.exp +++ b/gdb/testsuite/gdb.threads/threadcrash.exp @@ -237,7 +237,7 @@ proc_with_prefix test_corefile {} { proc_with_prefix test_gcore {} { - clean_restart "$::binfile" + clean_restart "$::testfile" gdb_test "handle SIGUSR1 nostop print pass" \ ".*SIGUSR1.*No.*Yes.*Yes.*User defined signal 1" \ @@ -275,7 +275,7 @@ if [prepare_for_testing "failed to prepare" $testfile $srcfile \ return -1 } -clean_restart ${binfile} +clean_restart ${::testfile} gdb_test_no_output "set backtrace limit unlimited" diff --git a/gdb/testsuite/gdb.threads/threxit-hop-specific.exp b/gdb/testsuite/gdb.threads/threxit-hop-specific.exp index ce2df7c701b..b55e80cdb2d 100644 --- a/gdb/testsuite/gdb.threads/threxit-hop-specific.exp +++ b/gdb/testsuite/gdb.threads/threxit-hop-specific.exp @@ -23,7 +23,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ return -1 } -clean_restart ${binfile} +clean_restart ${::testfile} runto_main diff --git a/gdb/testsuite/gdb.threads/tls-core.exp b/gdb/testsuite/gdb.threads/tls-core.exp index 96b1c6a2b62..587ae61e1a9 100644 --- a/gdb/testsuite/gdb.threads/tls-core.exp +++ b/gdb/testsuite/gdb.threads/tls-core.exp @@ -27,7 +27,7 @@ set core_supported [expr {$corefile != ""}] # Generate a core file with "gcore". -clean_restart ${binfile} +clean_restart ${::testfile} runto thread_proc @@ -43,7 +43,7 @@ proc tls_core_test {supported corefile} { upvar host_triplet host_triplet upvar binfile binfile - clean_restart ${binfile} + clean_restart ${::testfile} set test "load core file" if {$supported} { diff --git a/gdb/testsuite/gdb.threads/tls-nodebug-pie.exp b/gdb/testsuite/gdb.threads/tls-nodebug-pie.exp index 01abcfac205..44c12f5663d 100644 --- a/gdb/testsuite/gdb.threads/tls-nodebug-pie.exp +++ b/gdb/testsuite/gdb.threads/tls-nodebug-pie.exp @@ -20,7 +20,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab return -1 } -clean_restart ${binfile} +clean_restart ${::testfile} if {![runto_main]} { return 0 } diff --git a/gdb/testsuite/gdb.threads/tls-nodebug.exp b/gdb/testsuite/gdb.threads/tls-nodebug.exp index ebfa7520066..971f26c269c 100644 --- a/gdb/testsuite/gdb.threads/tls-nodebug.exp +++ b/gdb/testsuite/gdb.threads/tls-nodebug.exp @@ -26,7 +26,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab return -1 } -clean_restart ${binfile} +clean_restart ${::testfile} if {![runto_main]} { return 0 } diff --git a/gdb/testsuite/gdb.threads/tls-shared.exp b/gdb/testsuite/gdb.threads/tls-shared.exp index 35596bce7b3..b7fa965f6ff 100644 --- a/gdb/testsuite/gdb.threads/tls-shared.exp +++ b/gdb/testsuite/gdb.threads/tls-shared.exp @@ -29,7 +29,7 @@ if { [gdb_compile_shlib_pthreads ${srcdir}/${subdir}/${srcfile_lib} ${binfile_li } -clean_restart ${binfile} +clean_restart ${::testfile} gdb_load_shlib ${binfile_lib} if {![runto_main]} { diff --git a/gdb/testsuite/gdb.threads/tls-so_extern.exp b/gdb/testsuite/gdb.threads/tls-so_extern.exp index 3cef6721866..a0aa5f86bf2 100644 --- a/gdb/testsuite/gdb.threads/tls-so_extern.exp +++ b/gdb/testsuite/gdb.threads/tls-so_extern.exp @@ -28,7 +28,7 @@ if { [gdb_compile_shlib_pthreads ${srcdir}/${subdir}/${srcfile_lib} ${binfile_li } -clean_restart ${binfile} +clean_restart ${::testfile} gdb_load_shlib ${binfile_lib} if {![runto_main]} { diff --git a/gdb/testsuite/gdb.threads/tls.exp b/gdb/testsuite/gdb.threads/tls.exp index 73fada7bcd1..4b433871eb7 100644 --- a/gdb/testsuite/gdb.threads/tls.exp +++ b/gdb/testsuite/gdb.threads/tls.exp @@ -153,7 +153,7 @@ proc check_thread_stack {number spin_threads spin_threads_level} { } } -clean_restart ${binfile} +clean_restart ${::testfile} gdb_test_multiple "print a_thread_local" "" { -re -wrap "Cannot find thread-local variables on this target" { diff --git a/gdb/testsuite/gdb.threads/vfork-follow-child-exec.exp b/gdb/testsuite/gdb.threads/vfork-follow-child-exec.exp index 0b95a75c132..7c2b3093640 100644 --- a/gdb/testsuite/gdb.threads/vfork-follow-child-exec.exp +++ b/gdb/testsuite/gdb.threads/vfork-follow-child-exec.exp @@ -30,7 +30,7 @@ if {[build_executable "failed to prepare" $testfile $srcfile {debug pthreads}]} proc test_vfork {detach} { global binfile - clean_restart $binfile + clean_restart $::testfile if {![runto_main]} { return 0 diff --git a/gdb/testsuite/gdb.threads/vfork-follow-child-exit.exp b/gdb/testsuite/gdb.threads/vfork-follow-child-exit.exp index ced52dfa964..a5e7475e474 100644 --- a/gdb/testsuite/gdb.threads/vfork-follow-child-exit.exp +++ b/gdb/testsuite/gdb.threads/vfork-follow-child-exit.exp @@ -30,7 +30,7 @@ if {[build_executable "failed to prepare" $testfile $srcfile {debug pthreads}]} proc test_vfork {detach} { global binfile - clean_restart $binfile + clean_restart $::testfile if {![runto_main]} { return 0 diff --git a/gdb/testsuite/gdb.threads/vfork-multi-thread.exp b/gdb/testsuite/gdb.threads/vfork-multi-thread.exp index 61811aed725..fce974bf780 100644 --- a/gdb/testsuite/gdb.threads/vfork-multi-thread.exp +++ b/gdb/testsuite/gdb.threads/vfork-multi-thread.exp @@ -59,7 +59,7 @@ proc do_test { target-non-stop non-stop follow-fork-mode detach-on-fork schedule save_vars { ::GDBFLAGS } { append ::GDBFLAGS " -ex \"maintenance set target-non-stop ${target-non-stop}\"" append ::GDBFLAGS " -ex \"set non-stop ${non-stop}\"" - clean_restart ${::binfile} + clean_restart ${::testfile} } gdb_test_no_output "set follow-fork-mode ${follow-fork-mode}" diff --git a/gdb/testsuite/gdb.threads/watchthreads.exp b/gdb/testsuite/gdb.threads/watchthreads.exp index 49fc7626581..f3ec7f4c1e8 100644 --- a/gdb/testsuite/gdb.threads/watchthreads.exp +++ b/gdb/testsuite/gdb.threads/watchthreads.exp @@ -31,7 +31,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab return -1 } -clean_restart $binfile +clean_restart $::testfile gdb_test_no_output "set can-use-hw-watchpoints 1" "" # diff --git a/gdb/testsuite/gdb.threads/watchthreads2.exp b/gdb/testsuite/gdb.threads/watchthreads2.exp index 2426be48159..19a60e47ddd 100644 --- a/gdb/testsuite/gdb.threads/watchthreads2.exp +++ b/gdb/testsuite/gdb.threads/watchthreads2.exp @@ -31,7 +31,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab return -1 } -clean_restart ${binfile} +clean_restart ${::testfile} gdb_test_no_output "set can-use-hw-watchpoints 1" "" diff --git a/gdb/testsuite/gdb.threads/wp-replication.exp b/gdb/testsuite/gdb.threads/wp-replication.exp index 68f5eb0b508..8a5f95d6b51 100644 --- a/gdb/testsuite/gdb.threads/wp-replication.exp +++ b/gdb/testsuite/gdb.threads/wp-replication.exp @@ -34,7 +34,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab return -1 } -clean_restart ${binfile} +clean_restart ${::testfile} # Force hardware watchpoints to be used. gdb_test_no_output "set can-use-hw-watchpoints 1" "" -- 2.47.3