]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Fix clean_restart <absolute filename> in gdb.threads
authorTom de Vries <tdevries@suse.de>
Tue, 2 Sep 2025 12:42:05 +0000 (14:42 +0200)
committerTom de Vries <tdevries@suse.de>
Tue, 2 Sep 2025 12:42:05 +0000 (14:42 +0200)
Fix clean_restart <absolute filename> in the test-cases in gdb.threads.

Tested on x86_64-linux.

78 files changed:
gdb/testsuite/gdb.threads/access-mem-running-thread-exit.exp
gdb/testsuite/gdb.threads/async.exp
gdb/testsuite/gdb.threads/attach-non-stop.exp
gdb/testsuite/gdb.threads/attach-stopped.exp
gdb/testsuite/gdb.threads/bp_in_thread.exp
gdb/testsuite/gdb.threads/break-while-running.exp
gdb/testsuite/gdb.threads/check-libthread-db.exp
gdb/testsuite/gdb.threads/detach-step-over.exp
gdb/testsuite/gdb.threads/execl.exp
gdb/testsuite/gdb.threads/foll-fork-other-thread.exp
gdb/testsuite/gdb.threads/fork-child-threads.exp
gdb/testsuite/gdb.threads/fork-thread-pending.exp
gdb/testsuite/gdb.threads/forking-threads-plus-breakpoint.exp
gdb/testsuite/gdb.threads/hand-call-in-threads.exp
gdb/testsuite/gdb.threads/inf-thr-count.exp
gdb/testsuite/gdb.threads/infcall-from-bp-cond-other-thread-event.exp
gdb/testsuite/gdb.threads/infcall-from-bp-cond-simple.exp
gdb/testsuite/gdb.threads/infcall-from-bp-cond-single.exp
gdb/testsuite/gdb.threads/infcall-from-bp-cond-timeout.exp
gdb/testsuite/gdb.threads/info-threads-options.exp
gdb/testsuite/gdb.threads/interrupt-while-step-over.exp
gdb/testsuite/gdb.threads/interrupted-hand-call.exp
gdb/testsuite/gdb.threads/killed.exp
gdb/testsuite/gdb.threads/leader-exit-attach.exp
gdb/testsuite/gdb.threads/linux-dp.exp
gdb/testsuite/gdb.threads/local-watch-wrong-thread.exp
gdb/testsuite/gdb.threads/main-thread-exit-during-detach.exp
gdb/testsuite/gdb.threads/manythreads.exp
gdb/testsuite/gdb.threads/multi-create.exp
gdb/testsuite/gdb.threads/multiple-successive-infcall.exp
gdb/testsuite/gdb.threads/next-bp-other-thread.exp
gdb/testsuite/gdb.threads/next-fork-exec-other-thread.exp
gdb/testsuite/gdb.threads/next-fork-other-thread.exp
gdb/testsuite/gdb.threads/pending-fork-event-detach-ns.exp
gdb/testsuite/gdb.threads/pending-fork-event-detach.exp
gdb/testsuite/gdb.threads/pending-step.exp
gdb/testsuite/gdb.threads/print-threads.exp
gdb/testsuite/gdb.threads/process-dies-while-detaching.exp
gdb/testsuite/gdb.threads/process-dies-while-handling-bp.exp
gdb/testsuite/gdb.threads/pthread_cond_wait.exp
gdb/testsuite/gdb.threads/pthreads.exp
gdb/testsuite/gdb.threads/queue-signal.exp
gdb/testsuite/gdb.threads/schedlock-new-thread.exp
gdb/testsuite/gdb.threads/schedlock-thread-exit.exp
gdb/testsuite/gdb.threads/signal-command-handle-nopass.exp
gdb/testsuite/gdb.threads/signal-command-multiple-signals-pending.exp
gdb/testsuite/gdb.threads/signal-delivered-right-thread.exp
gdb/testsuite/gdb.threads/signal-sigtrap.exp
gdb/testsuite/gdb.threads/sigthread.exp
gdb/testsuite/gdb.threads/staticthreads.exp
gdb/testsuite/gdb.threads/step-N-all-progress.exp
gdb/testsuite/gdb.threads/step-over-exec.exp
gdb/testsuite/gdb.threads/step-over-thread-exit-while-stop-all-threads.exp
gdb/testsuite/gdb.threads/step-over-thread-exit.exp
gdb/testsuite/gdb.threads/stepi-over-clone.exp
gdb/testsuite/gdb.threads/switch-threads.exp
gdb/testsuite/gdb.threads/thread-bp-deleted.exp
gdb/testsuite/gdb.threads/thread-execl.exp
gdb/testsuite/gdb.threads/thread-find.exp
gdb/testsuite/gdb.threads/thread-specific-bp.exp
gdb/testsuite/gdb.threads/thread-specific.exp
gdb/testsuite/gdb.threads/thread-unwindonsignal.exp
gdb/testsuite/gdb.threads/thread_check.exp
gdb/testsuite/gdb.threads/threadapply.exp
gdb/testsuite/gdb.threads/threadcrash.exp
gdb/testsuite/gdb.threads/threxit-hop-specific.exp
gdb/testsuite/gdb.threads/tls-core.exp
gdb/testsuite/gdb.threads/tls-nodebug-pie.exp
gdb/testsuite/gdb.threads/tls-nodebug.exp
gdb/testsuite/gdb.threads/tls-shared.exp
gdb/testsuite/gdb.threads/tls-so_extern.exp
gdb/testsuite/gdb.threads/tls.exp
gdb/testsuite/gdb.threads/vfork-follow-child-exec.exp
gdb/testsuite/gdb.threads/vfork-follow-child-exit.exp
gdb/testsuite/gdb.threads/vfork-multi-thread.exp
gdb/testsuite/gdb.threads/watchthreads.exp
gdb/testsuite/gdb.threads/watchthreads2.exp
gdb/testsuite/gdb.threads/wp-replication.exp

