]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite, tclint] Fix gdb.gdb
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.gdb shows a few problems.

Fix these.

Tested on x86_64-linux.

gdb/testsuite/gdb.gdb/index-file.exp
gdb/testsuite/gdb.gdb/selftest.exp

index ee5b6451274b1d11b916fd0dc608edcb13d05934..5229446e35b94718ee32b642311db6928669fed0 100644 (file)
@@ -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 {
index f5cea1de10cff19cd90424e7fbc4a21a28125b94..7fa320e4ebe9494b55416ac116ef3e31f0b2c6e9 100644 (file)
@@ -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