old-cross-binutils/gdb/testsuite/lib
Pedro Alves 6423214fcb testsuite: Don't use expect_background to reap gdbserver
I adjusted a test to do 'expect -i $server_spawn_id -re ...', and saw
really strange behavior.  Whether that expect would work, depended on
whether GDB would also send output and the same expect matched it too
(on $gdb_spawn_id).  I was perplexed until I noticed that
gdbserver_spawn spawns gdbserver and then uses expect_background to
reap gdbserver.  That expect_background conflicts/races with any
"expect -i $server_spawn_id" done anywhere else in parallel...

In order to make it possible for tests to read inferior I/O out of
$server_spawn_id, we to get rid of that expect_background.  This patch
makes us instead reap gdbserver's spawn id when GDB exits.  If GDB is
still around, this gives a chance for gdbserver to exit cleanly.  The
current code in gdb_finish uses "kill", but that doesn't work with
extended-remote (gdbserver doesn't exit).  We now use "monitor exit"
instead which works in both remote and extended-remote modes.

gdb/testsuite/ChangeLog:
2015-04-07  Pedro Alves  <palves@redhat.com>

	* lib/gdb.exp (gdb_finish): Delete persistent gdbserver handling.
	* lib/gdbserver-support.exp (gdbserver_start): Make
	$server_spawn_id global.
	(gdbserver_start): Don't wait for gdbserver's spawn id with
	expect_background.
	(close_gdbserver): New procedure.
	(gdb_exit): Rename the default version and reimplement.
2015-04-07 18:27:55 +01:00
..
ada.exp
append_gdb_boards_dir.exp
cache.exp
cell.exp
cl_util.c
cl_util.h
compiler.c
compiler.cc
cp-support.exp
d-support.exp
dtrace.exp
dwarf.exp dwarf.exp: Allow generating a stub .debug_line section 2015-03-31 16:25:07 +02:00
fortran.exp
future.exp
gdb-guile.exp
gdb-python.exp
gdb-utils.exp
gdb.exp testsuite: Don't use expect_background to reap gdbserver 2015-04-07 18:27:55 +01:00
gdbserver-support.exp testsuite: Don't use expect_background to reap gdbserver 2015-04-07 18:27:55 +01:00
go.exp
java.exp
mi-support.exp Accept all-stop alternative in mi_expect_interrupt 2015-03-04 17:56:58 -05:00
objc.exp
opencl.exp
opencl_hostapp.c
opencl_kernel.cl
pascal.exp * lib/pascal.exp (gpc_compile): Rename dest arg to destfile. 2015-04-06 08:45:06 -07:00
pdtrace.in
perftest.exp
prelink-support.exp
prompt.exp
range-stepping-support.exp
read1.c
selftest-support.exp
set_unbuffered_mode.c
trace-support.exp
unbuffer_output.c Add "../lib/unbuffer_output.c" and use it in gdb.base/interrupt.c 2015-02-27 13:54:22 +00:00