]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite, tclint] Fix gdb.reverse
authorTom de Vries <tdevries@suse.de>
Sat, 20 Sep 2025 12:48:56 +0000 (14:48 +0200)
committerTom de Vries <tdevries@suse.de>
Sat, 20 Sep 2025 12:48:56 +0000 (14:48 +0200)
Running tclint on the test-cases in gdb.reverse shows a few problems.

Fix these.

Tested on x86_64-linux.

37 files changed:
gdb/tclint.toml
gdb/testsuite/gdb.reverse/aarch64-mops.exp
gdb/testsuite/gdb.reverse/amd64-tailcall-reverse.exp
gdb/testsuite/gdb.reverse/break-reverse.exp
gdb/testsuite/gdb.reverse/consecutive-reverse.exp
gdb/testsuite/gdb.reverse/finish-precsave.exp
gdb/testsuite/gdb.reverse/finish-reverse-bkpt.exp
gdb/testsuite/gdb.reverse/finish-reverse-next.exp
gdb/testsuite/gdb.reverse/finish-reverse.exp
gdb/testsuite/gdb.reverse/fstatat-reverse.exp
gdb/testsuite/gdb.reverse/getrandom.exp
gdb/testsuite/gdb.reverse/getresuid-reverse.exp
gdb/testsuite/gdb.reverse/i386-avx-reverse.exp
gdb/testsuite/gdb.reverse/i386-reverse.exp
gdb/testsuite/gdb.reverse/i386-sse-reverse.exp
gdb/testsuite/gdb.reverse/i387-env-reverse.exp
gdb/testsuite/gdb.reverse/insn-reverse.exp
gdb/testsuite/gdb.reverse/machinestate-precsave.exp
gdb/testsuite/gdb.reverse/machinestate.exp
gdb/testsuite/gdb.reverse/maint-print-instruction.exp
gdb/testsuite/gdb.reverse/next-reverse-bkpt-over-sr.exp
gdb/testsuite/gdb.reverse/pipe-reverse.exp
gdb/testsuite/gdb.reverse/readv-reverse.exp
gdb/testsuite/gdb.reverse/recursion.exp
gdb/testsuite/gdb.reverse/recvmsg-reverse.exp
gdb/testsuite/gdb.reverse/s390-mvcle.exp
gdb/testsuite/gdb.reverse/sigall-precsave.exp
gdb/testsuite/gdb.reverse/sigall-reverse.exp
gdb/testsuite/gdb.reverse/singlejmp-reverse.exp
gdb/testsuite/gdb.reverse/solib-precsave.exp
gdb/testsuite/gdb.reverse/solib-reverse.exp
gdb/testsuite/gdb.reverse/step-precsave.exp
gdb/testsuite/gdb.reverse/step-reverse.exp
gdb/testsuite/gdb.reverse/until-precsave.exp
gdb/testsuite/gdb.reverse/until-reverse.exp
gdb/testsuite/gdb.reverse/waitpid-reverse.exp
gdb/testsuite/gdb.reverse/watch-reverse.exp

