[04/46] Use require supports_reverse

Message ID 20221217000818.3729389-5-tom@tromey.com
State Committed
Headers
Series Rewrite "require" test procedure and use it more often |

Commit Message

Tom Tromey Dec. 17, 2022, 12:07 a.m. UTC
  This changes some tests to use "require supports_reverse".
---
 gdb/testsuite/gdb.mi/mi-reverse.exp                     | 4 +---
 gdb/testsuite/gdb.reverse/amd64-tailcall-reverse.exp    | 4 +---
 gdb/testsuite/gdb.reverse/break-reverse.exp             | 4 +---
 gdb/testsuite/gdb.reverse/consecutive-reverse.exp       | 4 +---
 gdb/testsuite/gdb.reverse/finish-precsave.exp           | 4 +---
 gdb/testsuite/gdb.reverse/finish-reverse-bkpt.exp       | 4 +---
 gdb/testsuite/gdb.reverse/finish-reverse.exp            | 4 +---
 gdb/testsuite/gdb.reverse/fstatat-reverse.exp           | 4 +---
 gdb/testsuite/gdb.reverse/getrandom.exp                 | 4 +---
 gdb/testsuite/gdb.reverse/getresuid-reverse.exp         | 4 +---
 gdb/testsuite/gdb.reverse/i386-reverse.exp              | 5 +----
 gdb/testsuite/gdb.reverse/i386-sse-reverse.exp          | 5 +----
 gdb/testsuite/gdb.reverse/insn-reverse.exp              | 7 +------
 gdb/testsuite/gdb.reverse/machinestate.exp              | 4 +---
 gdb/testsuite/gdb.reverse/next-reverse-bkpt-over-sr.exp | 4 +---
 gdb/testsuite/gdb.reverse/pipe-reverse.exp              | 4 +---
 gdb/testsuite/gdb.reverse/readv-reverse.exp             | 4 +---
 gdb/testsuite/gdb.reverse/recvmsg-reverse.exp           | 4 +---
 gdb/testsuite/gdb.reverse/rerun-prec.exp                | 4 +---
 gdb/testsuite/gdb.reverse/s390-mvcle.exp                | 4 +---
 gdb/testsuite/gdb.reverse/sigall-precsave.exp           | 5 +----
 gdb/testsuite/gdb.reverse/sigall-reverse.exp            | 5 +----
 gdb/testsuite/gdb.reverse/singlejmp-reverse.exp         | 4 +---
 gdb/testsuite/gdb.reverse/solib-reverse.exp             | 7 +------
 gdb/testsuite/gdb.reverse/step-indirect-call-thunk.exp  | 5 +----
 gdb/testsuite/gdb.reverse/step-reverse.exp              | 4 +---
 gdb/testsuite/gdb.reverse/time-reverse.exp              | 4 +---
 gdb/testsuite/gdb.reverse/until-reverse.exp             | 4 +---
 gdb/testsuite/gdb.reverse/waitpid-reverse.exp           | 4 +---
 gdb/testsuite/gdb.reverse/watch-reverse.exp             | 4 +---
 30 files changed, 30 insertions(+), 101 deletions(-)
  

Patch

diff --git a/gdb/testsuite/gdb.mi/mi-reverse.exp b/gdb/testsuite/gdb.mi/mi-reverse.exp
index 9913206eba9..99704dda75e 100644
--- a/gdb/testsuite/gdb.mi/mi-reverse.exp
+++ b/gdb/testsuite/gdb.mi/mi-reverse.exp
@@ -27,9 +27,7 @@ 
 # but to verify the correct output response to MI operations.
 #
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 load_lib mi-support.exp
 set MIFLAGS "-i=mi"
diff --git a/gdb/testsuite/gdb.reverse/amd64-tailcall-reverse.exp b/gdb/testsuite/gdb.reverse/amd64-tailcall-reverse.exp
index 7bb797d90d3..129b08db400 100644
--- a/gdb/testsuite/gdb.reverse/amd64-tailcall-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/amd64-tailcall-reverse.exp
@@ -13,9 +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/>.
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 set opts {}
 standard_testfile .S
