gdb, gdbserver: detach fork child when detaching from fork parent
[binutils-gdb.git] / gdb / testsuite / lib / gdb.exp
index 70fa2b3a8013540c992a6497914d1ba032313c6a..8b7445b758190909805b3b63a342ba29f3b47ba1 100644 (file)
@@ -8317,5 +8317,20 @@ proc require { fn arg1 {arg2 ""} } {
     return -code return 0
 }
 
+# Wait up to ::TIMEOUT seconds for file PATH to exist on the target system.
+# Return 1 if it does exist, 0 otherwise.
+
+proc target_file_exists_with_timeout { path } {
+    for {set i 0} {$i < $::timeout} {incr i} {
+       if { [remote_file target exists $path] } {
+           return 1
+       }
+
+       sleep 1
+    }
+
+    return 0
+}
+
 # Always load compatibility stuff.
 load_lib future.exp