From: Tom de Vries Date: Wed, 17 Sep 2025 04:53:14 +0000 (+0200) Subject: [gdb/testsuite, tclint] Fix gdb.gdb X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3ca45b94219e664680dd422a043851158bd4a634;p=thirdparty%2Fbinutils-gdb.git [gdb/testsuite, tclint] Fix gdb.gdb Running tclint on the test-cases in gdb.gdb shows a few problems. Fix these. Tested on x86_64-linux. --- diff --git a/gdb/testsuite/gdb.gdb/index-file.exp b/gdb/testsuite/gdb.gdb/index-file.exp index ee5b6451274..5229446e35b 100644 --- a/gdb/testsuite/gdb.gdb/index-file.exp +++ b/gdb/testsuite/gdb.gdb/index-file.exp @@ -107,7 +107,7 @@ proc check_symbol_table_usage { filename } { _ _ _ symbol_table_offset shortcut_offset # The length of the symbol hash table (in entries). - set len [expr ($shortcut_offset - $symbol_table_offset) / 8] + set len [expr {($shortcut_offset - $symbol_table_offset) / 8}] # Now walk the hash table and count how many entries are in use. set offset $symbol_table_offset @@ -127,7 +127,7 @@ proc check_symbol_table_usage { filename } { close $fp # Calculate how full the cache is. - set pct [expr (100 * double($count)) / $len] + set pct [expr {(100 * double($count)) / $len}] # Write our results out to the gdb.log. verbose -log "Hash table size: $len" @@ -153,7 +153,7 @@ if { $worker_threads > 1 } { clean_restart # Adjust the number of threads to use. - set reduced_threads [expr $worker_threads / 2] + set reduced_threads [expr {$worker_threads / 2}] gdb_test_no_output "maint set worker-threads $reduced_threads" with_timeout_factor $timeout_factor { diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp index f5cea1de10c..7fa320e4ebe 100644 --- a/gdb/testsuite/gdb.gdb/selftest.exp +++ b/gdb/testsuite/gdb.gdb/selftest.exp @@ -56,7 +56,7 @@ proc test_with_self { } { } # start the "xgdb" process - if [target_info exists gdb,noinferiorio] { + if {[target_info exists gdb,noinferiorio]} { # With no way to interact with the inferior GDB, all we can do # is let it run. send_gdb "continue\n" @@ -98,7 +98,7 @@ proc test_with_self { } { } # kill the xgdb process - if ![target_info exists gdb,nointerrupts] { + if {![target_info exists gdb,nointerrupts]} { set description "send ^C to child process" send_gdb "\003" # "Thread 1" is displayed iff Guile support is linked in. @@ -147,7 +147,7 @@ proc test_with_self { } { # Switch back to the GDB thread if Guile support is linked in. # "signal SIGINT" could also switch the current thread. gdb_test "thread 1" {\[Switching to thread 1 .*\].*} - + # get a stack trace # # This fails on some linux systems for unknown reasons. On the