]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp
testsuite: tcl exec& -> 'kill -9 $pid' is racy (attach-many-short-lived-thread.exp...
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.threads / attach-many-short-lived-threads.exp
index 2c2236da2e9588e53dec6ca752e029d547dd396b..84e005ffcb57d3014ddb5dcc0a00b5fbbba72ef0 100644 (file)
@@ -36,7 +36,8 @@ proc test {} {
 
     clean_restart ${binfile}
 
-    set testpid [spawn_wait_for_attach $binfile]
+    set test_spawn_id [spawn_wait_for_attach $binfile]
+    set testpid [spawn_id_get_pid $test_spawn_id]
 
     set attempts 10
     for {set attempt 1} { $attempt <= $attempts } { incr attempt } {
@@ -127,8 +128,7 @@ proc test {} {
            delete_breakpoints
        }
     }
-
-    remote_exec target "kill -9 ${testpid}"
+    kill_wait_spawned_process $test_spawn_id
 }
 
 # The test program exits after a while, in case GDB crashes.  Make it