]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite, tclint] Fix gdb.linespec
authorTom de Vries <tdevries@suse.de>
Wed, 17 Sep 2025 04:53:14 +0000 (06:53 +0200)
committerTom de Vries <tdevries@suse.de>
Wed, 17 Sep 2025 04:53:14 +0000 (06:53 +0200)
Running tclint on the test-cases in gdb.linespec shows a few problems.

Fix these.

Tested on x86_64-linux.

gdb/testsuite/gdb.linespec/cp-replace-typedefs-ns-template.exp
gdb/testsuite/gdb.linespec/cpcompletion.exp
gdb/testsuite/gdb.linespec/keywords.exp
gdb/testsuite/gdb.linespec/ls-errs.exp
gdb/testsuite/gdb.linespec/macro-relative.exp
gdb/testsuite/gdb.linespec/skip-two.exp
gdb/testsuite/gdb.linespec/thread.exp

index 77757fc5785e6b71e96fe3e2a8491616cd122d72..db6ed693659fe92b4fe349afaa1c4032f692740f 100644 (file)
@@ -93,7 +93,7 @@ foreach loc {
     "NS1::NS2::AliasTempl<int>::static_method<int>(NS1::NS2::object*)"
     "NS1::NS2::AliasTempl<int>::static_method<int>(NS1::NS2::object_p)"
 } {
-    if [test_compiler_info gcc*] {
+    if {[test_compiler_info gcc*]} {
        # While Clang emits "AliasTempl<int>" (etc.) typedefs, GCC
        # emits "AliasTempl" typedefs with no template parameter info.
        setup_xfail gcc/95437 *-*-*
@@ -104,7 +104,7 @@ foreach loc {
     # instead of succeeding with e.g., "AliasTempl<int>" preserved in
     # the location text.  If that ever happens, we'll need to update
     # these tests.
-    if [test_compiler_info gcc*] {
+    if {[test_compiler_info gcc*]} {
        check_setting_bp_fails "b $loc"
     }
 }
index 6c1c551453845f4bcbce1186b476754b12d3a81a..2f1cc84a93410eca3a5750251c4787b49ea7de31 100644 (file)
@@ -779,7 +779,7 @@ proc test_makem_1 {arglist_list expected_list} {
     send_log "expecting $expected_list\n"
 
     # Do list equality via canonical strings.
-    if {[expr {[list {*}$expected_list] eq [list {*}$result]}]} {
+    if {[string eq $expected_list eq $result]} {
        pass "makem unit test: $arglist"
     } else {
        fail "makem unit test: $arglist"
index 42a92286a295307821f5a170b94272ef6e324568..b1df13a7e49442c8c5ddb427cabb9e1e3535e14e 100644 (file)
@@ -22,7 +22,7 @@ if {[prepare_for_testing "failed to prepare" $exefile $srcfile {debug}]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return 0
 }
 
index fc003ea4d8c5c7e019907da47ebe097a33eec0e7..56f946720bbc8f8a2a19e77c91b832cea390ca10 100644 (file)
@@ -22,7 +22,7 @@ proc do_test {lang} {
 
     standard_testfile
     set exefile $testfile
-    if [info exists compiler_info] {
+    if {[info exists compiler_info]} {
        # Unsetting compiler_info allows us to switch compilers
        # used by prepare_for_testing.
         unset compiler_info
index 94ab16a2eff7b171cd7ce190e203552b4c99eb18..c076e020beb64f6e4d368f4eafc828286a95b322 100644 (file)
@@ -41,7 +41,7 @@ clean_restart ${testfile}
 # Test macros respect DW_AT_comp_dir.
 
 # "list header_two_func" does not set exactly the one line we want.
-if ![runto header_two_func] {
+if {![runto header_two_func]} {
     return -1
 }
 
index 6e3ab300149a69b66429c1d7ef3225713f396fb4..cfd91da7a13d2bc2a9e0f068ced57e3e5eec9e8a 100644 (file)
@@ -31,7 +31,7 @@ if {[prepare_for_testing "failed to prepare" $execfile \
 gdb_test "skip function dupname" \
         {Function dupname will be skipped when stepping\.}
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
@@ -63,7 +63,7 @@ gdb_test_no_output "skip delete 1"
 gdb_test "skip file thefile.cc" \
         {File thefile\.cc will be skipped when stepping\.}
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index d2f7b257d46c726fce5d66e6c14962bb838c2ae3..f5cdf8bc9e2bea8c7574e80a78436c31d1ed6354 100644 (file)
@@ -23,7 +23,7 @@ if {[prepare_for_testing "failed to prepare" $exefile $srcfile {debug}]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return 0
 }