diff --git a/gdb/testsuite/gdb.reverse/break-reverse.exp b/gdb/testsuite/gdb.reverse/break-reverse.exp
index 29861cd2eba..13459b08f1f 100644
--- a/gdb/testsuite/gdb.reverse/break-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/break-reverse.exp
@@ -16,9 +16,7 @@ 
 # This file is part of the GDB testsuite.  It tests reverse debugging
 # with breakpoints.
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.reverse/consecutive-reverse.exp b/gdb/testsuite/gdb.reverse/consecutive-reverse.exp
index 99d83328feb..38d8c2f1cfa 100644
--- a/gdb/testsuite/gdb.reverse/consecutive-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/consecutive-reverse.exp
@@ -16,9 +16,7 @@ 
 # This file is part of the GDB testsuite.  It tests stepping over
 # consecutive instructions in reverse.
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.reverse/finish-precsave.exp b/gdb/testsuite/gdb.reverse/finish-precsave.exp
index 0bf2a7b1ba3..7d31aae5bd2 100644
--- a/gdb/testsuite/gdb.reverse/finish-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/finish-precsave.exp
@@ -16,9 +16,7 @@ 
 # This file is part of the GDB testsuite.  It tests 'finish' with
 # reverse debugging.
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile finish-reverse.c
 set precsave [standard_output_file finish.precsave]
diff --git a/gdb/testsuite/gdb.reverse/finish-reverse-bkpt.exp b/gdb/testsuite/gdb.reverse/finish-reverse-bkpt.exp
index 3d98178a4c3..f74154a1044 100644
--- a/gdb/testsuite/gdb.reverse/finish-reverse-bkpt.exp
+++ b/gdb/testsuite/gdb.reverse/finish-reverse-bkpt.exp
@@ -40,9 +40,7 @@ 
 # addition to non-PowerPC systems.  On non-PowerPC systems, the GEP and LEP
 # are the same.
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.reverse/finish-reverse.exp b/gdb/testsuite/gdb.reverse/finish-reverse.exp
index 703423f176e..8655403bcd6 100644
--- a/gdb/testsuite/gdb.reverse/finish-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/finish-reverse.exp
@@ -16,9 +16,7 @@ 
 # This file is part of the GDB testsuite.  It tests 'finish' with
 # reverse debugging.
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.reverse/fstatat-reverse.exp b/gdb/testsuite/gdb.reverse/fstatat-reverse.exp
index 10d7024f3cb..abfb3838c91 100644
--- a/gdb/testsuite/gdb.reverse/fstatat-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/fstatat-reverse.exp
@@ -19,9 +19,7 @@ 
 # This test tests fstatat syscall for reverse execution.
 #
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.reverse/getrandom.exp b/gdb/testsuite/gdb.reverse/getrandom.exp
index b1c7d9dad80..a13eff75116 100644
--- a/gdb/testsuite/gdb.reverse/getrandom.exp
+++ b/gdb/testsuite/gdb.reverse/getrandom.exp
@@ -19,9 +19,7 @@ 
 # This test tests getrandom syscall for reverse execution.
 #
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.reverse/getresuid-reverse.exp b/gdb/testsuite/gdb.reverse/getresuid-reverse.exp
index a44f2705a3d..fbff31a590a 100644
--- a/gdb/testsuite/gdb.reverse/getresuid-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/getresuid-reverse.exp
@@ -19,9 +19,7 @@ 
 # This test tests getresuid/getresgid syscalls for reverse execution.
 #
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.reverse/i386-reverse.exp b/gdb/testsuite/gdb.reverse/i386-reverse.exp
index 6f6458c776e..85b6eaefccc 100644
--- a/gdb/testsuite/gdb.reverse/i386-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/i386-reverse.exp
@@ -19,10 +19,7 @@ 
 # This test tests some i386 general instructions for reverse execution.
 #
 