index fec31c3203a2e4301fc1cfdbfa6abbf9698115a1..6846b3881a2de93e5a5b305c9a7abce39439cd07 100644 (file)
@@ -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] {
index b1e562a29b5db537d63d2ad3930972aa3138c3af..63473334e7014c678cd805afb64c6386d21b5bb9 100644 (file)
@@ -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
index 9404eddfadfdb306667fff6fdfc1a66f28993e7b..b8da5b144508a5de736d13ac975ce3facd1ac485 100644 (file)
@@ -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]
index e628adf2faa2ed0a22ce321e5f7354dc6f717345..a3926d94d3b93b20a143c0d52550cec022444a3e 100644 (file)
@@ -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.
        
index c63f17922cf8727ac97c184fa35bc3cc1536ccbe..5180c18dbec7210f026bfbe81a338b652d730b6f 100644 (file)
@@ -24,7 +24,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab
     return -1
 }
 
-clean_restart $binfile
+clean_restart $::testfile
 
 runto_main
 
index fbc2b59d195095478f779845ce581e4ec64edc08..fb7994d8d7cecbb1d4f3a5835becff08ee28f602 100644 (file)
@@ -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"
index b97ab4936d0f28c407371463f8873c3c1680e0ed..6d631852deb444c564ec2ebaa01e2cee899fae92 100644 (file)
@@ -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"
index 8a1cb292c3d0eac53f3cdf85efd0c742f35645a1..176746417b5c835723615bd733e97a37afd641ee 100644 (file)
@@ -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"
index 502d38706905f0cf3d572807851c3953cf91c2c9..a42dce95eed323017130024a891f877be9acdb15 100644 (file)
@@ -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
 }
index 8ab540c98c4b4e72ee15e3f52f0e21698d640709..29ec34cee666ae75c37a12e408a51e4fac7e294a 100644 (file)
@@ -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}"
index ba9dfc241f6c9f0a2f2609ecc57d1433dffb2777..d1b413c6429ebdea1bd778f3562dca481bdf93aa 100644 (file)
@@ -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
index 538e1ca6f3fbd077714ab43825caf40d8db9ed19..e0e3625ea3dece6f08f73938b32cbf60ca5ec180 100644 (file)
@@ -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
 }
