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

Fix these.

Tested on x86_64-linux.

29 files changed:
gdb/tclint.toml
gdb/testsuite/gdb.btrace/buffer-size.exp
gdb/testsuite/gdb.btrace/data.exp
gdb/testsuite/gdb.btrace/delta.exp
gdb/testsuite/gdb.btrace/dlopen.exp
gdb/testsuite/gdb.btrace/enable-new-thread.exp
gdb/testsuite/gdb.btrace/enable-running.exp
gdb/testsuite/gdb.btrace/enable.exp
gdb/testsuite/gdb.btrace/exception.exp
gdb/testsuite/gdb.btrace/function_call_history.exp
gdb/testsuite/gdb.btrace/gcore.exp
gdb/testsuite/gdb.btrace/instruction_history.exp
gdb/testsuite/gdb.btrace/multi-inferior.exp
gdb/testsuite/gdb.btrace/multi-thread-step.exp
gdb/testsuite/gdb.btrace/nohist.exp
gdb/testsuite/gdb.btrace/non-stop.exp
gdb/testsuite/gdb.btrace/ptwrite.exp
gdb/testsuite/gdb.btrace/reconnect.exp
gdb/testsuite/gdb.btrace/record_goto-step.exp
gdb/testsuite/gdb.btrace/record_goto.exp
gdb/testsuite/gdb.btrace/rn-dl-bind.exp
gdb/testsuite/gdb.btrace/segv.exp
gdb/testsuite/gdb.btrace/step.exp
gdb/testsuite/gdb.btrace/stepi.exp
gdb/testsuite/gdb.btrace/tailcall-only.exp
gdb/testsuite/gdb.btrace/tailcall.exp
gdb/testsuite/gdb.btrace/tsx.exp
gdb/testsuite/gdb.btrace/unknown_functions.exp
gdb/testsuite/gdb.btrace/vdso.exp

