]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Skip two more attach tests when testing against stub-like targets
authorDon Breazeal <donb@codesourcery.com>
Thu, 15 Jan 2015 18:47:31 +0000 (10:47 -0800)
committerDon Breazeal <donb@codesourcery.com>
Thu, 15 Jan 2015 18:59:57 +0000 (10:59 -0800)
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.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/attach-pie-noexec.exp
gdb/testsuite/gdb.base/attach-twice.exp

index a71ee988eab5ac1a45c9e1e04a4cb73d8903479f..0558960a57f0f8c63de81fb8bf46241b11132a84 100644 (file)
@@ -1,3 +1,10 @@
+2015-01-15  Don Breazeal  <donb@codesourcery.com>
+
+       * 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.
+
 2015-01-15  Joel Brobecker  <brobecker@adacore.com>
 
        * gdb.ada/var_arr_attrs: New testcase.
index f6aa1c8c21e4a5ac60bd3bd3e0e4312cc9d17129..30a2f4d9de9d6b47dcac8da0448f18ec1515a351 100644 (file)
@@ -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
index 654ceca5616eb4f9032a117cf52c14ad6527e94f..f6a9eb6f5ee443596ca17b648f6f101a9b09e779 100644 (file)
@@ -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
 }
 
@@ -25,8 +24,10 @@ if { [prepare_for_testing ${testfile}.exp $executable] } {
     return -1
 }
 
-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]
 
 set parentpid 0