diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 42484fa588..d5ff0026aa 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2021-03-19 Kevin Buettner + + * lib/gdbserver-support.exp (gdbserver_exit): Use the + "-nowait" flag when waiting for gdbserver to exit. + 2021-03-19 Sourabh Singh Tomar * gdb.base/info-macros.exp: Append -fdebug-macro to diff --git a/gdb/testsuite/lib/gdbserver-support.exp b/gdb/testsuite/lib/gdbserver-support.exp index 7b48b5a839..08866349e2 100644 --- a/gdb/testsuite/lib/gdbserver-support.exp +++ b/gdb/testsuite/lib/gdbserver-support.exp @@ -421,7 +421,12 @@ proc close_gdbserver {} { verbose "Quitting GDBserver" catch "close -i $server_spawn_id" - catch "wait -i $server_spawn_id" + + # If gdbserver misbehaves, and ignores the close, waiting for it + # without the -nowait flag will cause testing to hang. Passing + # -nowait makes expect tell Tcl to wait for the process in the + # background. + catch "wait -nowait -i $server_spawn_id" unset server_spawn_id }