From: Tom de Vries Date: Fri, 12 Sep 2025 04:59:57 +0000 (+0200) Subject: [gdb/testsuite, tclint] Fix gdb.testsuite X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e0e92df9201212431e02eb649e4942f074c7ecdc;p=thirdparty%2Fbinutils-gdb.git [gdb/testsuite, tclint] Fix gdb.testsuite Running tclint on the test-cases in gdb.testsuite shows a few problems: ... board-sanity.exp:47:38: line has trailing whitespace [trailing-whitespace] board-sanity.exp:83:1: line has trailing whitespace [trailing-whitespace] board-sanity.exp:95:38: line has trailing whitespace [trailing-whitespace] gdb-caching-proc-consistency.exp:66:2: expected braced word or word without \ substitutions in argument interpreted as expr [command-args] gdb-caching-proc-consistency.exp:117:12: eval received an argument with a \ substitution, unable to parse its arguments [command-args] with-override.exp:53:18: expression with substitutions should be enclosed by \ braces [unbraced-expr] with-override.exp:57:18: expression with substitutions should be enclosed by \ braces [unbraced-expr] ... Fix these. Tested on x86_64-linux. --- diff --git a/gdb/testsuite/gdb.testsuite/board-sanity.exp b/gdb/testsuite/gdb.testsuite/board-sanity.exp index 9c802822f0f..7b9a19e86b0 100644 --- a/gdb/testsuite/gdb.testsuite/board-sanity.exp +++ b/gdb/testsuite/gdb.testsuite/board-sanity.exp @@ -44,7 +44,7 @@ proc test_remote { remote host_is_target } { if { $host_is_target } { set res [remote_file $other_remote exists $file] gdb_assert { $res != $exists_ok } \ - "$other_remote copy does not exist" + "$other_remote copy does not exist" } } @@ -80,7 +80,7 @@ proc test_remote { remote host_is_target } { set build_file [remote_upload $remote $file] gdb_assert { [string equal [file tail $build_file] $file] == 1 } \ "remote_upload returns valid value" - + set res [remote_file $remote delete $file] gdb_assert { [string equal $res $delete_ok] == 1 } \ "remove $remote copy" @@ -92,7 +92,7 @@ proc test_remote { remote host_is_target } { if { $host_is_target } { set res [remote_file $other_remote exists $file] gdb_assert { $res != $exists_ok } \ - "$other_remote copy does not exist" + "$other_remote copy does not exist" } set res [remote_file build exists $file] diff --git a/gdb/testsuite/gdb.testsuite/gdb-caching-proc-consistency.exp b/gdb/testsuite/gdb.testsuite/gdb-caching-proc-consistency.exp index 4676a41803f..27f905e9f64 100644 --- a/gdb/testsuite/gdb.testsuite/gdb-caching-proc-consistency.exp +++ b/gdb/testsuite/gdb.testsuite/gdb-caching-proc-consistency.exp @@ -63,8 +63,8 @@ proc test_file { file } { set fp [open $file] while { [gets $fp line] >= 0 } { - if [regexp -- "^gdb_caching_proc \[ \t\]*(\[^ \t\]*)" $line \ - match procname] { + if { [regexp -- "^gdb_caching_proc \[ \t\]*(\[^ \t\]*)" $line \ + match procname] } { lappend procnames $procname } } @@ -114,7 +114,7 @@ if { ![gdb_simple_compile $me $src executable] } { } # Test gdb_caching_procs in gdb/testsuite/lib/*.exp -set files [eval glob -types f $srcdir/lib/*.exp] +set files [glob -types f $srcdir/lib/*.exp] set files [lsort $files] foreach file $files { test_file $file diff --git a/gdb/testsuite/gdb.testsuite/with-override.exp b/gdb/testsuite/gdb.testsuite/with-override.exp index 91801501ee4..1a4ee6adbbb 100644 --- a/gdb/testsuite/gdb.testsuite/with-override.exp +++ b/gdb/testsuite/gdb.testsuite/with-override.exp @@ -50,11 +50,11 @@ with_test_prefix no-args { } proc foo { {a 0} } { - return [expr $a + 1] + return [expr {$a + 1}] } proc foo_plus_1 { {a 0} } { - return [expr $a + 2] + return [expr {$a + 2}] } with_test_prefix default-arg {