index 4beb4dd2bf0fe1aea8c9d486afff7fafba794c63..3b43523789f5d52587eb1b1712fff29428ec44aa 100644 (file)
@@ -28,7 +28,6 @@ exclude = [
 "gdb/testsuite/gdb.fortran",
 "gdb/testsuite/gdb.mi",
 "gdb/testsuite/gdb.python",
-"gdb/testsuite/gdb.reverse",
 "gdb/testsuite/gdb.threads",
 "gdb/testsuite/gdb.trace",
 # IGNORE (document reason in trailing comment):
index 0f447a67e4cbb600f7c3cf9aa4204b06c9edfbf0..797a0c2d5b99df9b0b8bc2e899b8fb97e0a24e96 100644 (file)
@@ -40,7 +40,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 56ebb92e7628dd558be20dade8178928d9eafcda..b5878f05d5263eb74a6a0ed56c548baa48d12117 100644 (file)
@@ -18,7 +18,7 @@ require supports_reverse
 set opts {}
 standard_testfile .S
 
-if [info exists COMPILE] {
+if {[info exists COMPILE]} {
     # make check RUNTESTFLAGS="gdb.reverse/amd64-tailcall-reverse.exp COMPILE=1"
     standard_testfile
     lappend opts debug optimize=-O2
@@ -30,11 +30,11 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $opts] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
-if [supports_process_record] {
+if {[supports_process_record]} {
     gdb_test_no_output "record"
 }
 
index 02c38ac827385f9795ebb4346f54b736523b730a..6db7ce11f1274fd0882468ce23b780918be8e7c5 100644 (file)
@@ -31,7 +31,7 @@ set end_location  [gdb_get_line_number "end of main"  ]
 
 runto_main
 
-if [supports_process_record] {
+if {[supports_process_record]} {
     # Activate process record/replay
     gdb_test_no_output "record" "turn on process record"
 }
index 8996d792ed8c09b46eb08f2a9440c633ca700cc6..7434efb44e7386d6b71dd5c748e5e1112c50dff5 100644 (file)
@@ -26,7 +26,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
 
 runto_main
 
-if [supports_process_record] {
+if {[supports_process_record]} {
     # Activate process record/replay
     gdb_test_no_output "record" "turn on process record"
 }
index 596b40da5d718eb25731efd05f05b51979d49f6a..2e76a46e1d79148bfe706496cc97a08ec6ba7a25 100644 (file)
@@ -27,12 +27,12 @@ if { [prepare_for_testing "failed to prepare" "$testfile" $srcfile] } {
 
 runto_main
 
-if [supports_process_record] {
+if {[supports_process_record]} {
     # Activate process record/replay
     gdb_test_no_output "record" "turn on process record"
 }
 
-# Run until end, then save execution log. 
+# Run until end, then save execution log.
 
 set breakloc [gdb_get_line_number "end of main" "$srcfile"]
 gdb_test "break $breakloc" \
index 1e92252e1352c158318b12fc4a8f0851f31f78ec..586d2361ea4fb9a415e676429e917d480a6af3b4 100644 (file)
@@ -52,7 +52,7 @@ if {![runto_main]} {
     return 0
 }
 
-if [supports_process_record] {
+if {[supports_process_record]} {
     # Activate process record/replay
     gdb_test_no_output "record" "turn on process record"
 }
index f744e9c910cf7f181716d83b6510e9b55bb97a07..07ba30ceda91312d1beb08c87097cf741539ee22 100644 (file)
@@ -41,7 +41,7 @@
 # test only verified the reverse-finish command for a normal call that used
 # the LEP.
 
-if ![supports_reverse] {
+if {![supports_reverse]} {
     return
 }
 
@@ -53,7 +53,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
 
 runto_main
 
-if [supports_process_record] {
+if {[supports_process_record]} {
     # Activate process record/replay.
     gdb_test_no_output "record" "turn on process record for test1"
 }
index f90a79fcdfac72e038d3442d4f3e5c48ceefb337..ff28bd8d9f94428df821852dbd8f23890a82b277 100644 (file)
@@ -26,7 +26,7 @@ if { [prepare_for_testing "failed to prepare" "$testfile" $srcfile] } {
 
 runto_main
 
-if [supports_process_record] {
+if {[supports_process_record]} {
     # Activate process record/replay
     gdb_test_no_output "record" "turn on process record"
 }
index 76bd8a2016f72cab7513085d6e1701826d2ac009..db2f5dc0d47869d5b960fa10c1ba004e4fd0f9cf 100644 (file)
@@ -29,7 +29,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
 
 runto_main
 
-if [supports_process_record] {
+if {[supports_process_record]} {
     # Activate process record/replay
     gdb_test_no_output "record" "turn on process record"
 }
index 62640afaf192a68cc2686919a93df9e237ead978..2756fa39a9b01dec1740f57907ee1c8724bb39a0 100644 (file)
@@ -30,7 +30,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
 
 runto_main
 
-if [supports_process_record] {
+if {[supports_process_record]} {
     # Activate process record/replay
     gdb_test_no_output "record" "turn on process record"
 }
index 5ff0f2bd5cb2a3e1d8cd40b448b7462e870de55b..37d070d42ec36f6dd6d31c5c528accbfffada997 100644 (file)
@@ -29,7 +29,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
 
 runto_main
 
-if [supports_process_record] {
+if {[supports_process_record]} {
     # Activate process record/replay
     gdb_test_no_output "record" "turn on process record"
 }
index fb04260766e8e32432977c660ca32e5bcb45d7d9..b3550e256152df62f80e8e58fc221d572637069d 100644 (file)
@@ -109,7 +109,7 @@ proc record_full_function {function} {
     gdb_breakpoint $end temporary
     gdb_continue_to_breakpoint "start ${function}_test"
 
-    if [supports_process_record] {
+    if {[supports_process_record]} {
        # Activate process record/replay.
        gdb_test_no_output "record" "${function}: turn on process record"
     }
index 8c223632f69ce8c3c67eab4f8e83301c87f894b8..9aee9a4f70e41b45401323ccff83a4abeda5e26e 100644 (file)
@@ -36,7 +36,7 @@ set end_of_inc_dec_tests [gdb_get_line_number " end inc_dec_tests "]
 
 runto_main
 
-if [supports_process_record] {
+if {[supports_process_record]} {
     # Activate process record/replay
     gdb_test_no_output "record" "turn on process record"
 }
index 0c994805f498ffa90d67bc015f590336511b0027..aa4cfce5d7f08c664b6f0692411d0824ceb3662c 100644 (file)
@@ -43,7 +43,7 @@ set end_sse4_test         [gdb_get_line_number " end sse4_test "]
 
 runto_main
 
-if [supports_process_record] {
+if {[supports_process_record]} {
     # Activate process record/replay
     gdb_test_no_output "record" "turn on process record"
 }
index 4b6a3f76a2c321499a498bfa73e41a31350f2e56..f3350fcc3d6098da65a3f0203fcae2824a82f9b9 100644 (file)
@@ -36,7 +36,7 @@ set location [gdb_get_line_number "END I387-FLOAT-REVERSE"]
 gdb_test_no_output "record"  "Turn on process record"
 # This can take awhile.
 set oldtimeout $timeout
-set timeout [expr $oldtimeout + 120]
+set timeout [expr {$oldtimeout + 120}]
 gdb_test "until $location" ".*$srcfile:$location.*" \
     "record to end of main"
 set timeout $oldtimeout
index 5b3a2cdb617ea8d8d69b2d302d570aca279fb3ed..9e238f062707c18c6197783509c81a88d262e56d 100644 (file)
@@ -106,7 +106,7 @@ proc test { func testcase_nr } {
        }
 
        # Registers contents after each backward single step.
-       for {set i [expr $count - 1]} {$i >= 0} {incr i -1} {
+       for {set i [expr {$count - 1}]} {$i >= 0} {incr i -1} {
            gdb_test -nopass "reverse-stepi"
            set post_regs($i) [capture_command_output "info all-registers" ""]
        }
index 53b958d1e4f614b794e3677453722b76f65e5521..94d97235602816070bc31b40fa3a9a7599d300ae 100644 (file)
@@ -13,7 +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/>.
 
-# This file is part of the GDB testsuite.  
+# This file is part of the GDB testsuite.
 # This test tests the restoration of various kinds of machine state
 # to their original values with a process record log.  We will execute
 # the program forward while it changes various types of data, and
index 9177029f9bed50bcf4724b7254c695fedb550837..7edf51768dc56c0bc860a834323da72f5b724e40 100644 (file)
@@ -13,7 +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/>.
 
-# This file is part of the GDB testsuite.  
+# This file is part of the GDB testsuite.
 # This test tests the restoration of various kinds of machine state
 # to their original values by reverse execution.  We will execute
 # the program forward while it changes various types of data, and
@@ -53,7 +53,7 @@ set endmain   [gdb_get_line_number " end main "   $srcfile]
 
 runto_main
 
-if [supports_process_record] {
+if {[supports_process_record]} {
     # Activate process record/replay
     gdb_test_no_output "record" "turn on process record"
 }
index 6599345b2c0e8ca28c6e8706ebdeb7994a86f826..151c1172c4469576baeda4abc8861e88ca2f2e5e 100644 (file)
@@ -23,7 +23,7 @@
 # change is printed, since any instruction must have at least a change
 # to the PC.
 
-if ![supports_reverse] {
+if {![supports_reverse]} {
     return
 }
 
@@ -52,7 +52,7 @@ if { ![runto_main] } {
 #confirm that GDB doesn't go crazy if recording isn't enabled
 test_print false "" "print before starting to record"
 
-if ![supports_process_record] {
+if {![supports_process_record]} {
     # No point in testing the rest if we can't record anything
     return
 }
index 454808d4efc8e5b483c66e11e7d5b01194cd68c2..574ab5eedb8eabafeeca557aef5409c7fc136157 100644 (file)
@@ -52,7 +52,7 @@ if {![runto_main]} {
     return 0
 }
 
-if [supports_process_record] {
+if {[supports_process_record]} {
     # Activate process record/replay
     gdb_test_no_output "record" "turn on process record"
 }
index eb4f8eb81b688e6116e14b0d8b0c6b6bbddefe22..93ba3d1ce3bf2ed9c88896d3adbed2a3f2e6e0a4 100644 (file)
@@ -29,7 +29,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
 
 runto_main
 
-if [supports_process_record] {
+if {[supports_process_record]} {
     # Activate process record/replay
     gdb_test_no_output "record" "turn on process record"
 }
index 47149f226511b8cab0c5491b6e813cd5b52b8d44..4456340d41b80a47e8d194578e8868843f5ac26a 100644 (file)
@@ -29,7 +29,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
 
 runto_main
 
-if [supports_process_record] {
+if {[supports_process_record]} {
     # Activate process record/replay
     gdb_test_no_output "record" "turn on process record"
 }
index bfe1770a84df4dcb5440c6bc189671a0a6bf7b01..ca0893089ca2a73c2eed1643985c687aecd64d15 100644 (file)
@@ -26,7 +26,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
 
 runto_main
 
-if [supports_process_record] {
+if {[supports_process_record]} {
     # Activate process record/replay
     gdb_test_no_output "record" "turn on process record"
 }
index 89cac87612198a3ce726ac6573c08f8210a9ab41..af6f73fbd8c86389d40dc677fd76b972e2cbd746 100644 (file)
@@ -29,7 +29,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
 
 runto_main
 
-if [supports_process_record] {
+if {[supports_process_record]} {
     # Activate process record/replay
     gdb_test_no_output "record" "turn on process record"
 }
index 36cd6112d267ae6516edaaae3c4f4402dcbfb240..642be8fde9bde77f4d89b714c485d4a6dcbd207a 100644 (file)
@@ -27,7 +27,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
 
 runto_main
 
-if [supports_process_record] {
+if {[supports_process_record]} {
     # Activate process record/replay
     gdb_test_no_output "record" "turn on process record"
 }
index 79838a0f18b1be42cc1c270b28ce033597cc6599..552be4b1666ec524bbcbd8b7371a684b8c38be0c 100644 (file)
@@ -134,7 +134,7 @@ proc test_one_sig_reverse {prevsig} {
            } else {
                xfail "$testmsg (handled)"
            }
-       }           
+       }
     }
 }
 
@@ -142,12 +142,12 @@ clean_restart $::testfile
 
 runto gen_ABRT
 
-if [supports_process_record] {
+if {[supports_process_record]} {
     # Activate process record/replay
     gdb_test_no_output "record" "turn on process record"
 }
 
-# Run until end, then save execution log. 
+# Run until end, then save execution log.
 
 set breakloc [gdb_get_line_number "end of main" "$srcfile"]
 gdb_test "break $breakloc" \
@@ -299,7 +299,7 @@ gdb_test "continue" \
     "get signal TERM"
 gdb_test "continue" "Breakpoint.*handle_TERM.*" "send signal TERM"
 
-gdb_test "continue" " end of main .*" "continue to sigall exit" 
+gdb_test "continue" " end of main .*" "continue to sigall exit"
 
 foreach sig [lreverse $signals] {
     test_one_sig_reverse $sig
index 82547d8d3351d831da5e7fad971d56a77c883d14..f9259a1747c4a6c506e9d2f592eca6ebb5833279 100644 (file)
@@ -140,7 +140,7 @@ proc test_one_sig_reverse {prevsig} {
            } else {
                xfail "$testmsg (handled)"
            }
-       }           
+       }
     }
 }
 
@@ -148,7 +148,7 @@ clean_restart $::testfile
 
 runto gen_ABRT
 
-if [supports_process_record] {
+if {[supports_process_record]} {
     # Activate process record/replay
     gdb_test_no_output "record" "turn on process record"
 }
index 7c1cf0b0f56498e8e7962a941e2d6c86973284f4..8b9cb205327350f31de4f2ed03040a29a195502a 100644 (file)
@@ -18,7 +18,7 @@ require supports_reverse
 standard_testfile ".S" "${gdb_test_file_name}-nodebug.S"
 set executable ${testfile}
 
-if [info exists COMPILE] {
+if {[info exists COMPILE]} {
     # make check RUNTESTFLAGS="gdb.reverse/singlejmp-reverse.exp COMPILE=1"
     if { [build_executable_from_specs ${testfile}.exp $executable {} \
                                      ${testfile}.c {debug optimize=-O2} \
@@ -36,11 +36,11 @@ if [info exists COMPILE] {
 
 clean_restart $executable
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
-if [supports_process_record] {
+if {[supports_process_record]} {
     gdb_test_no_output "record"
 }
 
index 96361673009bc49cb6d673f68b8f2ba381448b74..0b93501129e37a8d348e9908b16c4c2a552d0f68 100644 (file)
@@ -52,7 +52,7 @@ if { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile} executable \
     untested "failed to compile"
     return -1
 }
-     
+
 # Note: The test previously did "set debug-file-directory" to (try to)
 # ensure the debug info for the dynamic loader and libc weren't found.
 # This doesn't work if the debug info is in the .debug subdirectory.
index 4efd19fbbff09ac66d155eeabda38b6b78ca60af..899117768b2da4479edc9565b0feede3fcf179c9 100644 (file)
@@ -44,7 +44,7 @@ if { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile} executable $exec_opt
     untested "failed to compile"
     return -1
 }
-     
+
 # Note: The test previously did "set debug-file-directory" to (try to)
 # ensure the debug info for the dynamic loader and libc weren't found.
 # This doesn't work if the debug info is in the .debug subdirectory.
@@ -58,7 +58,7 @@ gdb_load_shlib $library2
 
 runto_main
 
-if [supports_process_record] {
+if {[supports_process_record]} {
     # Activate process record/replay
     gdb_test_no_output "record" "turn on process record"
 }
index 9a0127ace6234f59dc192aa6c7ced95b711909a9..d152454442b1bcaa5d45295ca82a3d2186e6d09c 100644 (file)
@@ -229,7 +229,7 @@ gdb_test_multiple "stepi" "$test_message" {
        }
     }
     -re "ENTER CALLEE.*$gdb_prompt $" {
-       send_gdb "stepi\n" 
+       send_gdb "stepi\n"
        exp_continue
     }
     -re "$pic_thunk_re.*$gdb_prompt $" {
index 6ecf1cdc2b946288fd6552539d9d4180807a1507..78a11bf25a4d0a2dfb48bf6a2131e793770a6def 100644 (file)
@@ -30,7 +30,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
 
 runto_main
 
-if [supports_process_record] {
+if {[supports_process_record]} {
     # Activate process record/replay
     gdb_test_no_output "record" "turn on process record"
 }
@@ -191,7 +191,7 @@ gdb_test_multiple "stepi" "$test_message" {
        }
     }
     -re "ENTER CALLEE.*$gdb_prompt $" {
-       send_gdb "stepi\n" 
+       send_gdb "stepi\n"
        exp_continue
     }
     -re "$pic_thunk_re.*$gdb_prompt $" {
index 1f25a3a1291be744c8e10d89225b3a69f89b3752..325e4a86ce3df91cb7dda863505babd4d049e652 100644 (file)
@@ -13,7 +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/>.  */
 
-# This file is part of the GDB testsuite.  It tests 'until' and 
+# This file is part of the GDB testsuite.  It tests 'until' and
 # 'advance' in precord logfile.
 
 # This test suitable only for process record-replay
@@ -147,7 +147,7 @@ gdb_test "advance $bp_location19" \
     "factorial .value=720.*${srcfile}:$bp_location19.*" \
     "reverse-advance to final return of factorial"
 
-# Now do "until" across the recursive calls, 
+# Now do "until" across the recursive calls,
 # ending up in the same frame where we are now.
 
 gdb_test "until $bp_location7" \
index 240f6da289165b899315ba3fb9d1b747a6c9d7a9..de138f53c64b3df11316449683e45e8ab757e00d 100644 (file)
@@ -13,7 +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/>.  */
 
-# This file is part of the GDB testsuite.  It tests 'until' and 
+# This file is part of the GDB testsuite.  It tests 'until' and
 # 'advance' in reverse debugging.
 
 require supports_reverse
@@ -34,7 +34,7 @@ set bp_location21 [gdb_get_line_number "set breakpoint 21 here"]
 
 runto_main
 
-if [supports_process_record] {
+if {[supports_process_record]} {
     # Activate process record/replay
     gdb_test_no_output "record" "turn on process record"
 }
@@ -120,7 +120,7 @@ gdb_test "advance $bp_location19" \
     "factorial .value=720.*${srcfile}:$bp_location19.*" \
     "reverse-advance to final return of factorial"
 
-# Now do "until" across the recursive calls, 
+# Now do "until" across the recursive calls,
 # ending up in the same frame where we are now.
 
 gdb_test "until $bp_location7" \
index c1cb402db6d1e0e57d7b127410d6c730d38741c7..26c3c99cb07d058ef1e7e9943ccfe469997abd92 100644 (file)
@@ -31,7 +31,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
 
 runto_main
 
-if [supports_process_record] {
+if {[supports_process_record]} {
     # Activate process record/replay
     gdb_test_no_output "record" "turn on process record"
 }
index 6a694bec290dd2a05e3c5fda0da874b71d23ad60..567ae4a63a97f063fffd61d6fc89e7849e17f522 100644 (file)
@@ -28,7 +28,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
 
 runto_main
 
-if [supports_process_record] {
+if {[supports_process_record]} {
     # Activate process record/replay
     gdb_test_no_output "record" "turn on process record"
 }