index 3dcfe72e4e08fe3b233839539fa19d739f6b9930..1c9f99b1e14fbf43dc4429b7eaa3cdc917b4657c 100644 (file)
@@ -22,7 +22,6 @@ exclude = [
 "gdb/testsuite/lib",
 "gdb/testsuite/gdb.arch",
 "gdb/testsuite/gdb.base",
-"gdb/testsuite/gdb.btrace",
 "gdb/testsuite/gdb.cp",
 "gdb/testsuite/gdb.dwarf2",
 "gdb/testsuite/gdb.mi",
index 3a54baa5772ad8f4bd68e3fb0ca370635e796c5a..16958aee4d5ab190a21f9eb365a07c7bb04c663f 100644 (file)
 require allow_btrace_tests
 
 standard_testfile record_goto.c
-if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index d42d01716915a19ece1834240f69c85f51610a94..42451572b72ae529180bc36b18cf2dbf4159a002 100644 (file)
 require allow_btrace_tests
 
 standard_testfile
-if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 0807c58c93b9bae67347056192119eb30dd8109d..64e965dd14ba6b884815a4f5ed91d8fb01fb50aa 100644 (file)
 require allow_btrace_tests
 
 standard_testfile record_goto.c
-if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 092f4b00fb9929abf0dc10d0d13ef69b6ba67fff..1383bd93fccab3dc2b7726c5113c4e8dfac1bf2e 100644 (file)
@@ -33,7 +33,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index ee7c023ab4488021d567858f70171c7b086e67f8..ab73d45abdcdce97b2e04ed4cc610019c2325a4b 100644 (file)
 require allow_btrace_tests
 
 standard_testfile
-if [prepare_for_testing "failed to prepare" $testfile $srcfile {debug pthreads}] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug pthreads}]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 1daa005129fa05a4e594f1359554849510b67a78..92ae5663cc44b8c1db663264beb4d283dfc21b2c 100644 (file)
@@ -29,7 +29,7 @@ save_vars { GDBFLAGS } {
     clean_restart $testfile
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index ad62733caf4f9d893e0336e3eeb8879727522a5f..cc48cc246545d45f1056f49aca90d0518369fde4 100644 (file)
@@ -35,11 +35,11 @@ gdb_test "record instruction-history" "No recording is currently active\\..*" "r
 gdb_test "info record" "No recording is currently active\\." "info record without target"
 
 standard_testfile
-if [prepare_for_testing "failed to prepare" $testfile {} {debug}] {
+if {[prepare_for_testing "failed to prepare" $testfile {} {debug}]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
@@ -78,20 +78,20 @@ gdb_exit
 load_lib gdbserver-support.exp
 require allow_gdbserver_tests
 clean_restart $testfile
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
 # make sure record-btrace can be enabled after re-run
 clean_restart $testfile
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 gdb_test_no_output "record btrace" "enable after restart"
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 gdb_test_no_output "record btrace" "enable after re-run"
index 67e9fbdcd89adf07596bb299ed25641b104ec8d9..61a4bd9371d9801bf571ce46611c87c096c97eaa 100755 (executable)
@@ -22,12 +22,12 @@ require allow_btrace_tests
 # We expect a specific function call history.  This gets messed up with
 # PIE on 32-bit.
 standard_testfile exception.cc
-if [prepare_for_testing "failed to prepare" $testfile $srcfile \
-       {nopie c++ debug}] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
+        {nopie c++ debug}]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index e233936e2bc1d608b00b53b4736b2c70a6bcf188..325099a0c3392bd8ae76a67f2eb2ec0d56ef040c 100644 (file)
@@ -22,11 +22,11 @@ require allow_btrace_tests
 # We expect a specific function call history.  This gets messed up with
 # PIE on 32-bit.
 standard_testfile
-if [prepare_for_testing "failed to prepare" $testfile {} {nopie debug}] {
+if {[prepare_for_testing "failed to prepare" $testfile {} {nopie debug}]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
@@ -226,7 +226,7 @@ gdb_test "record function-call-history /c 21, +11" [multi_line \
   ] "indented"
 
 # make sure we can handle incomplete trace with respect to indentation
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 # navigate to the fib in line 24 above
index b9e96d4e01162169da73ded744ed43f9eb0dcff2..6d7ba5caa283116efc3fe6328189e2017e658a45 100644 (file)
 require allow_btrace_tests
 
 standard_testfile record_goto.c
-if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 4e20194e38c547b4b9b7c60fe2cf49fc29cde840..fb68b3322717bf57ec0b077da6f6ea61c14e5171 100644 (file)
 require allow_btrace_tests
 
 standard_testfile .c .S
-if [prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2" {debug}] {
+if {[prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2" {debug}]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index d87a94160a7313a0d7db8c88f1838b1d8896a96a..fc75233e58fc1dcb94ba683033ea95dea281fcc8 100644 (file)
@@ -29,14 +29,14 @@ require allow_multi_inferior_tests
 require !use_gdb_stub
 
 standard_testfile
-if [prepare_for_testing "failed to prepare" $testfile {} {debug}] {
+if {[prepare_for_testing "failed to prepare" $testfile {} {debug}]} {
     return -1
 }
 
 set host_binfile [gdb_remote_download host $binfile]
 
 with_test_prefix "inferior 1" {
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 }
@@ -46,7 +46,7 @@ with_test_prefix "inferior 2" {
        "add second inferior"
     gdb_test "inferior 2" "Switching to inferior 2.*"
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
@@ -65,7 +65,7 @@ with_test_prefix "inferior 3" {
        "add third inferior"
     gdb_test "inferior 3" "Switching to inferior 3.*"
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
index 9f4c6c0a9d47494d45d68c73e14590f620d0a442..7a769b55af9d2165d71994ffb3645a99ebd40492 100644 (file)
@@ -26,7 +26,7 @@ if {[gdb_compile_pthreads "$srcdir/$subdir/$srcfile" "$binfile" executable {debu
 }
 clean_restart $testfile
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index f573ed35fd7e151022338680cf2093bb1d488ef3..220a38030689ab75c96a2114f99334852499bde2 100644 (file)
 require allow_btrace_tests
 
 standard_testfile record_goto.c
-if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 856985c7534bce0f1db57acadfdc088cd3cddb7b..bc5ebdbcb0e9e7dc028ed863ee23116ffdc30400 100644 (file)
@@ -28,7 +28,7 @@ save_vars { GDBFLAGS } {
     clean_restart $testfile
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 0c2bb7c3825fb8a9d14f42ef40908f62ce50d46a..52074886b029b447ceec15686038747a0a523f86 100644 (file)
@@ -21,7 +21,7 @@ require allow_btrace_ptw_tests allow_python_tests
 
 set opts {}
 
-if [info exists COMPILE] {
+if {[info exists COMPILE]} {
     # make check RUNTESTFLAGS="gdb.btrace/ptwrite.exp COMPILE=1"
     standard_testfile ptwrite.c
     lappend opts debug additional_flags=-mptwrite
@@ -36,7 +36,7 @@ if [info exists COMPILE] {
     return -1
 }
 
-if [prepare_for_testing "failed to prepare" $testfile $srcfile $opts] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile $opts]} {
     return -1
 }
 
index 15a0bca615da194df507591bf1c8020c332e200a..44a91215a07e94b6967124267be9001b7a2213c3 100644 (file)
@@ -23,7 +23,7 @@ require allow_btrace_tests
 require allow_gdbserver_tests
 
 standard_testfile
-if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
     return -1
 }
 
index 10307a7abf4e59d6074f4c10be16def56cb9fb38..d881cf73763ef55eec357b569770d712a69541dc 100644 (file)
 require allow_btrace_tests
 
 standard_testfile record_goto.c
-if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index b1b3c09757a1ca5f34117a302f28aa741da99e47..f7dbe10ee0134bd6aaed74108d3b6b448124fde0 100644 (file)
@@ -28,7 +28,7 @@ require allow_btrace_tests
 # Luckily, they are similar enough that a single test script can handle
 # both.
 set opts {}
-if [info exists COMPILE] {
+if {[info exists COMPILE]} {
     # make check RUNTESTFLAGS="gdb.btrace/record_goto.exp COMPILE=1"
     standard_testfile record_goto.c
     lappend opts debug
@@ -43,11 +43,11 @@ if [info exists COMPILE] {
     return -1
 }
 
-if [prepare_for_testing "failed to prepare" $testfile $srcfile $opts] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile $opts]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 6592b74cfbe7917136a933f50d005972c84607ac..22ce8e51e595d046bca92ea856f40ea834d5bae5 100644 (file)
 require allow_btrace_tests
 
 standard_testfile
-if [prepare_for_testing "failed to prepare" $testfile $srcfile \
-       {debug ldflags=-Wl,-z,lazy}] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
+        {debug ldflags=-Wl,-z,lazy}]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 628c155cdabec80407833f41166e71a235812542..509bcf1bc568512e815aca861bcf83980a4c570c 100644 (file)
 require allow_btrace_tests
 
 standard_testfile
-if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
     return -1
 }
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 7852d65524a996a19007e1e26e79a8f8c8cabe4f..e96714a0017cd65a88e3d7569ee830c88919ca34 100644 (file)
 require allow_btrace_tests
 
 standard_testfile record_goto.c
-if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 3684bef8c85135500915a3ba2e5b6d4d8361d090..a37d1440809848eaa43abd3d0e7d57071d16ffd1 100644 (file)
@@ -26,7 +26,7 @@ require allow_btrace_tests
 #
 # Luckily, they are similar enough that a single test script can handle
 # both.
-if [info exists COMPILE] {
+if {[info exists COMPILE]} {
     # make check RUNTESTFLAGS="gdb.btrace/stepi.exp COMPILE=1"
     standard_testfile record_goto.c
     lappend opts debug
@@ -41,11 +41,11 @@ if [info exists COMPILE] {
     return -1
 }
 
-if [prepare_for_testing "failed to prepare" $testfile $srcfile {}] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile {}]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index c4f032ada558ff1de0e1a927cc2140a4844b472b..5010d16a713a857b091ca97e6f42ff0fe590f3fd 100644 (file)
@@ -30,7 +30,7 @@ require allow_btrace_tests
 # Luckily, they are similar enough that a single test script can handle
 # both.
 set opts {}
-if [info exists COMPILE] {
+if {[info exists COMPILE]} {
     # make check RUNTESTFLAGS="gdb.btrace/tailcall-only.exp COMPILE=1"
     standard_testfile tailcall-only.c
     lappend opts debug optimize=-O2
@@ -45,11 +45,11 @@ if [info exists COMPILE] {
     return -1
 }
 
-if [prepare_for_testing "failed to prepare" $testfile $srcfile $opts] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile $opts]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 50d0a8bc85aa654c6f623dcdc69b6e51d7e541dd..d4d445c3e050e90c9bcf53ce07cd0f4f42b52bc5 100644 (file)
@@ -27,7 +27,7 @@ require allow_btrace_tests
 # Luckily, they are similar enough that a single test script can handle
 # both.
 set opts {}
-if [info exists COMPILE] {
+if {[info exists COMPILE]} {
     # make check RUNTESTFLAGS="gdb.btrace/tailcall.exp COMPILE=1"
     standard_testfile tailcall.c
     lappend opts debug optimize=-O2
@@ -42,10 +42,10 @@ if [info exists COMPILE] {
     return -1
 }
 
-if [prepare_for_testing "failed to prepare" $testfile $srcfile $opts] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile $opts]} {
     return -1
 }
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 168319beb1cf909c84edc31fb20cf32815c3ba6a..6da3fa7510d55c54724f4e54ddb58543ec0a4588 100644 (file)
 require allow_btrace_pt_tests allow_tsx_tests
 
 standard_testfile .c x86-tsx.S
-if [prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2" {debug}] {
+if {[prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2" {debug}]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 61aed6f9874ab34a2eaac2145979aa8a768451a1..0696d8b8b19a10f4a2294e3b4eb68d4d14570821 100644 (file)
@@ -25,12 +25,12 @@ standard_testfile
 # PIE on 32-bit.
 #
 # Also discard local symbols.
-if [prepare_for_testing "failed to prepare" $testfile $srcfile \
-       {ldflags=-Wl,-x nopie}] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
+        {ldflags=-Wl,-x nopie}]} {
     return -1
 }
 
-if ![runto test] {
+if {![runto test]} {
     return -1
 }
 
index 1e19f99d8d1d1bef9cafd2c7766f4d36d15e7dcc..0484da18ac040de92d7eaf2bb5c4889a2c6899fd 100644 (file)
 require allow_btrace_tests
 
 standard_testfile
-if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }