testsuite: refactor spawn and wait for attach
authorPedro Alves <palves@redhat.com>
Thu, 11 Sep 2014 12:04:14 +0000 (13:04 +0100)
committerPedro Alves <palves@redhat.com>
Thu, 11 Sep 2014 12:04:14 +0000 (13:04 +0100)
commit4c92ff2c35392b68ee9172af979483b32aaa3d7b
treed0e6d784dc0924ee5c6aa2e5b9aa38cd56e2f4a0
parentbd9269f70c70b1218b0eb73a6f487d6ca481e5ac
testsuite: refactor spawn and wait for attach

Several places in the testsuite have a copy of a snippet of code that
spawns a test program, waits a bit, and then does some PID munging for
Cygwin.  This is in order to have GDB attach to the spawned program.

This refactors all that to a common procedure.

(multi-attach.exp wants to spawn multiple processes, so this makes the
new procedure's interface work with lists.)

Tested on x86_64 Fedora 20.

gdb/testsuite/ChangeLog:
2014-09-11  Pedro Alves  <palves@redhat.com>

* lib/gdb.exp (spawn_wait_for_attach): New procedure.
* gdb.base/attach.exp (do_attach_tests, do_call_attach_tests)
(do_command_attach_tests): Use spawn_wait_for_attach.
* gdb.base/solib-overlap.exp: Likewise.
* gdb.multi/multi-attach.exp: Likewise.
* gdb.python/py-prompt.exp: Likewise.
* gdb.python/py-sync-interp.exp: Likewise.
* gdb.server/ext-attach.exp: Likewise.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/attach.exp
gdb/testsuite/gdb.base/solib-overlap.exp
gdb/testsuite/gdb.multi/multi-attach.exp
gdb/testsuite/gdb.python/py-prompt.exp
gdb/testsuite/gdb.python/py-sync-interp.exp
gdb/testsuite/gdb.server/ext-attach.exp
gdb/testsuite/lib/gdb.exp