index c668a6555226f983dabf88bfaf36c8bec9e0cc56..d65fe83d60683435275041edda8fcfbf173da6b8 100644 (file)
@@ -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]} {
index d1be1d0be63fc751c764001d5dec1d00714d77df..fd934f501780b709abd2185c88340908fdb0ee6d 100644 (file)
@@ -44,7 +44,7 @@ proc get_dummy_frame_number { } {
     return ""
 }
 
-clean_restart ${binfile}
+clean_restart ${::testfile}
 
 if { ![runto_main] } {
     return 0
index 61533ab38203806d8f5566356cbb063516f7ceeb..5272f5c901aa421077f2ff4a581f5c80aae63bd6 100644 (file)
@@ -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] {
index 62a183c9bc829a68c73a4472b3fca898b5f4c2dd..35a1fe5f06f13ad58a59788890f478fbfb889e4f 100644 (file)
@@ -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] } {
index 0f068c6f777db97292c5381869bcfe75bc9daa9c..ed9899821a195bd06051ad83d5b06b4f99344eb8 100644 (file)
@@ -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] } {
index c404a7d3895d51e3a34395ecd10c059b8b619c4e..bc12fb4f6ac4d2911fdf64be547546fb60a5415d 100644 (file)
@@ -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] } {
index 9dbaa4fce0b2ef90358feb508b863e220ed555fa..03c69599bf9babc2a11f5ee2fa7d68e882dc144a 100644 (file)
@@ -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]} {
index 38e4e67f08b69381a18fccd9102550aca138164e..e6c68e23d9264dfdafd6580b29800b28a3760761 100644 (file)
@@ -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] {
index 05587eb417a7e8e28215ad779a92ca5454b6237f..44e4d6405e19c4be5a03f27a188977d98c1c405e 100644 (file)
@@ -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"
index 3a2bc63ad65018d193e5b42fc92f52d4c1920070..15c48b175e529c358ac12bf1332177c2ad88f96d 100644 (file)
@@ -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
index b1cec80b0008e81fbf8a6430f8a543ded4cc866d..1fa83af5be2016216338ac93f37d6c997fa362c9 100644 (file)
@@ -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"
index 641d6b5823c07166e5ed91deb2d91ff584cd5b2e..2df4a18672791835d4dab8ef295f397fb0e9f7a4 100644 (file)
@@ -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.
index 1652f78a52a74da8b3cb740e60bd61cca4cf4c41..35cc255f1c758d044735c6389f0fb6340667d11d 100644 (file)
@@ -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
 
index 3006b833794491941748cc236f9b5e10496ef1ce..a63f0beed169218421db287d7f35f8c90884bb63 100644 (file)
@@ -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" ""
 
index 20e7bc470c56b232e4bad09f9aec745d4e05fbb4..1ce0194442cf679ca00ad131985ec561143b3cac 100644 (file)
@@ -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
index ae51c5a7dea2f8ad463c62157f861a5c8c815344..2cd296f31515ce171918c671025caecbe614609e 100644 (file)
@@ -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
 
index 966d44d185dcfdce2041dfb6f9926ec69df3a533..cb86aacc5bc98cb74238b97bb77125645d4bd589 100644 (file)
@@ -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
index 1aa925304d2ab00a3ade673c0e03bfb0e5efdf4a..2694ce58e89c47cb72a71e5cb5d3350f170499b1 100644 (file)
@@ -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
index cf8d6873440964349a9fd99621bf49df0154cedf..6b696ddf4558403ba6807aa846de4e1e3ac9c140 100644 (file)
@@ -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
index 3a971274784253c13f37c83da97ec284266709bf..82e85a6927104b010a4a9d58f773b5dc5cadf91e 100644 (file)
@@ -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}"
index 1cd6685215c4d14a7ef353d3c458782129374169..93490917fd80e67a86c7b7f1d4c49461f17fb4c0 100644 (file)
@@ -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}"
index 29a011e1a7ddfd68015b0054917e3b3d61a5c774..9cc4978acdd95a3976673c03d2e172ff93654fdd 100644 (file)
@@ -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] } {
index e627241caed46fb902663f609b60e516e252dfdd..fa8648823096344521385a1fd6236ba642be3086 100644 (file)
@@ -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]} {
index 1c2422efb80d7a9dab9f43f548ec41c956d5c68e..d31f87984cabad0bc5ffd245c975e4be7a49bcbd 100644 (file)
@@ -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
index 51a14b21f30185b44eff88298b79caeffc09b424..3d2dc1493bdaf05597712765db0e08d460f8f7cc 100644 (file)
@@ -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"
index 776c08e388d822baa82152f98f152293b6ea6f00..6c6a4b1938dda713711d6afef1ad3a34a07bcc1d 100644 (file)
@@ -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
     }
 
