return -1
}
- # Start the program running and then wait for a bit, to be sure
- # that it can be attached to.
-
- set testpid [eval exec $binfile &]
-
- # Avoid some race:
- sleep 2
+ set test_spawn_id [spawn_wait_for_attach $binfile]
+ set testpid [spawn_id_get_pid $test_spawn_id]
# Stop the program
remote_exec build "kill -s STOP ${testpid}"
# the Linux kernel version. The behavior is not tested as it is not
# dependent on GDB.
- remote_exec build "kill -9 ${testpid}"
+ kill_wait_spawned_process $test_spawn_id
}
# build the test case first without threads