]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite, tclint] Fix lib/prelink-support.exp
authorTom de Vries <tdevries@suse.de>
Sun, 5 Oct 2025 20:50:09 +0000 (22:50 +0200)
committerTom de Vries <tdevries@suse.de>
Sun, 5 Oct 2025 20:50:09 +0000 (22:50 +0200)
gdb/tclint.toml
gdb/testsuite/lib/prelink-support.exp

index 00351d01402d9bb414748fc1e0104948d6f70f75..61ad375bc74fb3d19ac1c34e59f7dbd31a364cbb 100644 (file)
@@ -41,7 +41,6 @@ exclude = [
 "gdb/testsuite/lib/gen-perf-test.exp",
 "gdb/testsuite/lib/mi-support.exp",
 "gdb/testsuite/lib/pascal.exp",
-"gdb/testsuite/lib/prelink-support.exp",
 # IGNORE (document reason in trailing comment):
 "gdb/testsuite/gdb.stabs", # To be removed.
 "gdb/testsuite/lib/ton.tcl", # Imported.
index a712a7a375f22a32ed20d14d484880e34e709b93..beadd61e292a3700e7f7d7126d75e115799f0795 100644 (file)
@@ -27,7 +27,7 @@ proc symlink_resolve {file} {
        verbose -log "Resolved symlink $file targeting $target as $src2"
        set file $src2
 
-       set loop [expr $loop + 1]
+       set loop [expr {$loop + 1}]
        if {$loop > 30} {
            fail "looping symlink resolution for $file"
            return ""
@@ -49,7 +49,7 @@ proc file_copy {src dest} {
     set test "copy [file tail $src] to [file tail $dest]"
     set command "file copy -force -- $src $dest"
     verbose -log "command is $command"
-    if [catch $command] {
+    if {[catch {{*}$command}]} {
        fail $test
        return 0
     } else {
@@ -99,7 +99,7 @@ proc build_executable_own_libs {testname executable sources options {interp ""}
     set ldd [gdb_find_ldd]
     set command "$ldd $binfile"
     set test "ldd $executable"
-    set result [catch "exec $command" output]
+    set result [catch {exec {*}$command} output]
     verbose -log "result of $command is $result"
     verbose -log "output of $command is $output"
     if {$result != 0 || $output == ""} {
@@ -173,7 +173,7 @@ proc prelink_no {arg {name {}}} {
     set test "unprelink $name"
     set command "exec /usr/sbin/prelink -uN $arg"
     verbose -log "command is $command"
-    set result [catch $command output]
+    set result [catch {{*}$command} output]
     verbose -log "result is $result"
     verbose -log "output is $output"
     if {$result == 1 && [regexp {^(couldn't execute "/usr/sbin/prelink[^\r\n]*": no such file or directory\n?)*$} $output]} {
@@ -182,14 +182,14 @@ proc prelink_no {arg {name {}}} {
        # have already been prelinked).
        set test "$test (missing /usr/sbin/prelink)"
        foreach bin [split $arg] {
-           if [string match "-*" $bin] {
+           if {[string match "-*" $bin]} {
                # Skip prelink options.
                continue
            }
            set readelf_program [gdb_find_readelf]
            set command "exec $readelf_program -WS $bin"
            verbose -log "command is $command"
-           set result [catch $command output]
+           set result [catch {{*}$command} output]
            verbose -log "result is $result"
            verbose -log "output is $output"
            if {$result != 0 || [string match {* .gnu.prelink_undo *} $output]} {
@@ -204,7 +204,7 @@ proc prelink_no {arg {name {}}} {
        verbose -log "$name has been now unprelinked"
        set command "exec /usr/sbin/prelink -uN $arg"
        verbose -log "command is $command"
-       set result [catch $command output]
+       set result [catch {{*}$command} output]
        verbose -log "result is $result"
        verbose -log "output is $output"
     }
@@ -230,7 +230,7 @@ proc prelink_yes {arg {name ""}} {
     # Try to unprelink it first so that, if it has been already prelinked
     # before, we get a different address now, making the new result unaffected
     # by any previous prelinking.
-    if ![prelink_no $arg "$name pre-unprelink"] {
+    if {![prelink_no $arg "$name pre-unprelink"]} {
        return 0
     }
 
@@ -251,7 +251,7 @@ proc prelink_yes {arg {name ""}} {
     set command "exec /usr/sbin/prelink -qNR --no-exec-shield $arg"
 
     verbose -log "command is $command"
-    set result [catch $command output]
+    set result [catch {{*}$command} output]
     verbose -log "result is $result"
     verbose -log "output is $output"
     if {$result == 1 && [regexp {^(couldn't execute "/usr/sbin/prelink[^\r\n]*": no such file or directory\n?)*$} $output]} {