-# Copyright (C) 2015-2016 Free Software Foundation, Inc.
+# Copyright (C) 2015-2021 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
standard_testfile
-proc do_test { detach_on_fork } {
+proc do_test { detach-on-fork } {
global GDBFLAGS
global srcfile testfile
global gdb_prompt
return 0
}
- gdb_test_no_output "set detach-on-fork $detach_on_fork"
+ gdb_test_no_output "set detach-on-fork ${detach-on-fork}"
set test "continue &"
gdb_test_multiple $test $test {
-re "$gdb_prompt " {
set saw_thread_stopped 1
exp_continue
}
+ -re "(Thread|LWP) \[^\r\n\]+ exited" {
+ # Avoid timeout with check-read1
+ exp_continue
+ }
+ -re "New (Thread|LWP) \[^\r\n\]+" {
+ # Avoid timeout with check-read1
+ exp_continue
+ }
-re "Inferior 1 \(\[^\r\n\]+\) exited normally" {
pass $test
}
"no threads left"
gdb_test "info inferiors" \
- "Num\[ \t\]+Description\[ \t\]+Executable\[ \t\]+\r\n\\* 1 \[^\r\n\]+" \
+ "Num\[ \t\]+Description\[ \t\]+Connection\[ \t\]+Executable\[ \t\]+\r\n\\* 1 \[^\r\n\]+" \
"only inferior 1 left"
}
-foreach detach_on_fork {"on" "off"} {
- with_test_prefix "detach-on-fork=$detach_on_fork" {
- do_test $detach_on_fork
- }
+foreach_with_prefix detach-on-fork {"on" "off"} {
+ do_test ${detach-on-fork}
}