aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.threads
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2021-09-25 09:28:57 +0200
committerTom de Vries <tdevries@suse.de>2021-09-25 09:28:57 +0200
commit98bf5c02cfe9d13428a55c0da8d5f150d7c1fc54 (patch)
treedd14355db3a17a81c81669abf4ad792fb733615e /gdb/testsuite/gdb.threads
parent99d0d99649c12b2bdccaeb788d5d0f0d0dff4d5d (diff)
downloadgdb-98bf5c02cfe9d13428a55c0da8d5f150d7c1fc54.zip
gdb-98bf5c02cfe9d13428a55c0da8d5f150d7c1fc54.tar.gz
gdb-98bf5c02cfe9d13428a55c0da8d5f150d7c1fc54.tar.bz2
[gdb/testsuite] Minimize gdb restarts
Minimize gdb restarts, applying the following rules: - don't use prepare_for_testing unless necessary - don't use clean_restart unless necessary Also, if possible, replace build_for_executable + clean_restart with prepare_for_testing for brevity. Touches 68 test-cases. Tested on x86_64-linux.
Diffstat (limited to 'gdb/testsuite/gdb.threads')
-rw-r--r--gdb/testsuite/gdb.threads/access-mem-running-thread-exit.exp2
-rw-r--r--gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp5
-rw-r--r--gdb/testsuite/gdb.threads/break-while-running.exp2
-rw-r--r--gdb/testsuite/gdb.threads/clone-attach-detach.exp2
-rw-r--r--gdb/testsuite/gdb.threads/next-bp-other-thread.exp3
-rw-r--r--gdb/testsuite/gdb.threads/signal-sigtrap.exp3
-rw-r--r--gdb/testsuite/gdb.threads/step-bg-decr-pc-switch-thread.exp2
-rw-r--r--gdb/testsuite/gdb.threads/tid-reuse.exp2
8 files changed, 8 insertions, 13 deletions
diff --git a/gdb/testsuite/gdb.threads/access-mem-running-thread-exit.exp b/gdb/testsuite/gdb.threads/access-mem-running-thread-exit.exp
index ea228e4..b2fef9f 100644
--- a/gdb/testsuite/gdb.threads/access-mem-running-thread-exit.exp
+++ b/gdb/testsuite/gdb.threads/access-mem-running-thread-exit.exp
@@ -35,7 +35,7 @@
standard_testfile
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug pthreads}] == -1} {
+if {[build_executable "failed to prepare" $testfile $srcfile {debug pthreads}] == -1} {
return -1
}
diff --git a/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp b/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp
index cb63257..255e483 100644
--- a/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp
+++ b/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp
@@ -62,8 +62,6 @@ proc test {} {
global gdb_prompt
global decimal
- clean_restart ${binfile}
-
set test_spawn_id [spawn_wait_for_attach $binfile]
set testpid [spawn_id_get_pid $test_spawn_id]
@@ -170,7 +168,8 @@ proc test {} {
# failure.
set options { "additional_flags=-DTIMEOUT=$timeout" debug pthreads }
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile $options] == -1} {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
+ $options] == -1} {
return -1
}
diff --git a/gdb/testsuite/gdb.threads/break-while-running.exp b/gdb/testsuite/gdb.threads/break-while-running.exp
index 68d9bf8..de39824 100644
--- a/gdb/testsuite/gdb.threads/break-while-running.exp
+++ b/gdb/testsuite/gdb.threads/break-while-running.exp
@@ -24,7 +24,7 @@
standard_testfile
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug pthreads}] == -1} {
+if {[build_executable "failed to prepare" $testfile $srcfile {debug pthreads}] == -1} {
return -1
}
diff --git a/gdb/testsuite/gdb.threads/clone-attach-detach.exp b/gdb/testsuite/gdb.threads/clone-attach-detach.exp
index 4c6813b..2232857 100644
--- a/gdb/testsuite/gdb.threads/clone-attach-detach.exp
+++ b/gdb/testsuite/gdb.threads/clone-attach-detach.exp
@@ -33,8 +33,6 @@ if [prepare_for_testing "failed to prepare" $testfile $srcfile {debug}] {
return -1
}
-clean_restart ${binfile}
-
set test_spawn_id [spawn_wait_for_attach $binfile]
set testpid [spawn_id_get_pid $test_spawn_id]
diff --git a/gdb/testsuite/gdb.threads/next-bp-other-thread.exp b/gdb/testsuite/gdb.threads/next-bp-other-thread.exp
index 1abbe58..d168f6b3e 100644
--- a/gdb/testsuite/gdb.threads/next-bp-other-thread.exp
+++ b/gdb/testsuite/gdb.threads/next-bp-other-thread.exp
@@ -20,7 +20,8 @@
standard_testfile
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug pthreads}] == -1} {
+if {[build_executable "failed to prepare" $testfile $srcfile \
+ {debug pthreads}] == -1} {
return -1
}
diff --git a/gdb/testsuite/gdb.threads/signal-sigtrap.exp b/gdb/testsuite/gdb.threads/signal-sigtrap.exp
index 92488a5..f5dc7fe 100644
--- a/gdb/testsuite/gdb.threads/signal-sigtrap.exp
+++ b/gdb/testsuite/gdb.threads/signal-sigtrap.exp
@@ -23,7 +23,8 @@ if [target_info exists gdb,nosignals] {
return -1
}
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug pthreads}]} {
+if {[build_executable "failed to prepare" $testfile $srcfile \
+ {debug pthreads}]} {
return -1
}
diff --git a/gdb/testsuite/gdb.threads/step-bg-decr-pc-switch-thread.exp b/gdb/testsuite/gdb.threads/step-bg-decr-pc-switch-thread.exp
index 55ebd40..c6c6cce 100644
--- a/gdb/testsuite/gdb.threads/step-bg-decr-pc-switch-thread.exp
+++ b/gdb/testsuite/gdb.threads/step-bg-decr-pc-switch-thread.exp
@@ -34,8 +34,6 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug pthreads}
return -1
}
-clean_restart $binfile
-
if ![runto_main] {
continue
}
diff --git a/gdb/testsuite/gdb.threads/tid-reuse.exp b/gdb/testsuite/gdb.threads/tid-reuse.exp
index 1d93a55..8ac1f5b 100644
--- a/gdb/testsuite/gdb.threads/tid-reuse.exp
+++ b/gdb/testsuite/gdb.threads/tid-reuse.exp
@@ -22,8 +22,6 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile { debug pthreads
return -1
}
-clean_restart ${binfile}
-
if ![runto_main] {
fail "can't run to main"
return -1