index 26dc8cce98a89ce8ee2591919014b7926f0ac34f..a990dc91a24a44e8620421e670be68e1e9b6bd7c 100644 (file)
@@ -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]} {
index c1be1cd8447e53b66f3ebb3f60f4914747b93c87..e914db054edd32592bf7ef454baada6d68b1068b 100644 (file)
@@ -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" \
index 0437e74bdf795e4186e1919d18d32c1e00660afa..04ae91e29d50531dc856f9e1bf2f734ab32421e3 100644 (file)
@@ -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"
index f791ffab9f6cfe8b49de917c13392cc881ebfb6d..34abc3b8dd0fb793831eaa8b237cc3239f88db5b 100644 (file)
@@ -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
index c3981375132e938c4b3543be4a32792791ee4d6b..5fda4b8859a05080392246456a56887ddb323977 100644 (file)
@@ -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"]
index 434b058772005252b575f10812b7e0da15025bba..137f65242f568429e435b84754b91c98fdf42137 100644 (file)
@@ -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.
index 2586800cc93fd4dd6c358aa97659df5b9135668a..6d344e3f652129ad0d2764b76bfb0067f102e3b0 100644 (file)
@@ -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
index 73f88c16d9ebf87eb48fb5e7b221d3f8daa50b39..acb018bc7ae79e4ee62d31fbb68c787d10e9143e 100644 (file)
@@ -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
index 7445cadc1bddcaee4d224991f4b8b14fceea437e..9de09084c7b751b646a8bb45214ddaf58cd46d28 100644 (file)
@@ -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
index 8154ddf2ee049ea46cd3eac4893b8142c2528d12..849d628d9f990f5e5bf4a38a1dc3d11bdd6bb8d2 100644 (file)
@@ -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
index 9d2f9b530eb98c1815804bfe1edcc7db02eff399..dea8eb8513d52bbc26fc68c488c7a5785885fae4 100644 (file)
@@ -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
index 0374666177ba29624acb7d6cd2af131cb1cddab2..bbe11abf8f38290967d046d03041a63075b48fd4 100644 (file)
@@ -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" != "" } {
index c874d79fbdd8fce870255f332bdcebc83161dc7b..031e36a7521e90f60b4876cab5bac89422dfaf99 100644 (file)
@@ -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] } {
index 7c553f2c19c9ab25e21186c433f52857bbabd794..b06f3a479e3d30cebed2465357d38bf00ae61a09 100644 (file)
@@ -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"
 
index cf10bdc8a2a14a83c86dbc3cc796f18f449031b6..fdd2b2705f402dd3502c674ed4b55572a906024b 100644 (file)
@@ -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}"
index 31037a7af9825f8d9255830d04947ab52ab9ce98..8ed2b2128a5e28b656ef0585ea9592cd08950a00 100644 (file)
@@ -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" } {
index 5da123ec854b27765b4576049abe6592c7f03568..d6f1680900ff98268eb4e0c10da77893ad18cdf9 100644 (file)
@@ -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
index d43603cbb0786b27936e71b24582b9c349efa490..1f67a450a82f7b645584e08bcc455d851093856a 100644 (file)
@@ -29,7 +29,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab
     return -1
 }
 
-clean_restart ${binfile}
+clean_restart ${::testfile}
 
 runto_main
 
