This is the mail archive of the
gdb-testers@sourceware.org
mailing list for the GDB project.
[binutils-gdb] testsuite: Don't use expect_background to reap gdbserver
- From: sergiodj+buildbot at redhat dot com
- To: gdb-testers at sourceware dot org
- Date: Tue, 07 Apr 2015 15:18:36 -0400
- Subject: [binutils-gdb] testsuite: Don't use expect_background to reap gdbserver
- Authentication-results: sourceware.org; auth=none
*** TEST RESULTS FOR COMMIT 6423214fcb912a5d402ffcb84d6f61f2b900a900 ***
Author: Pedro Alves <palves@redhat.com>
Branch: master
Commit: 6423214fcb912a5d402ffcb84d6f61f2b900a900
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.
- Follow-Ups:
- Failures on Fedora-ppc64be-cc-with-index, branch master
- Failures on Fedora-s390x-m64, branch master
- Failures on Fedora-ppc64be-native-extended-gdbserver-m64, branch master
- Failures on Debian-x86_64-native-extended-gdbserver-m64, branch master
- Failures on Fedora-x86_64-m32, branch master
- Failures on Debian-i686-native-gdbserver, branch master
- Failures on Fedora-x86_64-native-extended-gdbserver-m32, branch master
- Failures on Fedora-x86_64-cc-with-index, branch master
- Failures on Fedora-x86_64-native-extended-gdbserver-m64, branch master
- Failures on Debian-x86_64-native-gdbserver-m64, branch master
- Failures on Fedora-x86_64-native-gdbserver-m64, branch master
- Failures on Fedora-x86_64-m64, branch master
- Failures on Fedora-x86_64-native-gdbserver-m32, branch master
- Failures on Fedora-i686, branch master
- Failures on Fedora-ppc64le-cc-with-index, branch master
- Failures on Fedora-ppc64le-m64, branch master