8sa1-binutils-gdb/gdb/testsuite/lib
Tom de Vries f32682eaca [gdb/testsuite] Fix silent timeout in gdb.multi/multi-target.exp
While running test-case gdb.multi/multi-target.exp, I observed a silent
timeout related to "monitor exit".

By making the timeout explicit in an expect clause in gdbserver_gdb_exit:
...
+  timeout {
+    warning "Timed out waiting for EOF in server after $monitor_exit"
+  }
...
we get in the log:
...
monitor exit^M
"monitor" command not supported by this target.^M
(gdb) WARNING: Timed out waiting for EOF in server after monitor exit
...

What happens is the following:
- the inferior 5 is selected
- a breakpoint is set in inferior 1
- the breakpoint triggers and we switch to inferior 1
- setup is called by test_continue, which calls clean_restart, which calls
  gdbserver_gdb_exit (due to load_lib gdbserver-support.exp)
- gdbserver_gdb_exit issues "monitor exit"
- gdb responds with "not supported by this target" because inferior 1 is
  native

Fix this by keeping a list of server_spawn_id, and cleaning those up before
calling gdbserver_gdb_exit.

This reduces testing time from 1m22s to 32s.

gdb/testsuite/ChangeLog:

2020-04-02  Tom de Vries  <tdevries@suse.de>

	* lib/gdbserver-support.exp (gdbserver_exit): Factor out of ...
	(gdbserver_gdb_exit): ... here.  Add timeout warning.
	* gdb.multi/multi-target.exp (server_spawn_ids): New global var.
	(connect_target_extended_remote): Append new server_spawn_id to
	server_spawn_ids.
	(cleanup): New proc.
	(setup, <toplevel>): Call cleanup.
2020-04-02 09:46:00 +02:00
..
ada.exp
append_gdb_boards_dir.exp
build-piece.exp
cache.exp [gdb/testsuite] Add cache_verify option for gdb_caching_procs 2020-03-16 14:39:07 +01:00
cl_util.c
cl_util.h
compile-support.exp
compiler.c
compiler.cc
completion-support.exp [gdb/testsuite] Give up after consecutive timeouts in completion-support.exp 2020-03-17 08:56:35 +01:00
cp-support.exp
d-support.exp
data-structures.exp
dtrace.exp
dwarf.exp gdb/testsuite: Add is-stmt support to the DWARF compiler 2020-03-10 22:32:05 +00:00
fortran.exp gdb.fortran: Allow Flang kind printing in fortran testing 2020-03-04 17:16:52 +05:30
future.exp
gdb-guile.exp
gdb-python.exp
gdb-utils.exp
gdb.exp [gdb/testsuite] Fix c-linkage-name.exp with {cc-with-gdb-index,readnow}.exp 2020-03-30 10:52:59 +02:00
gdbserver-support.exp [gdb/testsuite] Fix silent timeout in gdb.multi/multi-target.exp 2020-04-02 09:46:00 +02:00
gen-perf-test.exp
gnat_debug_info_test.adb
go.exp
memory.exp
mi-support.exp [gdb/testsuite] Remove unused globals 2020-02-27 14:27:09 +01:00
objc.exp
opencl_hostapp.c
opencl_kernel.cl
opencl.exp
pascal.exp
pdtrace.in
perftest.exp
prelink-support.exp
prompt.exp [gdb/testsuite] Remove unused globals 2020-02-27 14:27:09 +01:00
range-stepping-support.exp
read1.c
rust-support.exp
selftest-support.exp
set_unbuffered_mode.c
sym-info-cmds.exp
trace-support.exp Update libinproctrace.so path in lib/trace-support.exp 2020-02-28 18:58:37 -05:00
tuiterm.exp [gdb/testsuite] Fix check-read1 FAIL in gdb.tui/corefile-run.exp 2020-03-13 00:31:15 +01:00
unbuffer_output.c
valgrind.exp