diff options
author | Don Breazeal <donb@codesourcery.com> | 2015-01-15 10:47:31 -0800 |
---|---|---|
committer | Don Breazeal <donb@codesourcery.com> | 2015-01-15 10:59:57 -0800 |
commit | d221e7efd61fc80f6fbf862b7e32927835575329 (patch) | |
tree | 525812dabb6b89b31d5d31e1986c34d9080d236b /gdb/testsuite/gdb.base/attach-pie-noexec.exp | |
parent | cd21f5daad4335b50366b838664ade64bec29957 (diff) | |
download | binutils-gdb-d221e7efd61fc80f6fbf862b7e32927835575329.tar.gz |
Skip two more attach tests when testing against stub-like targets
This patch updates two attach tests to use utility procs for checking if
the attach test should run and for launching the program to be attached, as
follows:
1) Use can_spawn_for_attach instead of is_remote target
2) Use spawn_wait_for_attach instead of exec/sleep
Tested (1) with i686-mingw32 host and i686-pc-linux-gnu build/target and
both with x86_64 Ubuntu.
gdb/testsuite/ChangeLog:
* gdb.base/attach-pie-noexec.exp: Use can_spawn_for_attach
instead of checking whether the target board is remote and
use spawn_wait_for_attach instead of exec/sleep.
* gdb.base/attach-twice.exp: Likewise.
Diffstat (limited to 'gdb/testsuite/gdb.base/attach-pie-noexec.exp')
-rw-r--r-- | gdb/testsuite/gdb.base/attach-pie-noexec.exp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gdb/testsuite/gdb.base/attach-pie-noexec.exp b/gdb/testsuite/gdb.base/attach-pie-noexec.exp index f6aa1c8c21e..30a2f4d9de9 100644 --- a/gdb/testsuite/gdb.base/attach-pie-noexec.exp +++ b/gdb/testsuite/gdb.base/attach-pie-noexec.exp @@ -13,8 +13,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -# Manipulation with PID on target is not supported. -if [is_remote target] then { +if {![can_spawn_for_attach]} { return 0 } @@ -53,8 +52,10 @@ if {$arch == ""} { return 0 } -set testpid [eval exec $binfile &] -exec sleep 2 +# Start the program running and then wait for a bit, to be sure +# that it can be attached to. + +set testpid [spawn_wait_for_attach $binfile] gdb_start file delete -- $binfile |