skip "attach" tests when testing against stub-like targets
authorPedro Alves <palves@redhat.com>
Fri, 9 Jan 2015 11:04:19 +0000 (11:04 +0000)
committerPedro Alves <palves@redhat.com>
Fri, 9 Jan 2015 11:04:19 +0000 (11:04 +0000)
commit60b3033e6e2936af6fcc37cf67cade99a89940ad
tree17c1b5534cd962559787f43ac2ee19e8f12a11d2
parent1710aab8af63e37c846efb7ed66e76dce95330ba
skip "attach" tests when testing against stub-like targets

We already skip "attach" tests if the target board is remote, in
dejagnu's sense, as we use TCL's exec to spawn the program on the
build machine.  We should also skip these tests if testing with
"target remote" or other stub-like targets where "attach" doesn't make
sense.

Add a helper procedure that centralizes the checks a test that needs
to spawn a program for testing "attach" and make all test files that
use spawn_wait_for_attach check it.

gdb/testsuite/
2015-01-09  Pedro Alves  <palves@redhat.com>

* lib/gdb.exp (can_spawn_for_attach): New procedure.
(spawn_wait_for_attach): Error out if can_spawn_for_attach returns
false.
* gdb.base/attach.exp: Use can_spawn_for_attach instead of
checking whether the target board is remote.
* gdb.multi/multi-attach.exp: Likewise.
* gdb.python/py-sync-interp.exp: Likewise.
* gdb.server/ext-attach.exp: Likewise.
* gdb.python/py-prompt.exp: Use can_spawn_for_attach before the
tests that need to attach, instead of checking whether the target
board is remote at the top of the file.
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