From: Tom de Vries Date: Wed, 17 Sep 2025 04:53:14 +0000 (+0200) Subject: [gdb/testsuite, tclint] Fix gdb.linespec X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c94897be07be83ed8a14073382a5f0b3c9125a9c;p=thirdparty%2Fbinutils-gdb.git [gdb/testsuite, tclint] Fix gdb.linespec Running tclint on the test-cases in gdb.linespec shows a few problems. Fix these. Tested on x86_64-linux. --- diff --git a/gdb/testsuite/gdb.linespec/cp-replace-typedefs-ns-template.exp b/gdb/testsuite/gdb.linespec/cp-replace-typedefs-ns-template.exp index 77757fc5785..db6ed693659 100644 --- a/gdb/testsuite/gdb.linespec/cp-replace-typedefs-ns-template.exp +++ b/gdb/testsuite/gdb.linespec/cp-replace-typedefs-ns-template.exp @@ -93,7 +93,7 @@ foreach loc { "NS1::NS2::AliasTempl::static_method(NS1::NS2::object*)" "NS1::NS2::AliasTempl::static_method(NS1::NS2::object_p)" } { - if [test_compiler_info gcc*] { + if {[test_compiler_info gcc*]} { # While Clang emits "AliasTempl" (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" 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" } } diff --git a/gdb/testsuite/gdb.linespec/cpcompletion.exp b/gdb/testsuite/gdb.linespec/cpcompletion.exp index 6c1c5514538..2f1cc84a934 100644 --- a/gdb/testsuite/gdb.linespec/cpcompletion.exp +++ b/gdb/testsuite/gdb.linespec/cpcompletion.exp @@ -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" diff --git a/gdb/testsuite/gdb.linespec/keywords.exp b/gdb/testsuite/gdb.linespec/keywords.exp index 42a92286a29..b1df13a7e49 100644 --- a/gdb/testsuite/gdb.linespec/keywords.exp +++ b/gdb/testsuite/gdb.linespec/keywords.exp @@ -22,7 +22,7 @@ if {[prepare_for_testing "failed to prepare" $exefile $srcfile {debug}]} { return -1 } -if ![runto_main] { +if {![runto_main]} { return 0 } diff --git a/gdb/testsuite/gdb.linespec/ls-errs.exp b/gdb/testsuite/gdb.linespec/ls-errs.exp index fc003ea4d8c..56f946720bb 100644 --- a/gdb/testsuite/gdb.linespec/ls-errs.exp +++ b/gdb/testsuite/gdb.linespec/ls-errs.exp @@ -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 diff --git a/gdb/testsuite/gdb.linespec/macro-relative.exp b/gdb/testsuite/gdb.linespec/macro-relative.exp index 94ab16a2eff..c076e020beb 100644 --- a/gdb/testsuite/gdb.linespec/macro-relative.exp +++ b/gdb/testsuite/gdb.linespec/macro-relative.exp @@ -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 } diff --git a/gdb/testsuite/gdb.linespec/skip-two.exp b/gdb/testsuite/gdb.linespec/skip-two.exp index 6e3ab300149..cfd91da7a13 100644 --- a/gdb/testsuite/gdb.linespec/skip-two.exp +++ b/gdb/testsuite/gdb.linespec/skip-two.exp @@ -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 } diff --git a/gdb/testsuite/gdb.linespec/thread.exp b/gdb/testsuite/gdb.linespec/thread.exp index d2f7b257d46..f5cdf8bc9e2 100644 --- a/gdb/testsuite/gdb.linespec/thread.exp +++ b/gdb/testsuite/gdb.linespec/thread.exp @@ -23,7 +23,7 @@ if {[prepare_for_testing "failed to prepare" $exefile $srcfile {debug}]} { return -1 } -if ![runto_main] { +if {![runto_main]} { return 0 }