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 ""
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 {
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 == ""} {
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]} {
# 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]} {
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"
}
# 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
}
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]} {