index 8cabb709c0c3a67d29286fdffc9cb8e0f59faf36..80012299d99f1588d88103e7cd4223db1fb333b7 100644 (file)
@@ -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]} {
index 04ba518027db8ceaaacfd5ed596fe68421cfef19..13a6ef4f37872edd12f134f8118062f683936de0 100644 (file)
@@ -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"
index 456f7d335d32968c17d27570527c09f3dac0ed4c..171b94b5a93309671e2f083a586de01f3c89fabb 100644 (file)
@@ -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
 
index c4858f2f4f6e82208a7ded31d049c0d13c3ac4d2..8f48b61eb6ca214a29f9519a99c2f53c0519e97b 100644 (file)
@@ -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
index bf9c63b5e9ef63b72b6786b150eb2f36d140e266..d1e6f4dea5ab5baea3a51d31a154be17e7bd68fd 100644 (file)
@@ -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"
index 5f4ac1f6ecb3f14f77e35458f6f3a97cf86d86f7..dc74714d45e8af9937b621c4a7a3ad75e8f32857 100644 (file)
@@ -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
index ee5f35a8a4f0a72c2b10fa46f713bb2c289b6c06..9f92066bddd89a3bfdc423fed4fd42931f099049 100644 (file)
@@ -39,7 +39,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab
 }
 
 
-clean_restart ${binfile}
+clean_restart ${::testfile}
 
 if {![runto_main]} {
       return 1
index 9110617b7e10624e55a78ef8e8abb0e22ee2fa9b..34de56194f6cddc436173eac1ba93a94e38629a4 100644 (file)
@@ -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
index 15d2a2041cf260004d477994a256cb46ff3fa47a..76d2c6c2541eaf5ddd5590c3e6dee9d685729fdb 100644 (file)
@@ -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"
 
index ce2df7c701bd88582305c0ee7cbd4ee8b237d76b..b55e80cdb2d639c5afbcc5737e6671199b8e37f0 100644 (file)
@@ -23,7 +23,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
     return -1
 }
 
-clean_restart ${binfile}
+clean_restart ${::testfile}
 
 runto_main
 
index 96b1c6a2b621d8821bcaab6c5d95f90a7fec9a37..587ae61e1a9c9f8841126abc7a185436e9ee32a3 100644 (file)
@@ -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} {
index 01abcfac20513148375e038f5f03f17f53f76078..44c12f5663d1bc109c7b9b03f66a7eab2072bf2c 100644 (file)
@@ -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
 }
index ebfa752006638ee764c1c4db8f5021719b897c3f..971f26c269ce19a69d4383f8fdd4168cfb688896 100644 (file)
@@ -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
 }
index 35596bce7b3cfefbfa1886bf7ee10097617540a5..b7fa965f6ff41e2cf732f379bf949b1314ece2b6 100644 (file)
@@ -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]} {
index 3cef672186621ac0d765811692b64cb33af1c046..a0aa5f86bf236353d92b1c4f1c9e75592aa272fa 100644 (file)
@@ -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]} {
index 73fada7bcd18617472cb4ee235fe187ecd76b564..4b433871eb72e055fc245276ddb1963bfdd849ac 100644 (file)
@@ -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" {
index 0b95a75c132647d3b32ee7f6672cd03f05c7a01b..7c2b3093640f36272841f8c3e4e5e5f03674acb6 100644 (file)
@@ -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
index ced52dfa964643fdd48b915644a6929badd71447..a5e7475e474fa5faf8a17832895857c2369e72a4 100644 (file)
@@ -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
index 61811aed7250572da2aeb38eb00ff6de9377382b..fce974bf78012e3e4594f38a3197b8d2dee9f597 100644 (file)
@@ -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}"
index 49fc7626581b3ff8b6bb732a952493f2d12d461e..f3ec7f4c1e8327a6bcbaea61f7e1421a9e45e0c7 100644 (file)
@@ -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" ""
 
 #
index 2426be4815910ee98eb458af356c9f108b054ad5..19a60e47ddd32a219356d91b20869a185bda7eb5 100644 (file)
@@ -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" ""
 
index 68f5eb0b5085909f48e74332a0f17e8a4402a3e0..8a5f95d6b51758828827051414bc3156bc26c10f 100644 (file)
@@ -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" ""