-if ![supports_reverse] {
-    return
-}
-
+require supports_reverse
 
 if {![is_x86_like_target]} {
     verbose "Skipping i386 reverse tests."
diff --git a/gdb/testsuite/gdb.reverse/i386-sse-reverse.exp b/gdb/testsuite/gdb.reverse/i386-sse-reverse.exp
index ac56cd4e50d..84b1b5ea615 100644
--- a/gdb/testsuite/gdb.reverse/i386-sse-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/i386-sse-reverse.exp
@@ -19,10 +19,7 @@ 
 # This test tests some i386 general instructions for reverse execution.
 #
 
-if ![supports_reverse] {
-    return
-}
-
+require supports_reverse
 
 if {![istarget "*86*-*linux*"]} {
     verbose "Skipping i386 reverse tests."
diff --git a/gdb/testsuite/gdb.reverse/insn-reverse.exp b/gdb/testsuite/gdb.reverse/insn-reverse.exp
index e16866e1433..f74f6922719 100644
--- a/gdb/testsuite/gdb.reverse/insn-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/insn-reverse.exp
@@ -13,12 +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/>.
 
-if ![supports_reverse] {
-    return
-}
-
-# Check if start command is supported.
-require !use_gdb_stub
+require supports_reverse !use_gdb_stub
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.reverse/machinestate.exp b/gdb/testsuite/gdb.reverse/machinestate.exp
index e33be3dbfed..deef00d0428 100644
--- a/gdb/testsuite/gdb.reverse/machinestate.exp
+++ b/gdb/testsuite/gdb.reverse/machinestate.exp
@@ -35,9 +35,7 @@ 
 #   Test forward replay
 #
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile .c ms1.c
 
diff --git a/gdb/testsuite/gdb.reverse/next-reverse-bkpt-over-sr.exp b/gdb/testsuite/gdb.reverse/next-reverse-bkpt-over-sr.exp
index b8364e237b4..60f53f8f46d 100644
--- a/gdb/testsuite/gdb.reverse/next-reverse-bkpt-over-sr.exp
+++ b/gdb/testsuite/gdb.reverse/next-reverse-bkpt-over-sr.exp
@@ -40,9 +40,7 @@ 
 # addition to non-PowerPC systems.  On non-PowerPC systems, the GEP and LEP
 # are the same.
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.reverse/pipe-reverse.exp b/gdb/testsuite/gdb.reverse/pipe-reverse.exp
index a3dafc0347a..45b249b4064 100644
--- a/gdb/testsuite/gdb.reverse/pipe-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/pipe-reverse.exp
@@ -19,9 +19,7 @@ 
 # This test tests pipe syscall for reverse execution.
 #
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.reverse/readv-reverse.exp b/gdb/testsuite/gdb.reverse/readv-reverse.exp
index 370a63cbe73..f921e5c67ff 100644
--- a/gdb/testsuite/gdb.reverse/readv-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/readv-reverse.exp
@@ -19,9 +19,7 @@ 
 # This test tests readv syscall for reverse execution.
 #
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.reverse/recvmsg-reverse.exp b/gdb/testsuite/gdb.reverse/recvmsg-reverse.exp
index 57a30569288..247d58e9f3e 100644
--- a/gdb/testsuite/gdb.reverse/recvmsg-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/recvmsg-reverse.exp
@@ -19,9 +19,7 @@ 
 # This test tests socketpair and recvmsg syscalls for reverse execution.
 #
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.reverse/rerun-prec.exp b/gdb/testsuite/gdb.reverse/rerun-prec.exp
index 16fc6f28c76..1c3ab52e7a1 100644
--- a/gdb/testsuite/gdb.reverse/rerun-prec.exp
+++ b/gdb/testsuite/gdb.reverse/rerun-prec.exp
@@ -13,9 +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/>.  */
 
-if {![supports_reverse] || ![supports_process_record]} {
-    return
-}
+require supports_reverse supports_process_record
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.reverse/s390-mvcle.exp b/gdb/testsuite/gdb.reverse/s390-mvcle.exp
index 4b8a8adc8de..c8d235c057a 100644
--- a/gdb/testsuite/gdb.reverse/s390-mvcle.exp
+++ b/gdb/testsuite/gdb.reverse/s390-mvcle.exp
@@ -17,9 +17,7 @@ 
 # This test tests s390 MVCLE opcode for reverse execution.
 #
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 if { ! [istarget "s390*-*-*"] } {
     verbose "Skipping s390 MVCLE instruction recording tests."
diff --git a/gdb/testsuite/gdb.reverse/sigall-precsave.exp b/gdb/testsuite/gdb.reverse/sigall-precsave.exp
index d8761753971..6df5cd2b660 100644
--- a/gdb/testsuite/gdb.reverse/sigall-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/sigall-precsave.exp
@@ -18,10 +18,7 @@  if [target_info exists gdb,nosignals] {
     return
 }
 
-if ![supports_reverse] {
-    return
-}
-
+require supports_reverse
 
 gdb_exit
 gdb_start
diff --git a/gdb/testsuite/gdb.reverse/sigall-reverse.exp b/gdb/testsuite/gdb.reverse/sigall-reverse.exp
index 7078067a71e..818bbec4fb6 100644
--- a/gdb/testsuite/gdb.reverse/sigall-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/sigall-reverse.exp
@@ -18,10 +18,7 @@  if [target_info exists gdb,nosignals] {
     return
 }
 
-if ![supports_reverse] {
-    return
-}
-
+require supports_reverse
 
 gdb_exit
 gdb_start
diff --git a/gdb/testsuite/gdb.reverse/singlejmp-reverse.exp b/gdb/testsuite/gdb.reverse/singlejmp-reverse.exp
index d6934ffcd19..ce9972e8be5 100644
--- a/gdb/testsuite/gdb.reverse/singlejmp-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/singlejmp-reverse.exp
@@ -13,9 +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/>.
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile ".S" "${gdb_test_file_name}-nodebug.S"
 set executable ${testfile}
diff --git a/gdb/testsuite/gdb.reverse/solib-reverse.exp b/gdb/testsuite/gdb.reverse/solib-reverse.exp
index 3bcf2dfcb24..b7f76f53265 100644
--- a/gdb/testsuite/gdb.reverse/solib-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/solib-reverse.exp
@@ -16,12 +16,7 @@ 
 # This file is part of the GDB testsuite.  It tests reverse debugging
 # with shared libraries.
 
-if ![supports_reverse] {
-    return
-}
-if {[skip_shlib_tests]} {
-    return
-}
+require supports_reverse !skip_shlib_tests
 
 standard_testfile
 set lib1file "shr1"
diff --git a/gdb/testsuite/gdb.reverse/step-indirect-call-thunk.exp b/gdb/testsuite/gdb.reverse/step-indirect-call-thunk.exp
index 3f1f5381f09..058482cbb47 100644
--- a/gdb/testsuite/gdb.reverse/step-indirect-call-thunk.exp
+++ b/gdb/testsuite/gdb.reverse/step-indirect-call-thunk.exp
@@ -13,10 +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/>.
 
-if { ![supports_reverse] } {
-    untested "target does not support record"
-    return -1
-}
+require supports_reverse
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.reverse/step-reverse.exp b/gdb/testsuite/gdb.reverse/step-reverse.exp
index d2975cffb5c..b272d427f15 100644
--- a/gdb/testsuite/gdb.reverse/step-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/step-reverse.exp
@@ -20,9 +20,7 @@ 
 # Test step and next in reverse
 #
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.reverse/time-reverse.exp b/gdb/testsuite/gdb.reverse/time-reverse.exp
index 94acea8eed5..ec756390c4d 100644
--- a/gdb/testsuite/gdb.reverse/time-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/time-reverse.exp
@@ -19,9 +19,7 @@ 
 # This test tests time syscall for reverse execution.
 #
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.reverse/until-reverse.exp b/gdb/testsuite/gdb.reverse/until-reverse.exp
index 0afd0e05f50..3357d6c1783 100644
--- a/gdb/testsuite/gdb.reverse/until-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/until-reverse.exp
@@ -16,9 +16,7 @@ 
 # This file is part of the GDB testsuite.  It tests 'until' and 
 # 'advance' in reverse debugging.
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile .c ur1.c
 
diff --git a/gdb/testsuite/gdb.reverse/waitpid-reverse.exp b/gdb/testsuite/gdb.reverse/waitpid-reverse.exp
index ddaa71a987c..fe6fbc7cb8a 100644
--- a/gdb/testsuite/gdb.reverse/waitpid-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/waitpid-reverse.exp
@@ -21,9 +21,7 @@ 
 # Also serves as regression test for gdb/19187 (recording across a
 # fork).
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.reverse/watch-reverse.exp b/gdb/testsuite/gdb.reverse/watch-reverse.exp
index 056e381cd85..55fa86158b6 100644
--- a/gdb/testsuite/gdb.reverse/watch-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/watch-reverse.exp
@@ -18,9 +18,7 @@ 
 # with watchpoints.
 
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile