diff options
Diffstat (limited to 'gdb/testsuite/gdb.base')
294 files changed, 1003 insertions, 984 deletions
diff --git a/gdb/testsuite/gdb.base/a2-run.exp b/gdb/testsuite/gdb.base/a2-run.exp index 966e12a..0df7558 100644 --- a/gdb/testsuite/gdb.base/a2-run.exp +++ b/gdb/testsuite/gdb.base/a2-run.exp @@ -155,7 +155,7 @@ gdb_test_stdio "" "usage: factorial <number>" "" "run after setting args to nil # work with stub targets, where GDB connects to debug an already started # process. -if [use_gdb_stub] { +if {[use_gdb_stub]} { verbose "Skipping rest of a2-run.exp because target is a stub." return } diff --git a/gdb/testsuite/gdb.base/access-mem-running.exp b/gdb/testsuite/gdb.base/access-mem-running.exp index 280e89b..ca30ec2 100644 --- a/gdb/testsuite/gdb.base/access-mem-running.exp +++ b/gdb/testsuite/gdb.base/access-mem-running.exp @@ -36,7 +36,7 @@ proc test { non_stop } { gdb_load $binfile } - if ![runto_main] { + if {![runto_main]} { return -1 } @@ -114,7 +114,7 @@ proc test { non_stop } { } foreach non_stop { "off" "on" } { - set stop_mode [expr ($non_stop=="off")?"all-stop":"non-stop"] + set stop_mode [expr {($non_stop=="off")?"all-stop":"non-stop"}] with_test_prefix "$stop_mode" { test $non_stop } diff --git a/gdb/testsuite/gdb.base/advance-until-multiple-locations.exp b/gdb/testsuite/gdb.base/advance-until-multiple-locations.exp index 768500c..86b8e0d 100644 --- a/gdb/testsuite/gdb.base/advance-until-multiple-locations.exp +++ b/gdb/testsuite/gdb.base/advance-until-multiple-locations.exp @@ -33,14 +33,14 @@ set lineno [gdb_get_line_number "multiple locations here"] proc_with_prefix until_advance_lineno_from_inlined {cmd} { global lineno - if ![runto test] { + if {![runto test]} { return } gdb_breakpoint $lineno gdb_continue_to_breakpoint "break here" - set lineno2 [expr $lineno + 1] + set lineno2 [expr {$lineno + 1}] gdb_test "$cmd $lineno2" \ "inline_func .* at .*:$lineno2.*return i.*" \ @@ -53,7 +53,7 @@ proc_with_prefix until_advance_lineno_from_inlined {cmd} { proc_with_prefix until_advance_lineno_from_non_inlined {cmd} { global lineno - if ![runto test] { + if {![runto test]} { return } @@ -68,7 +68,7 @@ proc_with_prefix until_advance_lineno_from_non_inlined {cmd} { proc_with_prefix until_advance_inline_func {cmd} { global lineno - if ![runto test] { + if {![runto test]} { return } @@ -83,7 +83,7 @@ proc_with_prefix until_advance_inline_func {cmd} { proc_with_prefix advance_overload {} { global lineno - if ![runto test] { + if {![runto test]} { return } @@ -117,7 +117,7 @@ proc_with_prefix advance_overload {} { proc_with_prefix until_overload {} { global lineno - if ![runto test] { + if {![runto test]} { return } diff --git a/gdb/testsuite/gdb.base/advance.exp b/gdb/testsuite/gdb.base/advance.exp index d4e23ee..2051e9f 100644 --- a/gdb/testsuite/gdb.base/advance.exp +++ b/gdb/testsuite/gdb.base/advance.exp @@ -63,7 +63,7 @@ gdb_test "continue" \ ".*Breakpoint ${decimal}, main.*func3.*break here.*" \ "continue to call to func3 in main" -# Verify that "advance <funcname>" when funcname is called as parameter to +# Verify that "advance <funcname>" when funcname is called as parameter to # another function works. # gdb_test "advance foo" \ diff --git a/gdb/testsuite/gdb.base/all-architectures.exp.tcl b/gdb/testsuite/gdb.base/all-architectures.exp.tcl index 767b02d..5892ab7 100644 --- a/gdb/testsuite/gdb.base/all-architectures.exp.tcl +++ b/gdb/testsuite/gdb.base/all-architectures.exp.tcl @@ -187,7 +187,7 @@ proc gdb_test_no_output_osabi {cmd test} { set num_slices 8 set num_archs [llength $supported_archs] -set archs_per_slice [expr (($num_archs + $num_slices - 1) / $num_slices)] +set archs_per_slice [expr {(($num_archs + $num_slices - 1) / $num_slices)}] with_test_prefix "tests" { foreach_with_prefix osabi $supported_osabis { @@ -201,10 +201,10 @@ with_test_prefix "tests" { incr arch_count # Skip architectures outside our slice. - if {$arch_count < [expr $test_slice * $archs_per_slice]} { + if {$arch_count < $test_slice * $archs_per_slice} { continue } - if {$arch_count >= [expr ($test_slice + 1) * $archs_per_slice]} { + if {$arch_count >= ($test_slice + 1) * $archs_per_slice} { continue } @@ -312,7 +312,7 @@ with_test_prefix "tests" { foreach v $options { with_test_prefix "$var=$v" { gdb_test_no_output_osabi "$cmd $v" "$cmd" - run_axis $all_axes [expr $cur_axis + 1] $arch + run_axis $all_axes [expr {$cur_axis + 1}] $arch } } } diff --git a/gdb/testsuite/gdb.base/all-bin.exp b/gdb/testsuite/gdb.base/all-bin.exp index 847bcb9..d910965 100644 --- a/gdb/testsuite/gdb.base/all-bin.exp +++ b/gdb/testsuite/gdb.base/all-bin.exp @@ -19,7 +19,7 @@ # # tests for arithmetic, logical and relational operators # with mixed types -# +# diff --git a/gdb/testsuite/gdb.base/annota1.exp b/gdb/testsuite/gdb.base/annota1.exp index 744d825..0da5a09 100644 --- a/gdb/testsuite/gdb.base/annota1.exp +++ b/gdb/testsuite/gdb.base/annota1.exp @@ -60,7 +60,7 @@ set old_gdb_prompt $gdb_prompt set gdb_prompt "\r\n\032\032pre-prompt\r\n$gdb_prompt \r\n\032\032prompt\r\n" # -# Escape all the characters in the path that need it. For instance +# Escape all the characters in the path that need it. For instance # the directory name could contain '+'. # set escapedsrcfile [string_to_regexp ${srcdir}/${subdir}/${srcfile}] @@ -244,7 +244,7 @@ gdb_test_multiple "break handle_USR1" "break handle_USR1" { } # -# break at printf. When we are stopped at printf, we can test +# break at printf. When we are stopped at printf, we can test # gdb_test_multiple "break printf" "break printf" { -re "\r\n\032\032post-prompt\r\nBreakpoint.*at $hex.*\032\032breakpoints-invalid\r\n.*$gdb_prompt$" { @@ -336,14 +336,14 @@ gdb_test_multiple "backtrace" "backtrace from shlibrary" { # -# test printing a frame with some arguments: +# test printing a frame with some arguments: # annotate-arg-begin # annotate-arg-name-end # annotate-arg-value # annotate-arg-end # -if [target_info exists gdb,nosignals] { +if {[target_info exists gdb,nosignals]} { unsupported "send SIGUSR1" unsupported "backtrace @ signal handler" } else { @@ -507,10 +507,10 @@ gdb_test_multiple "info inferior 1" "get inferior pid" { # annotate-signal-name-end # annotate-signal-string # annotate-signal-string-end -# FIXME: annotate-signal not tested (requires that the inferior be +# FIXME: annotate-signal not tested (requires that the inferior be # stopped by a "random" signal) -if [target_info exists gdb,nosignals] { +if {[target_info exists gdb,nosignals]} { unsupported "signal sent" } else { gdb_test_multiple "signal SIGTRAP" "signal sent" { diff --git a/gdb/testsuite/gdb.base/annota3.exp b/gdb/testsuite/gdb.base/annota3.exp index e8ac305..9d94be9 100644 --- a/gdb/testsuite/gdb.base/annota3.exp +++ b/gdb/testsuite/gdb.base/annota3.exp @@ -85,7 +85,7 @@ gdb_test_multiple "end" "end if construct" { # # info break: # -send_gdb "info break\n" +send_gdb "info break\n" gdb_expect_list "breakpoint info" "$gdb_prompt$" [concat { "\r\n\032\032post-prompt\r\n" "Num Type Disp Enb Address +What\r\n" } [list \ @@ -114,7 +114,7 @@ gdb_expect_list "run until main breakpoint" "$gdb_prompt$" [concat { # We don't care about the annotated output for this operation, it is the same as # the one produced by run above # -send_gdb "next\n" +send_gdb "next\n" gdb_expect_list "go after array init line" "$gdb_prompt$" { "\r\n\032\032post-prompt\r\n" "\r\n\032\032starting\r\n" @@ -183,10 +183,10 @@ gdb_expect_list "backtrace from shlibrary" "$gdb_prompt$" { # -# test printing a frame with some arguments: +# test printing a frame with some arguments: # -if [target_info exists gdb,nosignals] { +if {[target_info exists gdb,nosignals]} { unsupported "send SIGUSR1" unsupported "backtrace @ signal handler" } else { @@ -345,7 +345,7 @@ gdb_test_multiple "info inferior 1" "$test" { # Send a signal that is not handled -if [target_info exists gdb,nosignals] { +if {[target_info exists gdb,nosignals]} { unsupported "signal sent" } else { send_gdb "signal SIGTRAP\n" diff --git a/gdb/testsuite/gdb.base/args.exp b/gdb/testsuite/gdb.base/args.exp index 3930059..07101da 100644 --- a/gdb/testsuite/gdb.base/args.exp +++ b/gdb/testsuite/gdb.base/args.exp @@ -21,7 +21,7 @@ require {!target_info exists noargs} # This test requires starting new inferior processes, skip it if the target # board is a stub. require !use_gdb_stub -require {expr [have_startup_shell] != -1} +require {expr {[have_startup_shell] != -1}} standard_testfile @@ -115,7 +115,7 @@ proc args_test { name arglist {re_esc_list {}} {re_no_esc_list {}} } { set re_list $re_no_esc_list } - set expected_len [expr 1 + [llength $re_list]] + set expected_len [expr {1 + [llength $re_list]}] gdb_test "print argc" \ "\\\$$::decimal = $expected_len" "argc for $name" @@ -144,7 +144,7 @@ proc args_test { name arglist {re_esc_list {}} {re_no_esc_list {}} } { gdb_test "print argv\[$i\]" \ "\\\$$::decimal = $::hex \"$arg\"" \ "argv\[$i\] for $name" - set i [expr $i + 1] + set i [expr {$i + 1}] } } } diff --git a/gdb/testsuite/gdb.base/argv0-symlink.exp b/gdb/testsuite/gdb.base/argv0-symlink.exp index daabe74..6edaea8 100644 --- a/gdb/testsuite/gdb.base/argv0-symlink.exp +++ b/gdb/testsuite/gdb.base/argv0-symlink.exp @@ -17,7 +17,7 @@ # command expanding symlinks in the name of the program being run. # This test uses pathnames on build to create symbolic links on host and # expects the test program running on target to see those symbolic links. -# Therefore, it can't work reliably on anything other than configurations +# Therefore, it can't work reliably on anything other than configurations # where build/host/target are all the same. require isnative @@ -47,7 +47,7 @@ with_test_prefix "file symlink" { clean_restart "$filelink" - if ![runto_main] { + if {![runto_main]} { return -1 } @@ -87,7 +87,7 @@ with_test_prefix "dir symlink" { clean_restart "$dirlink/$filelink" - if ![runto_main] { + if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/arithmet.exp b/gdb/testsuite/gdb.base/arithmet.exp index 9f9234b..4e0ea12 100644 --- a/gdb/testsuite/gdb.base/arithmet.exp +++ b/gdb/testsuite/gdb.base/arithmet.exp @@ -20,7 +20,7 @@ # # tests for correctness of arithmetic operators, associativity and precedence # with integer type variables -# +# # # test running programs @@ -54,7 +54,7 @@ gdb_test "print x" "14" gdb_test "print y" "2" gdb_test "print z" "2" gdb_test "print w" "3" - + gdb_test "print x+y" "16" gdb_test "print x-y" "12" gdb_test "print x*y" "28" diff --git a/gdb/testsuite/gdb.base/asmlabel.exp b/gdb/testsuite/gdb.base/asmlabel.exp index c4a3f0c..6a4d2a2 100644 --- a/gdb/testsuite/gdb.base/asmlabel.exp +++ b/gdb/testsuite/gdb.base/asmlabel.exp @@ -37,7 +37,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} { return -1 } -if ![runto_main] { +if {![runto_main]} { return 0 } diff --git a/gdb/testsuite/gdb.base/assign.exp b/gdb/testsuite/gdb.base/assign.exp index aaee796..b96588c 100644 --- a/gdb/testsuite/gdb.base/assign.exp +++ b/gdb/testsuite/gdb.base/assign.exp @@ -19,7 +19,7 @@ # # tests for all the assignemnt operators # with mixed types and with int type variables -# +# # # test running programs diff --git a/gdb/testsuite/gdb.base/async.exp b/gdb/testsuite/gdb.base/async.exp index cae10f7..2f3ee9f 100644 --- a/gdb/testsuite/gdb.base/async.exp +++ b/gdb/testsuite/gdb.base/async.exp @@ -109,7 +109,7 @@ gdb_test_multiple {x/2i $pc} "$test" { } } set next_insn_is_stmt \ - [expr [lsearch -regexp $is_stmt 0x0*$next_insn_addr] != -1] + [expr {[lsearch -regexp $is_stmt 0x0*$next_insn_addr] != -1}] if { $next_insn_is_stmt } { set prefix "" diff --git a/gdb/testsuite/gdb.base/attach-pie-misread.exp b/gdb/testsuite/gdb.base/attach-pie-misread.exp index 04fe951..5f85d00 100644 --- a/gdb/testsuite/gdb.base/attach-pie-misread.exp +++ b/gdb/testsuite/gdb.base/attach-pie-misread.exp @@ -39,18 +39,18 @@ proc read_phdr {binfile test} { set readelf_program [gdb_find_readelf] set command "exec $readelf_program -Wl $binfile" 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} { fail $test return } - if ![regexp {\nProgram Headers:\n *Type [^\n]* Align\n(.*?)\n\n} $output trash phdr] { + if {![regexp {\nProgram Headers:\n *Type [^\n]* Align\n(.*?)\n\n} $output trash phdr]} { fail "$test (no Program Headers)" return } - if ![regexp -line {^ *DYNAMIC +0x[0-9a-f]+ +(0x[0-9a-f]+) } $phdr trash dynamic_vaddr] { + if {![regexp -line {^ *DYNAMIC +0x[0-9a-f]+ +(0x[0-9a-f]+) } $phdr trash dynamic_vaddr]} { fail "$test (no DYNAMIC found)" return } @@ -74,7 +74,7 @@ set phdr [read_phdr $binfile "readelf initial scan"] set dynamic_vaddr [lindex $phdr 0] set align_max [lindex $phdr 1] -set stub_size [format 0x%x [expr "2 * $align_max - ($dynamic_vaddr & ($align_max - 1))"]] +set stub_size [format 0x%x [expr {2 * $align_max - ($dynamic_vaddr & ($align_max - 1))}]] verbose -log "stub_size is $stub_size" # On x86_64 it is commonly about 4MB. @@ -86,7 +86,7 @@ if {$stub_size > 25000000} { set test "generate stub" set command "exec $binfile $stub_size >$genfile" 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} { @@ -109,14 +109,14 @@ file delete -- $genfile set phdr [read_phdr $binfile "readelf rebuilt with stub_size"] set dynamic_vaddr_prelinkno [lindex $phdr 0] -if ![prelink_yes $prelink_args] { +if {![prelink_yes $prelink_args]} { return -1 } set phdr [read_phdr $binfile "readelf with prelink -R"] set dynamic_vaddr_prelinkyes [lindex $phdr 0] -set first_offset [format 0x%x [expr $dynamic_vaddr_prelinkyes - $dynamic_vaddr_prelinkno]] +set first_offset [format 0x%x [expr {$dynamic_vaddr_prelinkyes - $dynamic_vaddr_prelinkno}]] verbose -log "first_offset is $first_offset" set test "first offset is non-zero" @@ -156,7 +156,7 @@ gdb_expect { foreach align_mult {1 2} { with_test_prefix "shift-by-$align_mult" { # FIXME: We believe there is enough room under FIRST_OFFSET. - set shifted_offset [format 0x%x [expr "$first_offset - $align_mult * $align_max"]] + set shifted_offset [format 0x%x [expr {$first_offset - $align_mult * $align_max}]] verbose -log "shifted_offset is $shifted_offset" # For normal prelink (prelink_yes call), we need to supply $prelink_args. @@ -165,7 +165,7 @@ foreach align_mult {1 2} { with_test_prefix "shift-by-$align_mult" { # as the libraries would also get relocated. set command "exec /usr/sbin/prelink -q -N --no-exec-shield -r $shifted_offset $binfile" 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" diff --git a/gdb/testsuite/gdb.base/attach-pie-noexec.exp b/gdb/testsuite/gdb.base/attach-pie-noexec.exp index 877cb4a..58f1890 100644 --- a/gdb/testsuite/gdb.base/attach-pie-noexec.exp +++ b/gdb/testsuite/gdb.base/attach-pie-noexec.exp @@ -30,7 +30,7 @@ gdb_test_multiple $test $test { pass $test } } -if ![runto_main] { +if {![runto_main]} { return 0 } set test "sanity check info shared" diff --git a/gdb/testsuite/gdb.base/attach.exp b/gdb/testsuite/gdb.base/attach.exp index d0a29f2..c4e27a1 100644 --- a/gdb/testsuite/gdb.base/attach.exp +++ b/gdb/testsuite/gdb.base/attach.exp @@ -84,7 +84,7 @@ proc_with_prefix do_attach_failure_tests {} { } -re "Attaching to.*, process .*couldn't open /proc file.*$gdb_prompt $" { # Response expected from /proc-based systems. - pass "$test" + pass "$test" } -re "Can't attach to process..*$gdb_prompt $" { # Response expected on Cygwin @@ -105,7 +105,7 @@ proc_with_prefix do_attach_failure_tests {} { } -re "Attaching to.*, process .*couldn't open /proc file.*$gdb_prompt $" { # Response expected from /proc-based systems. - pass "$test" + pass "$test" } -re "Can't attach to process..*$gdb_prompt $" { # Response expected on Cygwin @@ -157,7 +157,7 @@ proc_with_prefix do_attach_failure_tests {} { pass "$test" } } - + # Verify that we can't double attach to the process. set test "first attach" @@ -242,7 +242,7 @@ proc_with_prefix do_attach_tests {} { # (Actually, the test system appears to do this automatically for # us. So, we must also be prepared to be asked if we want to # discard an existing set of symbols.) - + set test "set file, before attach1" gdb_test_multiple "file $binfile" "$test" { -re "Load new symbol table from.*y or n. $" { @@ -267,25 +267,25 @@ proc_with_prefix do_attach_tests {} { # Verify that we can "see" the variable "should_exit" in the # program, and that it is zero. - + gdb_test "print should_exit" " = 0" "after attach1, print should_exit" # Detach the process. - + gdb_test "detach" \ "Detaching from program: .*$escapedbinfile, process $testpid\r\n\\\[Inferior $decimal \\(.*\\) detached\\\]" \ "attach1 detach" # Wait a bit for gdb to finish detaching - + exec sleep 5 # Purge the symbols from gdb's brain. (We want to be certain the # next attach, which won't be preceded by a "file" command, is # really getting the executable file without our help.) - + set old_timeout $timeout - set timeout 15 + set timeout 15 set test "attach1, purging symbols after detach" gdb_test_multiple "file" "$test" { -re "No executable file now.*Discard symbol table.*y or n. $" { @@ -296,7 +296,7 @@ proc_with_prefix do_attach_tests {} { # Verify that we can attach to the process just by giving the # process ID. - + set test "attach2, with no file" set found_exec_file 0 gdb_test_multiple "attach $testpid" "$test" { @@ -356,7 +356,7 @@ proc_with_prefix do_attach_tests {} { # Verify that we can attach to the process, and find its a.out # when we're cd'd to some directory that doesn't contain the # a.out. (We use the source path set by the "dir" command.) - + gdb_test "dir [standard_output_file {}]" "Source directories searched: .*" \ "set source path" @@ -389,7 +389,7 @@ proc_with_prefix do_attach_tests {} { "$test" \ "Kill the program being debugged.*y or n. $" \ "y" - + # Another "don't leave a process around" kill_wait_spawned_process $test_spawn_id } @@ -406,7 +406,7 @@ proc_with_prefix do_call_attach_tests {} { set testpid [spawn_id_get_pid $test_spawn_id] # Attach - + gdb_test "file $binfile2" ".*" "load file" set test "attach call" gdb_test_multiple "attach $testpid" "$test" { @@ -422,7 +422,7 @@ proc_with_prefix do_call_attach_tests {} { } # See if other registers are problems - + set test "info other register" gdb_test_multiple "i r r3" "$test" { -re "warning: reading register.*$gdb_prompt $" { @@ -434,12 +434,12 @@ proc_with_prefix do_call_attach_tests {} { } # Get rid of the process - + gdb_test "p should_exit = 1" gdb_continue_to_end - + # Be paranoid - + kill_wait_spawned_process $test_spawn_id } @@ -591,7 +591,7 @@ proc_with_prefix do_attach_exec_mismatch_handling_tests {} { gdb_test "y" "Reading symbols from .*attach.*" $gdb_test_name } } - + gdb_test "detach" "Detaching from program: .* detached\\\]" "$test detach attach initial exec-file" diff --git a/gdb/testsuite/gdb.base/auxv.exp b/gdb/testsuite/gdb.base/auxv.exp index 38efa45..0bb4c36 100644 --- a/gdb/testsuite/gdb.base/auxv.exp +++ b/gdb/testsuite/gdb.base/auxv.exp @@ -37,7 +37,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \ # Make it the working directory for the inferior. set coredir [standard_output_file coredir.[getpid]] file mkdir $coredir -set core_works [expr [isnative] && ! [is_remote target]] +set core_works [expr {[isnative] && ! [is_remote target]}] # Run GDB on the test program up to where it will dump core. diff --git a/gdb/testsuite/gdb.base/basic-edit-cmd.exp b/gdb/testsuite/gdb.base/basic-edit-cmd.exp index 7ad8ab9..ad5c9a5 100644 --- a/gdb/testsuite/gdb.base/basic-edit-cmd.exp +++ b/gdb/testsuite/gdb.base/basic-edit-cmd.exp @@ -42,7 +42,7 @@ if {![runto_main]} { # Are we using DWARF debug format? get_debug_format -set non_dwarf [expr ! [test_debug_format "DWARF \[0-9\]"]] +set non_dwarf [expr {! [test_debug_format "DWARF \[0-9\]"]}] # Find line numbers for use in tests. set line_0 [gdb_get_line_number "prologue location"] diff --git a/gdb/testsuite/gdb.base/batch-exit-status.exp b/gdb/testsuite/gdb.base/batch-exit-status.exp index a2c3dea..86e5fdd 100644 --- a/gdb/testsuite/gdb.base/batch-exit-status.exp +++ b/gdb/testsuite/gdb.base/batch-exit-status.exp @@ -29,7 +29,7 @@ proc _test_exit_status {expect_status cmdline_opts {re ""}} { return } - set has_re [expr ![string equal $re ""]] + set has_re [expr {![string equal $re ""]}] if { ! $has_re } { set re "\$FOOBAR^" } diff --git a/gdb/testsuite/gdb.base/batch-preserve-term-settings.exp b/gdb/testsuite/gdb.base/batch-preserve-term-settings.exp index 8995997..52b546c 100644 --- a/gdb/testsuite/gdb.base/batch-preserve-term-settings.exp +++ b/gdb/testsuite/gdb.base/batch-preserve-term-settings.exp @@ -23,7 +23,7 @@ if {[build_executable "failed to prepare" $testfile $srcfile debug] == -1} { } set file_arg $binfile -if [is_remote host] { +if {[is_remote host]} { set file_arg [remote_download host $file_arg] } @@ -46,11 +46,11 @@ proc spawn_shell {} { # Try to match: # PS1="gdb-subshell$ "^M - # $ gdb-subshell$ + # $ gdb-subshell$ # or: # PS1="gdb-subshell$ "^M # sh-4.4$ PS1="gdb-subshell$ "^M - # gdb-subshell$ + # gdb-subshell$ set gotit 0 set test "spawn shell" gdb_expect { @@ -88,7 +88,7 @@ proc exit_shell {} { pass "$test" } } - if ![is_remote host] { + if {![is_remote host]} { remote_close host } } @@ -131,7 +131,7 @@ proc test_terminal_settings_preserved {} { global gdb_prompt global shell_prompt_re - if ![spawn_shell] { + if {![spawn_shell]} { return } @@ -176,7 +176,7 @@ proc test_terminal_settings_preserved {} { } set test "terminal settings preserved" - if $stty_supported { + if {$stty_supported} { run_stty "stty after" stty_after gdb_assert [string equal $stty_before $stty_after] $test @@ -224,7 +224,7 @@ proc test_terminal_settings_preserved_after_cli_exit { cmds } { global gdb_prompt global shell_prompt_re - if ![spawn_shell] { + if {![spawn_shell]} { return } @@ -263,7 +263,7 @@ proc test_terminal_settings_preserved_after_cli_exit { cmds } { send_quit_command "quit gdb" set test "terminal settings preserved" - if $stty_supported { + if {$stty_supported} { run_stty "stty after" stty_after gdb_assert [string equal $stty_before $stty_after] $test @@ -286,11 +286,11 @@ proc test_terminal_settings_preserved_after_sigterm { } { # On Windows, GDB's "shell" command spawns cmd.exe, which does not # understand PPID. So we're out of luck even if the test harness # uses a remote_exec shell with a working "kill" command. - if [ishost *-*-mingw*] { + if {[ishost *-*-mingw*]} { return } - if ![spawn_shell] { + if {![spawn_shell]} { return } @@ -347,13 +347,13 @@ proc test_terminal_settings_preserved_after_sigterm { } { } } - if !$gdb_killed { + if {!$gdb_killed} { send_quit_command "quit gdb" } } set test "terminal settings preserved" - if $stty_supported { + if {$stty_supported} { run_stty "stty after" stty_after gdb_assert [string equal $stty_before $stty_after] $test diff --git a/gdb/testsuite/gdb.base/bfd-errors.exp b/gdb/testsuite/gdb.base/bfd-errors.exp index 8e51f09..f298247 100644 --- a/gdb/testsuite/gdb.base/bfd-errors.exp +++ b/gdb/testsuite/gdb.base/bfd-errors.exp @@ -39,7 +39,7 @@ # # This test then loads the shared library's symbol table (and other # debug info) using the 'add-symbol-file' command. While doing this, -# the test observes and records the BFD errors that were output. +# the test observes and records the BFD errors that were output. # Finally, data collected while adding the shared library symbols are # examined to make sure that identical messages were suppressed while # also making sure that at least two messages have been printed. @@ -87,10 +87,10 @@ close $solib_fp set objcopy_program [gdb_find_objcopy] # Extract the .dynsym and .dynstr section from the shared object. -if { [catch "exec $objcopy_program \ - --dump-section .dynsym=${binfile_lib}.dynsym \ - --dump-section .dynstr=${binfile_lib}.dynstr \ - ${binfile_lib}" output] } { +if { [catch {exec $objcopy_program \ + --dump-section .dynsym=${binfile_lib}.dynsym \ + --dump-section .dynstr=${binfile_lib}.dynstr \ + ${binfile_lib}} output] } { untested "failed objcopy dump-section" verbose -log "objcopy output: $output" return -1 @@ -119,29 +119,29 @@ if { $is_elf64 } { } else { set sz 16 } -set cnt [expr $dynsym_len / $sz] +set cnt [expr {$dynsym_len / $sz}] # Create 32-bit patterns (bad offsets) to write into the st_name area. if { $is_big_endian } { - set pat(0) [binary format I [expr $dynstr_len + 1000]] - set pat(1) [binary format I [expr $dynstr_len + 2000]] + set pat(0) [binary format I [expr {$dynstr_len + 1000}]] + set pat(1) [binary format I [expr {$dynstr_len + 2000}]] } else { - set pat(0) [binary format i [expr $dynstr_len + 1000]] - set pat(1) [binary format i [expr $dynstr_len + 2000]] + set pat(0) [binary format i [expr {$dynstr_len + 1000}]] + set pat(1) [binary format i [expr {$dynstr_len + 2000}]] } # Mangle st_name for the symbols following the first (STN_UNDEF) entry. while { [incr cnt -1] > 0 } { seek $dynsym_fp [incr off $sz] - puts $dynsym_fp $pat([expr $cnt % 2]) + puts $dynsym_fp $pat([expr {$cnt % 2}]) } close $dynsym_fp # Replace .dynsym section in shared object with the mangled version. -if { [catch "exec $objcopy_program \ - --update-section .dynsym=${binfile_lib}.dynsym \ - ${binfile_lib}" output] } { +if { [catch {exec $objcopy_program \ + --update-section .dynsym=${binfile_lib}.dynsym \ + ${binfile_lib}} output] } { untested "failed objcopy update-section" verbose -log "objcopy output: $output" return -1 diff --git a/gdb/testsuite/gdb.base/bfp-test.exp b/gdb/testsuite/gdb.base/bfp-test.exp index 53d274f..1251868 100644 --- a/gdb/testsuite/gdb.base/bfp-test.exp +++ b/gdb/testsuite/gdb.base/bfp-test.exp @@ -39,7 +39,7 @@ gdb_test "print b32" ".*1 = 1\.5.*" "the original value of b32 is 1.5" gdb_test "print b64" ".*2 = 2\.25.*" "the original value of b64 is 2.25" gdb_test "print b128" ".*3 = 3\.375.*" "the original value of b128 is 3.375" -# Test that gdb could correctly recognize float constant expression with a suffix. +# Test that gdb could correctly recognize float constant expression with a suffix. gdb_test "print b32=-1.5f" ".*4 = -1\.5.*" "try to change b32 to -1.5 with 'print b32=-1.5f'" gdb_test "print b64=-2.25f" ".*5 = -2\.25.*" "try to change b64 to -2.25 with 'print b64=-2.25f'" gdb_test "print b128=-3.375l" ".*6 = -3\.375.*" "try to change b128 to -3.375 with 'print b128=-3.375l'" diff --git a/gdb/testsuite/gdb.base/bg-execution-repeat.exp b/gdb/testsuite/gdb.base/bg-execution-repeat.exp index e7bdf49..923092b 100644 --- a/gdb/testsuite/gdb.base/bg-execution-repeat.exp +++ b/gdb/testsuite/gdb.base/bg-execution-repeat.exp @@ -36,7 +36,7 @@ proc test {continue_cmd} { clean_restart gdb_load $binfile - if ![runto_main] { + if {![runto_main]} { return } diff --git a/gdb/testsuite/gdb.base/bigcore.exp b/gdb/testsuite/gdb.base/bigcore.exp index f917eb8..7066a63 100644 --- a/gdb/testsuite/gdb.base/bigcore.exp +++ b/gdb/testsuite/gdb.base/bigcore.exp @@ -28,8 +28,8 @@ require isnative # I/O bandwidth. if { [istarget "*-*-*bsd*"] - || [istarget "*-*-solaris*"] - || [istarget "*-*-darwin*"] + || [istarget "*-*-solaris*"] + || [istarget "*-*-darwin*"] || [istarget "*-*-cygwin*"] } { untested "kernel lacks sparse corefile support (PR gdb/1551)" return diff --git a/gdb/testsuite/gdb.base/bitfields.exp b/gdb/testsuite/gdb.base/bitfields.exp index c463865..9a5eaff 100644 --- a/gdb/testsuite/gdb.base/bitfields.exp +++ b/gdb/testsuite/gdb.base/bitfields.exp @@ -165,7 +165,7 @@ proc bitfield_at_offset {} { global srcfile gdb_breakpoint break5 - if [gdb_test "cont" "Break.*break5 \\(\\) at .*$srcfile:$decimal.*" "continuing to break5"] { + if {[gdb_test "cont" "Break.*break5 \\(\\) at .*$srcfile:$decimal.*" "continuing to break5"]} { return } diff --git a/gdb/testsuite/gdb.base/bitfields2.exp b/gdb/testsuite/gdb.base/bitfields2.exp index 3e981dd..124f9c2 100644 --- a/gdb/testsuite/gdb.base/bitfields2.exp +++ b/gdb/testsuite/gdb.base/bitfields2.exp @@ -13,11 +13,11 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -# This file was adapted from bitfields.exp by Paul Hilfinger +# This file was adapted from bitfields.exp by Paul Hilfinger # (Hilfinger@gnat.com) # -# Tests for bit-fields that do not fit in type (unsigned) int, but do fit +# Tests for bit-fields that do not fit in type (unsigned) int, but do fit # in type (unsigned) long long. We perform essentially the same tests as # in bitfields.c, which considers only bit-fields that are <= 9 bits long. # @@ -33,7 +33,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb set has_signed_bitfields 1 # -# Continue to expected breakpoint at FUNCTION. Append TAG to make pass/fail +# Continue to expected breakpoint at FUNCTION. Append TAG to make pass/fail # messages (to make them unique). Suppress tests on failure. # proc continue_test { function tag } { @@ -54,7 +54,7 @@ proc start_test { function } { gdb_breakpoint $function continue_test $function "#0" } - + # # Test bitfield locating and uniqueness. diff --git a/gdb/testsuite/gdb.base/bitops.exp b/gdb/testsuite/gdb.base/bitops.exp index 6bd8675..0bf6b20 100644 --- a/gdb/testsuite/gdb.base/bitops.exp +++ b/gdb/testsuite/gdb.base/bitops.exp @@ -20,7 +20,7 @@ # tests expressions with bitwise operators, and some # logical operators # Does not use a target program -# +# # diff --git a/gdb/testsuite/gdb.base/bitshift.exp b/gdb/testsuite/gdb.base/bitshift.exp index 8cc2514..1e308f2 100644 --- a/gdb/testsuite/gdb.base/bitshift.exp +++ b/gdb/testsuite/gdb.base/bitshift.exp @@ -158,6 +158,7 @@ foreach signed {0 1} { set sign_prefix "u" } foreach bits {8 16 32 64} { + # tclint-disable-next-line command-args proc make_${sign_prefix}int${bits} {lang val} \ "make_val_cast \$lang $signed $bits \$val" } diff --git a/gdb/testsuite/gdb.base/bp-permanent.exp b/gdb/testsuite/gdb.base/bp-permanent.exp index 3ae5efe..df51126 100644 --- a/gdb/testsuite/gdb.base/bp-permanent.exp +++ b/gdb/testsuite/gdb.base/bp-permanent.exp @@ -103,7 +103,7 @@ proc test {always_inserted sw_watchpoint} { # We now have the breakpoint instruction stored in 'buffer'. Poke it # to memory manually. - set count [expr $address_after_bp - $address_bp] + set count [expr {$address_after_bp - $address_bp}] for {set i 0} {$i < $count} {incr i} { set test "p /x addr_bp\[$i\] = buffer\[$i\]" gdb_test_multiple $test $test { @@ -216,7 +216,7 @@ proc test {always_inserted sw_watchpoint} { gdb_test "next" "after next .*" } - if ![target_info exists gdb,nosignals] { + if {![target_info exists gdb,nosignals]} { with_test_prefix "continue trips on nested permanent bp" { delete_breakpoints @@ -242,7 +242,7 @@ proc test {always_inserted sw_watchpoint} { gdb_test "p counter" " = 2" } - if [can_single_step_to_signal_handler] { + if {[can_single_step_to_signal_handler]} { with_test_prefix "stepi signal with handler" { delete_breakpoints diff --git a/gdb/testsuite/gdb.base/branch-to-self.exp b/gdb/testsuite/gdb.base/branch-to-self.exp index 8f8e8ad..3f09786 100644 --- a/gdb/testsuite/gdb.base/branch-to-self.exp +++ b/gdb/testsuite/gdb.base/branch-to-self.exp @@ -27,7 +27,7 @@ with_test_prefix "single-step" { global testfile clean_restart ${testfile} - if ![runto_main] { + if {![runto_main]} { return -1 } set line_num [gdb_get_line_number "loop-line" ${testfile}.c] @@ -60,7 +60,7 @@ with_test_prefix "break-cond" { clean_restart ${testfile} - if ![runto_main] { + if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/break-caller-line.exp b/gdb/testsuite/gdb.base/break-caller-line.exp index bc3604e..9925a1d 100644 --- a/gdb/testsuite/gdb.base/break-caller-line.exp +++ b/gdb/testsuite/gdb.base/break-caller-line.exp @@ -19,7 +19,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile}] } { return -1 } -if ![runto callee] { +if {![runto callee]} { return 0 } diff --git a/gdb/testsuite/gdb.base/break-entry.exp b/gdb/testsuite/gdb.base/break-entry.exp index 4ea1158..584ddaf 100644 --- a/gdb/testsuite/gdb.base/break-entry.exp +++ b/gdb/testsuite/gdb.base/break-entry.exp @@ -56,7 +56,7 @@ if {[istarget powerpc64-*] && [is_lp64_target]} { } } -if ![runto "*$entry"] { +if {![runto "*$entry"]} { return } gdb_test {p/x $pc} " = $entry" diff --git a/gdb/testsuite/gdb.base/break-idempotent.exp b/gdb/testsuite/gdb.base/break-idempotent.exp index 3b32c89..842ce42 100644 --- a/gdb/testsuite/gdb.base/break-idempotent.exp +++ b/gdb/testsuite/gdb.base/break-idempotent.exp @@ -165,7 +165,7 @@ foreach_with_prefix pie { "nopie" "pie" } { continue } - if [is_remote host] { + if {[is_remote host]} { set arg [remote_download host $binfile] if { $arg == "" } { untested "download failed" diff --git a/gdb/testsuite/gdb.base/break-interp.exp b/gdb/testsuite/gdb.base/break-interp.exp index 038c3ea..f06c15f 100644 --- a/gdb/testsuite/gdb.base/break-interp.exp +++ b/gdb/testsuite/gdb.base/break-interp.exp @@ -49,19 +49,19 @@ proc system_debug_get {exec} { # isfile returns 1 even for symlinks to files. set retval $debug_root/$exec_build_id_debug - if [file isfile $retval] { + if {[file isfile $retval]} { return $retval } set retval $exec_dir/$debug_base - if [file isfile $retval] { + if {[file isfile $retval]} { return $retval } set retval $exec_dir/.debug/$debug_base - if [file isfile $retval] { + if {[file isfile $retval]} { return $retval } set retval $debug_root/$exec_dir/$debug_base - if [file isfile $retval] { + if {[file isfile $retval]} { return $retval } return "" @@ -108,7 +108,7 @@ proc strip_debug {dest} { set strip_program [transform strip] set command "exec $strip_program --strip-debug $dest" verbose -log "command is $command" - if [catch $command] { + if {[catch {{*}$command}]} { fail $test return 0 } else { @@ -186,7 +186,7 @@ proc reach_1 {func command displacement} { } } } - if ![regexp {^(NONE|FOUND-.*)$} $displacement] { + if {![regexp {^(NONE|FOUND-.*)$} $displacement]} { fail $test_displacement } @@ -257,7 +257,7 @@ proc test_core {file displacement} { pass $test } } - if ![regexp {^(NONE|FOUND-.*)$} $displacement] { + if {![regexp {^(NONE|FOUND-.*)$} $displacement]} { fail $test_displacement } gdb_test_no_output "set verbose off" @@ -308,7 +308,7 @@ proc test_attach_gdb {file pid displacement prefix} { pass $test } } - if ![regexp {^(NONE|FOUND-.*)$} $displacement] { + if {![regexp {^(NONE|FOUND-.*)$} $displacement]} { fail $test_displacement } gdb_test_no_output "set verbose off" @@ -381,7 +381,7 @@ proc test_attach {file displacement {relink_args ""}} { # `libfunc' is present in the backtrace and therefore the # displacement has been guessed right. - if [prelink$relink $relink_args [file tail $exec]] { + if {[prelink$relink $relink_args [file tail $exec]]} { # /proc/PID/exe cannot be loaded as it is "EXECNAME (deleted)". test_attach_gdb $exec $pid $displacement "attach-relink$relink" } @@ -411,7 +411,7 @@ proc test_ld {file ifmain trynosym displacement} { # prevents that from happening. So turn it off. gdb_test "set disable-randomization off" - if $ifmain { + if {$ifmain} { gdb_test_no_output "set args segv" } else { global binfile_test @@ -450,7 +450,7 @@ proc test_ld {file ifmain trynosym displacement} { gdb_test_no_output "set verbose on" } - if $ifmain { + if {$ifmain} { reach "main" continue "NONE" reach "libfunc" continue "NONE" @@ -467,13 +467,13 @@ proc test_ld {file ifmain trynosym displacement} { reach $solib_bp "run" $displacement 2 gdb_test_no_output "set verbose off" - if $ifmain { + if {$ifmain} { test_core $file $displacement test_attach $file $displacement } - if !$trynosym { + if {!$trynosym} { return } @@ -494,7 +494,7 @@ proc test_ld {file ifmain trynosym displacement} { set escapedfile [string_to_regexp $file] gdb_test "exec-file $file" "exec-file $escapedfile" "load" - if $ifmain { + if {$ifmain} { reach $solib_bp run $displacement 3 set entrynohex "" @@ -550,7 +550,7 @@ proc test_ld {file ifmain trynosym displacement} { pass $test } } - if ![regexp {^(NONE|FOUND-.*)$} $displacement] { + if {![regexp {^(NONE|FOUND-.*)$} $displacement]} { fail $test_displacement } } @@ -589,7 +589,7 @@ foreach_with_prefix ldprelink {NO YES} { file_copy $interp_system $interp # Never call strip-debug before unprelink: # prelink: ...: Section .note.gnu.build-id created after prelinking - if ![prelinkNO $interp] { + if {![prelinkNO $interp]} { continue } strip_debug $interp @@ -605,7 +605,7 @@ foreach_with_prefix ldprelink {NO YES} { set test "eu-unstrip unprelinked:[file tail $interp_system] + [file tail $interp_system_debug] to [file tail $interp]" set command "exec eu-unstrip -o $interp $interp ${interp}.debug" verbose -log "command is $command" - if [catch $command] { + if {[catch {{*}$command}]} { setup_xfail *-*-* fail $test continue @@ -615,7 +615,7 @@ foreach_with_prefix ldprelink {NO YES} { } elseif {$ldsepdebug == "SEP" && $interp_system_debug == ""} { file_copy $interp_system $interp # eu-unstrip: DWARF data in '...' not adjusted for prelinking bias; consider prelink -u - if ![prelinkNO $interp] { + if {![prelinkNO $interp]} { continue } gdb_gnu_strip_debug $interp @@ -625,14 +625,14 @@ foreach_with_prefix ldprelink {NO YES} { } if {$ldsepdebug == "SEP"} { - if ![prelinkNO "${interp}.debug"] { + if {![prelinkNO "${interp}.debug"]} { continue } } else { file delete "${interp}.debug" } - if ![prelink$ldprelink $interp "[file tail $interp], second time"] { + if {![prelink$ldprelink $interp "[file tail $interp], second time"]} { continue } @@ -647,7 +647,7 @@ foreach_with_prefix ldprelink {NO YES} { } test_ld $interp 0 [expr {$ldsepdebug == "NO"}] $displacement - if ![file_copy $interp $interp_saved] { + if {![file_copy $interp $interp_saved]} { continue } diff --git a/gdb/testsuite/gdb.base/break-main-file-remove-fail.exp b/gdb/testsuite/gdb.base/break-main-file-remove-fail.exp index 19b2446..4dd88cd 100644 --- a/gdb/testsuite/gdb.base/break-main-file-remove-fail.exp +++ b/gdb/testsuite/gdb.base/break-main-file-remove-fail.exp @@ -55,7 +55,7 @@ proc test_remove_bp { initial_load } { gdb_reload } - if ![runto start] { + if {![runto start]} { return } @@ -86,7 +86,7 @@ proc test_remove_bp { initial_load } { # remove the memory breakpoint afterwards should fail, and GDB # should warn the user about it. set pagesize [get_integer_valueof "pg_size" 0] - set align_addr [expr $bp_addr - $bp_addr % $pagesize] + set align_addr [expr {$bp_addr - $bp_addr % $pagesize}] set munmap_prototype "int (*) (void *, size_t)" set munmap_expr "(($munmap_prototype) munmap) ($align_addr, $pagesize)" diff --git a/gdb/testsuite/gdb.base/break.exp b/gdb/testsuite/gdb.base/break.exp index 1eec984..e1f4860 100644 --- a/gdb/testsuite/gdb.base/break.exp +++ b/gdb/testsuite/gdb.base/break.exp @@ -765,7 +765,7 @@ proc_with_prefix test_next_with_recursion {} { delete_breakpoints - if [istarget "mips*tx39-*"] { + if {[istarget "mips*tx39-*"]} { set timeout 60 } # We used to set timeout here for all other targets as well. This diff --git a/gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp b/gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp index 4b060b8..7c6b1cb 100644 --- a/gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp +++ b/gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp @@ -25,7 +25,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } @@ -139,7 +139,7 @@ proc get_next_insn {} { set hw_step [probe_target_hardware_step] -if ![get_function_bounds "main" main_lo main_hi] { +if {![get_function_bounds "main" main_lo main_hi]} { # Can't do the following tests if main's bounds are unknown. return -1 } diff --git a/gdb/testsuite/gdb.base/breakpoint-shadow.exp b/gdb/testsuite/gdb.base/breakpoint-shadow.exp index a662016..8e74ec2 100644 --- a/gdb/testsuite/gdb.base/breakpoint-shadow.exp +++ b/gdb/testsuite/gdb.base/breakpoint-shadow.exp @@ -20,7 +20,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} { } # We need to start the inferior to place the breakpoints in the memory at all. -if ![runto_main] { +if {![runto_main]} { return -1 } @@ -51,7 +51,7 @@ proc test_disassembly {test} { gdb_test_multiple "disass main" $test { -re $match { set got $expect_out(1,string) - if [string equal -nocase $orig $got] { + if {[string equal -nocase $orig $got]} { pass $test } else { fail $test diff --git a/gdb/testsuite/gdb.base/bt-on-fatal-signal.exp b/gdb/testsuite/gdb.base/bt-on-fatal-signal.exp index 63428a1..1ef9774 100644 --- a/gdb/testsuite/gdb.base/bt-on-fatal-signal.exp +++ b/gdb/testsuite/gdb.base/bt-on-fatal-signal.exp @@ -126,7 +126,7 @@ foreach test_data {{SEGV "Segmentation fault"} \ gdb_assert { $saw_fatal_msg } gdb_assert { $saw_bt_start } gdb_assert { $saw_bt_end } - gdb_assert { [expr $internal_error_msg_count == 2] } + gdb_assert { [expr {$internal_error_msg_count == 2}] } } -re "$gdb_prompt $" { # GDB should terminate, we should never get back to diff --git a/gdb/testsuite/gdb.base/call-ar-st.exp b/gdb/testsuite/gdb.base/call-ar-st.exp index 8b27d8d..fd1f1a0 100644 --- a/gdb/testsuite/gdb.base/call-ar-st.exp +++ b/gdb/testsuite/gdb.base/call-ar-st.exp @@ -38,7 +38,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} { set oldtimeout $timeout -set timeout [expr "$timeout + 60"] +set timeout [expr {$timeout + 60}] gdb_test_no_output "set print sevenbit-strings" gdb_test_no_output "set print address off" @@ -86,7 +86,7 @@ set array_c_re \ "aZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ" \ "aZaZaZaZaZaZaZaZaZa"] -if ![gdb_skip_stdio_test "print_char_array(char_array)"] { +if {![gdb_skip_stdio_test "print_char_array(char_array)"]} { gdb_test_stdio "print print_char_array(char_array)" $array_c_re } @@ -95,7 +95,7 @@ gdb_test "tbreak $stop_line" \ "Temporary breakpoint.*file.*$srcfile, line $stop_line.*" \ "tbreakpoint at tbreak2" -if ![gdb_skip_stdio_test "continue to tbreak2"] { +if {![gdb_skip_stdio_test "continue to tbreak2"]} { set gdb_re \ [multi_line \ "main.*at.*:\[0-9\]+" \ @@ -106,7 +106,7 @@ if ![gdb_skip_stdio_test "continue to tbreak2"] { } # I am disabling this test, because it takes too long. I verified by -# hand that it works, feel free to check for yourself. +# hand that it works, feel free to check for yourself. #call print_all_arrays(integer_array, char_array, float_array, double_array) #send_gdb "print print_all_arrays(integer_array, char_array, float_array, double_array)\n" #gdb_expect { @@ -165,7 +165,7 @@ gdb_test "step" \ "step inside print_all_arrays" #step -over -if ![gdb_skip_stdio_test "next over print_int_array in print_all_arrays"] { +if {![gdb_skip_stdio_test "next over print_int_array in print_all_arrays"]} { set stop_line [gdb_get_line_number "-next1-"] gdb_test_stdio "next" \ "array_i :" \ @@ -214,7 +214,7 @@ if {$allow_float_test && \ #call sum_array_print(10, *list1, *list2, *list3, *list4) -if ![gdb_skip_stdio_test "print sum_array_print(...)"] { +if {![gdb_skip_stdio_test "print sum_array_print(...)"]} { gdb_test_stdio "print sum_array_print(10, *list1, *list2, *list3, *list4)" \ [multi_line \ @@ -239,7 +239,7 @@ if ![gdb_skip_stdio_test "print sum_array_print(...)"] { #step over set stop_line [gdb_get_line_number "-next2-"] -if ![gdb_skip_stdio_test "next to next2"] { +if {![gdb_skip_stdio_test "next to next2"]} { gdb_test_stdio "next" \ "BYE BYE FOR NOW" \ "$stop_line.*printf\\(.VERY GREEN GRASS.n.\\);.*" \ @@ -250,7 +250,7 @@ if ![gdb_skip_stdio_test "next to next2"] { #call print_array_rep(\*list1, \*list2, \*list3) -if ![gdb_skip_stdio_test "print print_array_rep(...)"] { +if {![gdb_skip_stdio_test "print print_array_rep(...)"]} { gdb_test_stdio "print print_array_rep(\*list1, \*list2, \*list3)" \ "Contents of linked list3:" } @@ -300,7 +300,7 @@ gdb_test "tbreak $stop_line" \ "Temporary breakpoint.* file .*$srcfile, line $stop_line.*" \ "tbreakpoint at tbreak6" -if ![gdb_skip_stdio_test "continuing to tbreak6"] { +if {![gdb_skip_stdio_test "continuing to tbreak6"]} { gdb_test_stdio "continue" \ "Sum of 4 arrays.*Contents of linked list1.*Contents of two_floats_t" \ "main \\(\\) at .*$srcfile:$stop_line.*c = 0.*" \ @@ -309,8 +309,8 @@ if ![gdb_skip_stdio_test "continuing to tbreak6"] { gdb_test "continue" ".*" "" } -#call print_small_structs(*struct1, *struct2, *struct3, *struct4, -# *flags, *flags_combo, *three_char, *five_char, +#call print_small_structs(*struct1, *struct2, *struct3, *struct4, +# *flags, *flags_combo, *three_char, *five_char, # *int_char_combo, *d1, *d2, *d3, *f1, *f2, *f3) if {$allow_float_test && \ @@ -373,7 +373,7 @@ gdb_test "print compute_with_small_structs(20)" \ "\[0-9\]+ = void" -#call print_ten_doubles(123.456, 123.456, -0.12, -1.23, 343434.8, 89.098, +#call print_ten_doubles(123.456, 123.456, -0.12, -1.23, 343434.8, 89.098, # 3.14, -5678.12345, -0.11111111, 216.97065) if {$allow_float_test && \ @@ -422,8 +422,8 @@ if {$allow_float_test} { set ws "\[\n\r\t \]+" -#call print_small_structs(struct1, struct2, struct3, struct4, flags, -# flags_combo, three_char, five_char, int_char_combo, +#call print_small_structs(struct1, struct2, struct3, struct4, flags, +# flags_combo, three_char, five_char, int_char_combo, # d1, d2, d3, f1, f2, f3) if {$allow_float_test && \ @@ -495,7 +495,7 @@ gdb_test "tbreak $stop_line" \ "Temporary breakpoint.* file .*$srcfile, line $stop_line.*" \ "tbreakpoint at tbreak8" -if ![gdb_skip_stdio_test "continuing to tbreak8"] { +if {![gdb_skip_stdio_test "continuing to tbreak8"]} { gdb_test_stdio "continue" \ "Contents of two_floats_t:" \ ".*main \\(\\) at.*$srcfile:$stop_line.*$stop_line.*init_bit_flags_combo\\(flags_combo, \\(unsigned\\)1, \\(unsigned\\)0, .y.,.*" \ @@ -511,7 +511,7 @@ gdb_test "step" \ "step into init_bit_flags_combo" #call print_bit_flags_combo(*bit_flags_combo) -if ![gdb_skip_stdio_test "continuing at step3"] { +if {![gdb_skip_stdio_test "continuing at step3"]} { gdb_test_stdio "print print_bit_flags_combo(*bit_flags_combo)" \ "alpha.*gamma.*epsilon.*ch1: y.*ch2: n" } @@ -600,14 +600,14 @@ gdb_test continue "Continuing\\..*main \\(\\) at .*$srcfile:$stop_line\[ \t\n\r\ #call sum_struct_print(10, *struct1, *struct2, *struct3, *struct4) -if ![gdb_skip_stdio_test "print sum_struct_print(...)"] { +if {![gdb_skip_stdio_test "print sum_struct_print(...)"]} { gdb_test_stdio "print sum_struct_print(10,*struct1,*struct2,*struct3,*struct4)" \ "Sum of the 4 struct values and seed :\[ \t\n\r\]+218" } #call print_struct_rep(*struct1, *struct2, *struct3) -if ![gdb_skip_stdio_test "print print_struct_rep(...)"] { +if {![gdb_skip_stdio_test "print print_struct_rep(...)"]} { gdb_test_stdio "print print_struct_rep(*struct1, *struct2, *struct3)" \ [multi_line \ "Contents of struct1: " \ @@ -622,7 +622,7 @@ if ![gdb_skip_stdio_test "print print_struct_rep(...)"] { ] } -if ![gdb_skip_stdio_test "print print_one_large_struct(...)"] { +if {![gdb_skip_stdio_test "print print_one_large_struct(...)"]} { gdb_test_stdio "print print_one_large_struct(*list1)" \ " 4 1" } diff --git a/gdb/testsuite/gdb.base/call-rt-st.exp b/gdb/testsuite/gdb.base/call-rt-st.exp index 511e209..4ce686b 100644 --- a/gdb/testsuite/gdb.base/call-rt-st.exp +++ b/gdb/testsuite/gdb.base/call-rt-st.exp @@ -109,13 +109,13 @@ proc print_struct_call { expr inf_result gdb_result } { } -if ![gdb_skip_stdio_test "print print_struct_rep(*struct1)"] { +if {![gdb_skip_stdio_test "print print_struct_rep(*struct1)"]} { print_struct_call "print_struct_rep(*struct1)" \ ".*Contents of struct1:\[ \t\n\r\]+22\[ \t\]+0\[ \t\n\r\]+" \ ".\[0-9\]+ = \\{value = 5, head = 0\\}" } -if ![gdb_skip_stdio_test "print print_one_large_struct(...)"] { +if {![gdb_skip_stdio_test "print print_one_large_struct(...)"]} { print_struct_call "print_one_large_struct(*list1)" \ ".*\[ \t\]+4\[ \t\]+1\[ \r\n\]+" \ ".\[0-9\]+ = \\{next_index = \\{1, 2, 3, 4, 5, 6, 7, 8, 9, 10\\}, values = \\{4, 6, 8, 10, 12, 14, 16, 18, 20, 22\\}, head = 0\\}" @@ -135,43 +135,43 @@ if {$allow_float_test && \ ".\[0-9\]+ = \\{float1 = -2\\.34500003, float2 = 1\\}" } -if ![gdb_skip_stdio_test "print print_bit_flags_char(*cflags)"] { +if {![gdb_skip_stdio_test "print print_bit_flags_char(*cflags)"]} { print_struct_call "print_bit_flags_char(*cflags)" \ ".*alpha\[ \r\n\]+gamma\[ \r\n\]+epsilon\[ \r\n\]+" \ ".\[0-9\]+ = \\{alpha = 1 '\\\\001', beta = 0 '\\\\000', gamma = 1 '\\\\001', delta = 0 '\\\\000', epsilon = 1 '\\\\001', omega = 0 '\\\\000'\\}" } -if ![gdb_skip_stdio_test "print print_bit_flags_short(*sflags)"] { +if {![gdb_skip_stdio_test "print print_bit_flags_short(*sflags)"]} { print_struct_call "print_bit_flags_short(*sflags)" \ ".*alpha\[ \r\n\]+gamma\[ \r\n\]+epsilon\[ \r\n\]+" \ ".\[0-9\]+ = \\{alpha = 1, beta = 0, gamma = 1, delta = 0, epsilon = 1, omega = 0\\}" } -if ![gdb_skip_stdio_test "print print_bit_flags(*flags)"] { +if {![gdb_skip_stdio_test "print print_bit_flags(*flags)"]} { print_struct_call "print_bit_flags(*flags)" \ ".*alpha\[ \r\n\]+gamma\[ \r\n\]+epsilon\[ \r\n\]+" \ ".\[0-9\]+ = \\{alpha = 1, beta = 0, gamma = 1, delta = 0, epsilon = 1, omega = 0\\}" } -if ![gdb_skip_stdio_test "print print_bit_flags_combo(*flags_combo)"] { +if {![gdb_skip_stdio_test "print print_bit_flags_combo(*flags_combo)"]} { print_struct_call "print_bit_flags_combo(*flags_combo)" \ ".*alpha\[ \r\n\]+gamma\[ \r\n\]+epsilon\[ \r\n\]+ch1: y\[ \t\]+ch2: n\[ \r\n\]+" \ ".\[0-9\]+ = \\{alpha = 1, beta = 0, ch1 = 121 'y', gamma = 1, delta = 0, ch2 = 110 'n', epsilon = 1, omega = 0\\}" } -if ![gdb_skip_stdio_test "print print_three_chars(*three_chars)"] { +if {![gdb_skip_stdio_test "print print_three_chars(*three_chars)"]} { print_struct_call "print_three_chars(*three_char)" \ ".*Contents of three_char_t:\[ \r\n\]+x\[ \t\]+y\[ \t\]+z\[ \r\n\]+" \ ".\[0-9\]+ = \\{ch1 = 120 'x', ch2 = 121 'y', ch3 = 122 'z'\\}" } -if ![gdb_skip_stdio_test "print print_five_chars(*five_chars)"] { +if {![gdb_skip_stdio_test "print print_five_chars(*five_chars)"]} { print_struct_call "print_five_chars(*five_char)" \ ".*Contents of five_char_t:\[ \r\n\]+h\[ \t\]+e\[ \t\]+l\[ \t\]+l\[ \t\]+o\[ \r\n\]+" \ ".\[0-9\]+ = \\{ch1 = 104 'h', ch2 = 101 'e', ch3 = 108 'l', ch4 = 108 'l', ch5 = 111 'o'\\}" } -if ![gdb_skip_stdio_test "print print_int_char_combo(*int_char_combo)"] { +if {![gdb_skip_stdio_test "print print_int_char_combo(*int_char_combo)"]} { print_struct_call "print_int_char_combo(*int_char_combo)" \ ".*Contents of int_char_combo_t:\[ \r\n\]+13\[ \t\]+!\[ \r\n\]+" \ ".\[0-9\]+ = \\{int1 = 13, ch1 = 33 '!'\\}" diff --git a/gdb/testsuite/gdb.base/call-sc.exp b/gdb/testsuite/gdb.base/call-sc.exp index f67670d..ff4e7ac 100644 --- a/gdb/testsuite/gdb.base/call-sc.exp +++ b/gdb/testsuite/gdb.base/call-sc.exp @@ -107,7 +107,7 @@ proc test_scalar_calls { } { # Check that GDB can always extract a scalar-return value from an # inferior function call. Since GDB always knows the location of # an inferior function call's return value these should never fail - + # Implemented by calling the parameterless function "fun" and then # examining the return value printed by GDB. @@ -250,7 +250,7 @@ proc test_scalar_returns { } { set test "value foo returned; ${tests}" gdb_test_multiple "p/c L" "${test}" { -re " = 49 '1'.*${gdb_prompt} $" { - if $return_value_unknown { + if {$return_value_unknown} { # This contradicts the above claim that GDB didn't # know the location of the return-value. fail "${test}" @@ -259,7 +259,7 @@ proc test_scalar_returns { } { } } -re " = 90 .*${gdb_prompt} $" { - if $return_value_unknown { + if {$return_value_unknown} { # The struct return case. Since any modification # would be by reference, and that can't happen, the # value should be unmodified and hence Z is expected. @@ -272,7 +272,7 @@ proc test_scalar_returns { } { } } -re " = 57 .*${gdb_prompt} $" { - if $return_value_unknown { + if {$return_value_unknown} { # The struct return case. # The return value is stored on the stack, and since GDB # didn't override it, it still has value that was stored @@ -285,7 +285,7 @@ proc test_scalar_returns { } { } } -re ".*${gdb_prompt} $" { - if $return_value_unimplemented { + if {$return_value_unimplemented} { # What a surprise. The architecture hasn't implemented # return_value, and hence has to fail. kfail "$test" gdb/1444 @@ -293,8 +293,8 @@ proc test_scalar_returns { } { fail "$test" } } - } - + } + # Check that a "finish" works. # This is almost but not quite the same as "call struct funcs". @@ -334,7 +334,7 @@ proc test_scalar_returns { } { set test "value foo finished; ${tests}" gdb_test_multiple "p/c" "${test}" { -re " = 49 '1'\[\r\n\]+${gdb_prompt} $" { - if $finish_value_unknown { + if {$finish_value_unknown} { # This contradicts the above claim that GDB didn't # know the location of the return-value. fail "${test}" @@ -344,7 +344,7 @@ proc test_scalar_returns { } { } -re " = 90 'Z'\[\r\n\]+${gdb_prompt} $" { # The value didn't get found. This is "expected". - if $finish_value_unknown { + if {$finish_value_unknown} { pass "${test}" } else { # This contradicts the above claim that GDB did diff --git a/gdb/testsuite/gdb.base/call-strs.exp b/gdb/testsuite/gdb.base/call-strs.exp index 43e4712..02eecb6 100644 --- a/gdb/testsuite/gdb.base/call-strs.exp +++ b/gdb/testsuite/gdb.base/call-strs.exp @@ -67,70 +67,70 @@ gdb_test "print s" \ " = \"test string\".*" #print str_func1(s) -if ![gdb_skip_stdio_test "print str_func1(s)"] { +if {![gdb_skip_stdio_test "print str_func1(s)"]} { gdb_test_stdio "print str_func1(s)" \ "first string arg is: test string" \ "\"test string\".*" } #print str_func1("test string") -if ![gdb_skip_stdio_test "print str_func1(teststring)"] { +if {![gdb_skip_stdio_test "print str_func1(teststring)"]} { gdb_test_stdio "print str_func1(\"test string\")" \ "first string arg is: test string" \ "\"test string\".*" } #call str_func1(s) -if ![gdb_skip_stdio_test "call str_func1(s)"] { +if {![gdb_skip_stdio_test "call str_func1(s)"]} { gdb_test_stdio "call str_func1(s)" \ "first string arg is: test string" \ "\"test string\".*" } #call str_func1("test string") -if ![gdb_skip_stdio_test "call str_func1 (...)"] { +if {![gdb_skip_stdio_test "call str_func1 (...)"]} { gdb_test_stdio "call str_func1(\"test string\")" \ "first string arg is: test string" \ "\"test string\".*" } #print str_func1(buf) -if ![gdb_skip_stdio_test "print str_func1(buf)"] { +if {![gdb_skip_stdio_test "print str_func1(buf)"]} { gdb_test_stdio "print str_func1(buf)" \ "first string arg is: test string" \ "\"test string\".*" } #call str_func1(buf) -if ![gdb_skip_stdio_test "call str_func1(buf)"] { +if {![gdb_skip_stdio_test "call str_func1(buf)"]} { gdb_test_stdio "call str_func1(buf)" \ "first string arg is: test string" \ "\"test string\".*" } #print str_func("a","b","c","d","e","f","g") -if ![gdb_skip_stdio_test "print str_func(a,b,c,d,e,f,g)"] { +if {![gdb_skip_stdio_test "print str_func(a,b,c,d,e,f,g)"]} { gdb_test_stdio "print str_func(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\")" \ "first string arg is: a\[ \t\r\n\]+second string arg is: b\[ \t\r\n\]+third string arg is: c\[ \t\r\n\]+fourth string arg is: d\[ \t\r\n\]+fifth string arg is: e\[ \t\r\n\]+sixth string arg is: f\[ \t\r\n\]+seventh string arg is: g\[ \t\r\n\]+" \ "= \"abcdefg\".*" } #call str_func("a","b","c","d","e","f","g") -if ![gdb_skip_stdio_test "call str_func(a,b,c,d,e,f,g)"] { +if {![gdb_skip_stdio_test "call str_func(a,b,c,d,e,f,g)"]} { gdb_test_stdio "call str_func(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\")" \ "first string arg is: a\[ \t\r\n\]+second string arg is: b\[ \t\r\n\]+third string arg is: c\[ \t\r\n\]+fourth string arg is: d\[ \t\r\n\]+fifth string arg is: e\[ \t\r\n\]+sixth string arg is: f\[ \t\r\n\]+seventh string arg is: g\[ \t\r\n\]+" \ "= \"abcdefg\".*" } #print str_func(s,s,s,s,s,s,s) -if ![gdb_skip_stdio_test "print str_func(s,s,s,s,s,s,s,s)"] { +if {![gdb_skip_stdio_test "print str_func(s,s,s,s,s,s,s,s)"]} { gdb_test_stdio "print str_func(s,s,s,s,s,s,s)" \ "first string arg is: test string\[ \t\r\n\]+second string arg is: test string\[ \t\r\n\]+third string arg is: test string\[ \t\r\n\]+fourth string arg is: test string\[ \t\r\n\]+fifth string arg is: test string\[ \t\r\n\]+sixth string arg is: test string\[ \t\r\n\]+seventh string arg is: test string\[ \t\r\n\]+" \ "\"test stringtest stringtest stringtest stringtest stringtest stringtest string\".*" } #call str_func(s,s,s,s,s,s,s) -if ![gdb_skip_stdio_test "call str_func(s,s,s,s,s,s,s,s)"] { +if {![gdb_skip_stdio_test "call str_func(s,s,s,s,s,s,s,s)"]} { gdb_test_stdio "call str_func(s,s,s,s,s,s,s)" \ "first string arg is: test string\[ \t\r\n\]+second string arg is: test string\[ \t\r\n\]+third string arg is: test string\[ \t\r\n\]+fourth string arg is: test string\[ \t\r\n\]+fifth string arg is: test string\[ \t\r\n\]+sixth string arg is: test string\[ \t\r\n\]+seventh string arg is: test string\[ \t\r\n\]+" \ "\"test stringtest stringtest stringtest stringtest stringtest stringtest string\".*" diff --git a/gdb/testsuite/gdb.base/callfuncs.exp b/gdb/testsuite/gdb.base/callfuncs.exp index 0e1997a..59306d4 100644 --- a/gdb/testsuite/gdb.base/callfuncs.exp +++ b/gdb/testsuite/gdb.base/callfuncs.exp @@ -21,7 +21,7 @@ standard_testfile # We still want to test non-prototype functions for now, which is why # we disable compilers warning about them. set compile_flags {debug additional_flags=-Wno-deprecated-non-prototype} -if [support_complex_tests] { +if {[support_complex_tests]} { lappend compile_flags "additional_flags=-DTEST_COMPLEX" } @@ -132,7 +132,7 @@ proc do_function_calls {prototypes} { gdb_test "p t_int_double(99, 99.0)" " = 1" } - if [support_complex_tests] { + if {[support_complex_tests]} { gdb_test "p t_float_complex_values(fc1, fc2)" " = 1" gdb_test "p t_float_complex_values(fc3, fc4)" " = 0" @@ -221,7 +221,7 @@ proc do_function_calls {prototypes} { "call inferior func with struct - returns double" } - if [support_complex_tests] { + if {[support_complex_tests]} { gdb_test "p t_structs_fc(struct_val1)" ".*= 3 \\+ 3i" \ "call inferior func with struct - returns float _Complex" @@ -257,7 +257,7 @@ proc fetch_all_registers {test} { exp_continue } -re "^bspstore\[ \t\]+\[^\r\n\]+\r\n" { - if [istarget "ia64-*-*"] { + if {[istarget "ia64-*-*"]} { # Filter out bspstore which is specially tied to bsp, # giving spurious differences. } else { @@ -266,7 +266,7 @@ proc fetch_all_registers {test} { exp_continue } -re "^pstate\[ \t\]+\[^\r\n\]+\r\n" { - if [istarget "sparc64-*-linux-gnu"] { + if {[istarget "sparc64-*-linux-gnu"]} { # Filter out the pstate register, since in sparc64 # targets the Linux kernel disables pstate.PEF when # returning from traps, giving spurious differences. @@ -276,7 +276,7 @@ proc fetch_all_registers {test} { exp_continue } -re "^last_break\[ \t\]+\[^\r\n\]+\r\n" { - if [istarget "s390*-*-*"] { + if {[istarget "s390*-*-*"]} { # Filter out last_break which is read-only, # giving spurious differences. } else { @@ -285,7 +285,7 @@ proc fetch_all_registers {test} { exp_continue } -re "^\(?:cycle\|instret\)\[ \t\]+\[^\r\n\]+\r\n" { - if [istarget "riscv*-*-*"] { + if {[istarget "riscv*-*-*"]} { # Filter out the cycle counter and instructions # retired counter CSRs which are read-only, giving # spurious differences. @@ -386,9 +386,9 @@ proc perform_all_tests {prototypes} { "The program being debugged stopped while.*" \ "stop at breakpoint in call dummy function" gdb_test "continue" "Continuing.*" "continue from call dummy breakpoint" - if ![gdb_test "bt 2" \ - "#0 main.*" \ - "bt after continuing from call dummy breakpoint"] then { + if {![gdb_test "bt 2" \ + "#0 main.*" \ + "bt after continuing from call dummy breakpoint"]} then { set new_reg_content [fetch_all_registers \ "register contents after stop in call dummy"] if {$old_reg_content == $new_reg_content} { @@ -412,9 +412,9 @@ proc perform_all_tests {prototypes} { gdb_test "finish" \ "Value returned is .* = 9" \ "finish from call dummy breakpoint returns correct value" - if ![gdb_test "bt 2" \ - "#0 main.*" \ - "bt after finishing from call dummy breakpoint"] then { + if {![gdb_test "bt 2" \ + "#0 main.*" \ + "bt after finishing from call dummy breakpoint"]} then { set new_reg_content [fetch_all_registers \ "register contents after finish in call dummy"] if {$old_reg_content == $new_reg_content} { @@ -435,11 +435,11 @@ proc perform_all_tests {prototypes} { # with a value, make sure we are back at main with the same register contents. gdb_test "print add(4,5)" "The program being debugged stopped while.*" \ "call function causing a breakpoint and then do a return" - if ![gdb_test "return 7" \ - "#0 main.*" \ - "back at main after return from call dummy breakpoint" \ - "Make add return now. .y or n.*" \ - "y"] then { + if {![gdb_test "return 7" \ + "#0 main.*" \ + "back at main after return from call dummy breakpoint" \ + "Make add return now. .y or n.*" \ + "y"]} then { set new_reg_content [fetch_all_registers \ "register contents after return in call dummy"] if {$old_reg_content == $new_reg_content} { diff --git a/gdb/testsuite/gdb.base/cast-indirection.exp b/gdb/testsuite/gdb.base/cast-indirection.exp index ce828db..198b0aa 100644 --- a/gdb/testsuite/gdb.base/cast-indirection.exp +++ b/gdb/testsuite/gdb.base/cast-indirection.exp @@ -22,7 +22,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile \ return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/catch-fork-kill.exp b/gdb/testsuite/gdb.base/catch-fork-kill.exp index 224a8df..e851d66 100644 --- a/gdb/testsuite/gdb.base/catch-fork-kill.exp +++ b/gdb/testsuite/gdb.base/catch-fork-kill.exp @@ -59,7 +59,7 @@ proc do_test {fork_kind exit_kind} { with_test_prefix "$fork_kind" { clean_restart $testfile - if ![runto_main] { + if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/catch-gdb-caused-signals.exp b/gdb/testsuite/gdb.base/catch-gdb-caused-signals.exp index aa62972..862cae4 100644 --- a/gdb/testsuite/gdb.base/catch-gdb-caused-signals.exp +++ b/gdb/testsuite/gdb.base/catch-gdb-caused-signals.exp @@ -36,7 +36,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } @@ -47,7 +47,7 @@ gdb_test "handle SIGILL nostop noprint" \ gdb_test "print return_one()" " = 1" -if ![target_info exists gdb,noinferiorio] { +if {![target_info exists gdb,noinferiorio]} { # Clean up the breakpoint state. delete_breakpoints diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp index 9c5839c..0a1a4f3 100644 --- a/gdb/testsuite/gdb.base/catch-syscall.exp +++ b/gdb/testsuite/gdb.base/catch-syscall.exp @@ -348,7 +348,7 @@ proc test_catch_syscall_execve {} { # Check for entry/return across the execve, making sure that the # syscall_state isn't lost when turning into a new process. insert_catch_syscall_with_arg "execve" - if [check_continue "execve"] { + if {[check_continue "execve"]} { # The check_continue test generates an XFAIL on Powerpc. In # that case, gdb is already at main so don't do the continue. diff --git a/gdb/testsuite/gdb.base/charset.exp b/gdb/testsuite/gdb.base/charset.exp index 75fb9f09..80fbf4a 100644 --- a/gdb/testsuite/gdb.base/charset.exp +++ b/gdb/testsuite/gdb.base/charset.exp @@ -391,7 +391,7 @@ foreach target_charset $charset_subset { set var_name [string tolower "${target_charset}_string"] regsub -all -- "\[^a-z0-9_\]" $var_name "_" var_name } - + # Compute a regexp matching the results we expect. This is static, # but it's easier than writing it out. regsub -all "." "abfnrtv" "(\\\\&|x)" escapes @@ -492,7 +492,7 @@ foreach target_charset $charset_subset { } } - # Try printing a character escape that doesn't exist. We should + # Try printing a character escape that doesn't exist. We should # get the unescaped character, in the target character set. gdb_test "print $L'\\q'" " = \[0-9-\]+ $L'q'" \ "print escape that doesn't exist in $target_charset" @@ -549,7 +549,7 @@ if {$wchar_ok} { set ucs2_ok [expr {[get_sizeof char16_t 99] == 2}] -if ![valid_host_charset "UTF-16"] { +if {![valid_host_charset "UTF-16"]} { verbose -log "Disabling UTF-16 tests." set ucs2_ok 0 } @@ -640,4 +640,4 @@ foreach name {short int long} { } -gdb_exit +gdb_exit diff --git a/gdb/testsuite/gdb.base/chng-syms.exp b/gdb/testsuite/gdb.base/chng-syms.exp index dbc523d..0f7be07 100644 --- a/gdb/testsuite/gdb.base/chng-syms.exp +++ b/gdb/testsuite/gdb.base/chng-syms.exp @@ -15,8 +15,8 @@ # Author: Paul N. Hilfinger (Hilfinger@gnat.com) -# Test that GDB cleans up properly after errors that result when a -# breakpoint is reset. +# Test that GDB cleans up properly after errors that result when a +# breakpoint is reset. standard_testfile .c @@ -45,21 +45,21 @@ gdb_test "break stop_here if (var1 == 42)" \ gdb_run_cmd expect_to_stop_here "first time" - + gdb_continue_to_end "breakpoint first time through" # Now we recompile the executable, but without a variable named "var1", first # waiting to insure that even on fast machines, the file modification times -# are distinct. This will force GDB to reload the file on the -# next "run" command, causing an error when GDB tries to tries to reset +# are distinct. This will force GDB to reload the file on the +# next "run" command, causing an error when GDB tries to tries to reset # the breakpoint. sleep 2 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DVARIABLE=var2}] != "" } { -# Complication: Since GDB generally holds an open file descriptor on the -# executable at this point, there are some systems in which the -# re-compilation will fail. In such cases, we'll consider the test +# Complication: Since GDB generally holds an open file descriptor on the +# executable at this point, there are some systems in which the +# re-compilation will fail. In such cases, we'll consider the test # (vacuously) passed providing that re-running it succeeds as before. gdb_run_cmd diff --git a/gdb/testsuite/gdb.base/code-expr.exp b/gdb/testsuite/gdb.base/code-expr.exp index 8af2ee6..38f238c 100644 --- a/gdb/testsuite/gdb.base/code-expr.exp +++ b/gdb/testsuite/gdb.base/code-expr.exp @@ -275,7 +275,7 @@ gdb_test "whatis (enum misordered @data) v_misordered" \ "type = @data enum misordered" \ "(enum misordered @data)" -# +# # Pointers # diff --git a/gdb/testsuite/gdb.base/commands.exp b/gdb/testsuite/gdb.base/commands.exp index aa5ed56..c21be23 100644 --- a/gdb/testsuite/gdb.base/commands.exp +++ b/gdb/testsuite/gdb.base/commands.exp @@ -255,7 +255,7 @@ proc_with_prefix infrun_breakpoint_command_test {} { delete_breakpoints gdb_test "break factorial if value == 5" "Breakpoint.*at.*" -# infrun_breakpoint_command_test - This test was broken into two parts +# infrun_breakpoint_command_test - This test was broken into two parts # to get around a synchronization problem in expect. # part1: issue the gdb command "commands" # part2: send the list of commands @@ -547,7 +547,7 @@ proc_with_prefix user_defined_command_manyargs_test {} { set expected "nargs=$nargs:" for {set i 1} {$i <= $nargs} {incr i} { - append expected " " [expr 2 * $i] + append expected " " [expr {2 * $i}] } gdb_test $cmd $expected "execute command" @@ -658,7 +658,7 @@ proc_with_prefix test_command_prompt_position {} { gdb_test_multiple "printf \"Now the value is %d\\n\", value" $test { -re "^printf.*value\r\n>$" { gdb_test_multiple "end" $test { - -re "^end\r\n$gdb_prompt $" { + -re "^end\r\n$gdb_prompt $" { pass $test } } @@ -681,7 +681,7 @@ proc_with_prefix deprecated_command_test {} { gdb_test "p 5" ".\[0-9\]* = 5.*" "deprecated warning goes away /1/" gdb_test_no_output "maintenance deprecate p \"new_p\"" "maintenance deprecate p \"new_p\" /2/" - gdb_test_no_output "maintenance deprecate print \"new_print\"" + gdb_test_no_output "maintenance deprecate print \"new_print\"" gdb_test "p 5" \ "Warning: command 'print' \\(p\\) is deprecated.*Use 'new_print'.*" \ "both alias and command are deprecated" @@ -751,7 +751,7 @@ proc_with_prefix bp_deleted_in_command_test {} { # one command that deletes this breakpoint. gdb_test "break factorial" \ "Breakpoint \[0-9\]+ at .*: file .*run.c, line \[0-9\]+\." - + gdb_test_multiple "commands" "begin commands" { -re "Type commands for breakpoint.*>$" { pass "begin commands" diff --git a/gdb/testsuite/gdb.base/compare-sections.exp b/gdb/testsuite/gdb.base/compare-sections.exp index 981fa7b..b95149e 100644 --- a/gdb/testsuite/gdb.base/compare-sections.exp +++ b/gdb/testsuite/gdb.base/compare-sections.exp @@ -136,7 +136,7 @@ with_test_prefix "read-only" { } # Come up with different value. - set patch [expr 255 - $orig] + set patch [expr {255 - $orig}] # Write PATCH to memory. set written -1 diff --git a/gdb/testsuite/gdb.base/completion.exp b/gdb/testsuite/gdb.base/completion.exp index ca37559..59a6c57 100644 --- a/gdb/testsuite/gdb.base/completion.exp +++ b/gdb/testsuite/gdb.base/completion.exp @@ -20,7 +20,7 @@ # # tests for command completion # -# Here are some useful test cases for completion. +# Here are some useful test cases for completion. # They should be tested with both M-? and TAB. # # "show output-" "radix" @@ -676,7 +676,7 @@ with_cwd $srcdir { } # If the directory name contains a '+' we must escape it, adding a backslash. -# If not, the test below will fail because it will interpret the '+' as a +# If not, the test below will fail because it will interpret the '+' as a # regexp operator. We use string_to_regexp for this purpose. gdb_test "cd ${fullsrcdir}" \ diff --git a/gdb/testsuite/gdb.base/comprdebug.exp b/gdb/testsuite/gdb.base/comprdebug.exp index 686178d..d8859c5 100644 --- a/gdb/testsuite/gdb.base/comprdebug.exp +++ b/gdb/testsuite/gdb.base/comprdebug.exp @@ -25,7 +25,7 @@ if {[gdb_compile $srcdir/$subdir/$srcfile $ofile \ set objcopy_program [gdb_find_objcopy] set cmd "$objcopy_program --compress-debug-sections $ofile" verbose "invoking $cmd" -set result [catch "exec $cmd" output] +set result [catch {exec {*}$cmd} output] verbose "result is $result" verbose "output is $output" diff --git a/gdb/testsuite/gdb.base/cond-eval-mode.exp b/gdb/testsuite/gdb.base/cond-eval-mode.exp index ea43683..9f49801 100644 --- a/gdb/testsuite/gdb.base/cond-eval-mode.exp +++ b/gdb/testsuite/gdb.base/cond-eval-mode.exp @@ -58,7 +58,7 @@ gdb_test_multiple $test_target $test_target { # We now know that the target supports target-side conditional # evaluation. Now make sure we can force-disable the # ConditionalBreakpoints RSP feature. -if [gdb_protocol_is_remote] { +if {[gdb_protocol_is_remote]} { gdb_test \ "set remote conditional-breakpoints-packet off" \ "Support for the 'ConditionalBreakpoints' packet on the current remote target is set to \"off\"." diff --git a/gdb/testsuite/gdb.base/cond-expr.exp b/gdb/testsuite/gdb.base/cond-expr.exp index 2080937..31c2545 100644 --- a/gdb/testsuite/gdb.base/cond-expr.exp +++ b/gdb/testsuite/gdb.base/cond-expr.exp @@ -18,7 +18,7 @@ # This file is part of the gdb testsuite # -# test of evaluation of conditional expressions, with constants and +# test of evaluation of conditional expressions, with constants and # variables. Using the print and the whatis command # written with the only purpose in mind to cover the holes in the # eval.c file diff --git a/gdb/testsuite/gdb.base/condbreak-bad.exp b/gdb/testsuite/gdb.base/condbreak-bad.exp index 19c16dc..578478d 100644 --- a/gdb/testsuite/gdb.base/condbreak-bad.exp +++ b/gdb/testsuite/gdb.base/condbreak-bad.exp @@ -94,7 +94,7 @@ with_test_prefix "with continue 2" { set bpnum [get_integer_valueof "\$bpnum" 0 "get bpnum"] gdb_test_no_output "cond $bpnum a == 999" - + gdb_test "cond $bpnum gibberish" \ "No symbol \"gibberish\" in current context." \ "attempt a bad condition" diff --git a/gdb/testsuite/gdb.base/condbreak.exp b/gdb/testsuite/gdb.base/condbreak.exp index 81b1a36..6392dbc 100644 --- a/gdb/testsuite/gdb.base/condbreak.exp +++ b/gdb/testsuite/gdb.base/condbreak.exp @@ -13,7 +13,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -# This test was written by Rich Title. +# This test was written by Rich Title. # Purpose is to test conditional breakpoints. # Modeled after "break.exp". @@ -42,7 +42,7 @@ gdb_test "break -q main" \ "Breakpoint.*at.* file .*$srcfile, line.*" \ "breakpoint function" -# +# # test conditional break at function # gdb_test "break marker1 if 1==1" \ @@ -58,7 +58,7 @@ gdb_test "break $srcfile:$bp_location1 if 1==1" \ gdb_test_no_output "delete 3" -# +# # test conditional break at function # gdb_test "break marker1 if (1==1)" \ @@ -139,7 +139,7 @@ gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=. # user instruction, GDB's search finds the second line entry, decides # that the PC is indeed at the beginning of a source line, and doesn't # print an address in the breakpoint hit message. -# +# # GCC's Dwarf2 writer, on the other hand, squeezes out duplicate line # entries, so GDB considers the source line to begin at the start of # the function's prologue. Thus, if the program stops at the diff --git a/gdb/testsuite/gdb.base/consecutive-step-over.exp b/gdb/testsuite/gdb.base/consecutive-step-over.exp index 1116478..65379cc 100644 --- a/gdb/testsuite/gdb.base/consecutive-step-over.exp +++ b/gdb/testsuite/gdb.base/consecutive-step-over.exp @@ -39,7 +39,7 @@ set n_insns 3 # Extract addresses of a few consecutive instructions. set test "get breakpoint addresses" -if { [gdb_test_multiple "x /[expr $n_insns + 1]i \$pc" $test { +if { [gdb_test_multiple "x /[expr {$n_insns + 1}]i \$pc" $test { -re "=> $hex${up_to_nl} ($hex)${up_to_nl} ($hex)${up_to_nl} ($hex)${up_to_nl}$gdb_prompt $" { for {set i 1} {$i <= $n_insns} {incr i} { set bp_addrs($i) $expect_out($i,string) diff --git a/gdb/testsuite/gdb.base/constvars.exp b/gdb/testsuite/gdb.base/constvars.exp index dcc8d1b..4abd745 100644 --- a/gdb/testsuite/gdb.base/constvars.exp +++ b/gdb/testsuite/gdb.base/constvars.exp @@ -54,7 +54,7 @@ proc local_compiler_xfail_check { } { if {[test_compiler_info gcc-2-*]} { if { ![test_debug_format "HP"] \ && ![test_debug_format "DWARF \[0-9\]"] } then { - setup_xfail "*-*-*" + setup_xfail "*-*-*" } } } @@ -69,7 +69,7 @@ proc local_compiler_xfail_check_2 { } { } } -gdb_test "break marker1" "Breakpoint $decimal at .*" +gdb_test "break marker1" "Breakpoint $decimal at .*" gdb_test_multiple "cont" "up from marker1" { -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" { diff --git a/gdb/testsuite/gdb.base/continue-after-aborted-step-over.exp b/gdb/testsuite/gdb.base/continue-after-aborted-step-over.exp index 8ba1f61..2bac000 100644 --- a/gdb/testsuite/gdb.base/continue-after-aborted-step-over.exp +++ b/gdb/testsuite/gdb.base/continue-after-aborted-step-over.exp @@ -51,7 +51,7 @@ proc do_test {displaced breakpoint_always_inserted} { gdb_test_no_output "set displaced-stepping $displaced" gdb_test_no_output "set breakpoint always-inserted $breakpoint_always_inserted" - if ![runto_main] { + if {![runto_main]} { return -1 } @@ -59,7 +59,7 @@ proc do_test {displaced breakpoint_always_inserted} { # any kind of breakpoint insertion failure. If we can examine # what's at memory address 0, it is possible that we could also # execute it. - if [is_address_zero_readable] { + if {[is_address_zero_readable]} { untested "memory at address 0 is possibly executable" return } diff --git a/gdb/testsuite/gdb.base/continue-all-already-running.exp b/gdb/testsuite/gdb.base/continue-all-already-running.exp index 5d59f8d..a3e8c27 100644 --- a/gdb/testsuite/gdb.base/continue-all-already-running.exp +++ b/gdb/testsuite/gdb.base/continue-all-already-running.exp @@ -25,7 +25,7 @@ save_vars { GDBFLAGS } { } } -if ![runto_main] { +if {![runto_main]} { return } diff --git a/gdb/testsuite/gdb.base/coredump-filter-build-id.exp b/gdb/testsuite/gdb.base/coredump-filter-build-id.exp index eb5b489..75ba07d 100644 --- a/gdb/testsuite/gdb.base/coredump-filter-build-id.exp +++ b/gdb/testsuite/gdb.base/coredump-filter-build-id.exp @@ -48,7 +48,7 @@ if { ![gdb_gcore_cmd "$corefilename" "save corefile"] } { # Determine if GDB dumped the mapping containing the build-id. This # is done by invoking an external program (eu-unstrip). -if { [catch "exec [gdb_find_eu-unstrip] -n --core $corefilename" output] == 0 } { +if { [catch {exec [gdb_find_eu-unstrip] -n --core $corefilename} output] == 0 } { set line [lindex [split $output "\n"] 0] set test "gcore dumped mapping with build-id" diff --git a/gdb/testsuite/gdb.base/corefile-buildid.exp b/gdb/testsuite/gdb.base/corefile-buildid.exp index 88d989d..de0b295 100644 --- a/gdb/testsuite/gdb.base/corefile-buildid.exp +++ b/gdb/testsuite/gdb.base/corefile-buildid.exp @@ -36,7 +36,7 @@ proc create_core_file { progname } { verbose -log "corefile is $corefile" # Check the corefile has a build-id for the executable. - if { [catch "exec [gdb_find_eu-unstrip] -n --core $corefile" output] == 0 } { + if { [catch {exec [gdb_find_eu-unstrip] -n --core $corefile} output] == 0 } { set line [lindex [split $output "\n"] 0] set binfile_re (?:[string_to_regexp $progname]|\\\[(?:exe|pie)\\\]) if { ![regexp "^${::hex}\\+${::hex} \[a-f0-9\]+@${::hex}.*$binfile_re$" $line] } { diff --git a/gdb/testsuite/gdb.base/corefile-exec-context.exp b/gdb/testsuite/gdb.base/corefile-exec-context.exp index 23fd964..f6085f7 100644 --- a/gdb/testsuite/gdb.base/corefile-exec-context.exp +++ b/gdb/testsuite/gdb.base/corefile-exec-context.exp @@ -32,7 +32,7 @@ if {[build_executable $testfile.exp $testfile $srcfile] == -1} { # length then lets try to make it longer. set binfile_len [string length $binfile] if { $binfile_len <= 80 } { - set extra_len [expr 80 - $binfile_len + 1] + set extra_len [expr {80 - $binfile_len + 1}] set extra_str [string repeat "x" $extra_len] set new_binfile $binfile$extra_str remote_exec build "mv $binfile $new_binfile" diff --git a/gdb/testsuite/gdb.base/corefile.exp b/gdb/testsuite/gdb.base/corefile.exp index c34dfb5..6e44df84 100644 --- a/gdb/testsuite/gdb.base/corefile.exp +++ b/gdb/testsuite/gdb.base/corefile.exp @@ -60,7 +60,7 @@ proc start_gdb_with_corefile { testname coreopt corefile {binfile ""} } { -re -wrap "Couldn't find .* registers in core file.*" { fail "$gdb_test_name (couldn't find regs)" } - -re -wrap "Core was generated by `[string_to_regexp $corefile]'\\.\r\n.*\#0 \[^\r\n\]+\(\).*" { + -re -wrap "Core was generated by `[string_to_regexp $binfile]'\\.\r\n.*\#0 \[^\r\n\]+\(\).*" { pass $gdb_test_name } -re -wrap "Core was generated by .*\r\n\#0 .*\(\).*" { @@ -75,6 +75,16 @@ proc start_gdb_with_corefile { testname coreopt corefile {binfile ""} } { fail "$gdb_test_name (core not loaded)" } } + + # COREFILE will have whitespace quoted ready for use on the command + # line. But for the 'info inferiors' output whitespace is not quoted, + # so remote the quoting now. + regsub -all "\\\\ " $corefile " " corefile + gdb_test "info inferiors" \ + [multi_line \ + "\\* 1\[^\r\n\]+\\(core\\)\\s+.*[string_to_regexp $binfile]\\s*" \ + "\\s+core file [string_to_regexp $corefile]"] \ + "$testname, info inferiors" } } @@ -265,7 +275,7 @@ proc corefile_test_run {} { "run: sanity check we see the core file" set test "run: with core" - if [runto_main] { + if {[runto_main]} { pass $test } else { fail $test @@ -327,7 +337,7 @@ proc corefile_test_attach {} { return } - if [can_spawn_for_attach] { + if {[can_spawn_for_attach]} { set test "attach: spawn sleep" set res [remote_spawn host "$binfile sleep"] if { $res < 0 || $res == "" } { diff --git a/gdb/testsuite/gdb.base/ctf-ptype.exp b/gdb/testsuite/gdb.base/ctf-ptype.exp index 6d55cb2..1aaa48c 100644 --- a/gdb/testsuite/gdb.base/ctf-ptype.exp +++ b/gdb/testsuite/gdb.base/ctf-ptype.exp @@ -279,7 +279,7 @@ ptype_maybe_prototyped "fffptr" "int (*(*(*)(char))(short int))(long int)" \ if {[runto_main]} { - if [target_info exists gdb,cannot_call_functions] { + if {[target_info exists gdb,cannot_call_functions]} { unsupported "this target can not call functions" return } diff --git a/gdb/testsuite/gdb.base/ctxobj.exp b/gdb/testsuite/gdb.base/ctxobj.exp index 1d03e0d..4a50ab6 100644 --- a/gdb/testsuite/gdb.base/ctxobj.exp +++ b/gdb/testsuite/gdb.base/ctxobj.exp @@ -56,7 +56,7 @@ clean_restart $executable gdb_load_shlib $libobj1 gdb_load_shlib $libobj2 -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/dcache-flush.exp b/gdb/testsuite/gdb.base/dcache-flush.exp index 8e713f5..0bd034b 100644 --- a/gdb/testsuite/gdb.base/dcache-flush.exp +++ b/gdb/testsuite/gdb.base/dcache-flush.exp @@ -21,7 +21,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile}] } { return -1 } -if ![runto func] { +if {![runto func]} { return -1 } diff --git a/gdb/testsuite/gdb.base/dcache-line-read-error.exp b/gdb/testsuite/gdb.base/dcache-line-read-error.exp index bc8f47e..62d561c 100644 --- a/gdb/testsuite/gdb.base/dcache-line-read-error.exp +++ b/gdb/testsuite/gdb.base/dcache-line-read-error.exp @@ -21,7 +21,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile}] } { return -1 } -if ![runto breakpt] { +if {![runto breakpt]} { return -1 } @@ -45,7 +45,7 @@ proc delete_mem {} { # Make the dcache line size bigger than the pagesize. set pagesize [get_integer_valueof "pg_size" -1] -set linesize [expr $pagesize * 2] +set linesize [expr {$pagesize * 2}] gdb_test_no_output "set dcache line-size $linesize" \ "set dcache line size to twice the pagesize" diff --git a/gdb/testsuite/gdb.base/debug-expr.exp b/gdb/testsuite/gdb.base/debug-expr.exp index f22af24..0775d23 100644 --- a/gdb/testsuite/gdb.base/debug-expr.exp +++ b/gdb/testsuite/gdb.base/debug-expr.exp @@ -25,7 +25,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug}]} { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/debug-frame.exp b/gdb/testsuite/gdb.base/debug-frame.exp index b2b944d..eee65ae 100644 --- a/gdb/testsuite/gdb.base/debug-frame.exp +++ b/gdb/testsuite/gdb.base/debug-frame.exp @@ -23,7 +23,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfiles]} { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/default.exp b/gdb/testsuite/gdb.base/default.exp index b5e64c2..aab074c 100644 --- a/gdb/testsuite/gdb.base/default.exp +++ b/gdb/testsuite/gdb.base/default.exp @@ -31,14 +31,14 @@ set timeout 60 gdb_test "add-symbol-file" "add-symbol-file takes a file name and an address" # test append -gdb_test "append" "List of \"append\" subcommands:.*" -gdb_test "append binary" "List of \"append binary\" subcommands:.*" -gdb_test "append memory" "Missing filename\." -gdb_test "append value" "Missing filename\." -gdb_test "append binary memory" "Missing filename\." -gdb_test "append binary value" "Missing filename\." - -if !$use_gdb_stub { +gdb_test "append" "List of \"append\" subcommands:.*" +gdb_test "append binary" "List of \"append binary\" subcommands:.*" +gdb_test "append memory" "Missing filename\." +gdb_test "append value" "Missing filename\." +gdb_test "append binary memory" "Missing filename\." +gdb_test "append binary value" "Missing filename\." + +if {!$use_gdb_stub} { gdb_test_multiple "attach" "attach" { -re "Argument required .(process-id|program) to attach.*$gdb_prompt $"\ { pass "attach" } @@ -59,7 +59,7 @@ if !$use_gdb_stub { gdb_test $i "No default breakpoint address now." "break \"$i\" abbreviation" } - + gdb_test "backtrace" "No stack." # ba and bac are no longer unique command prefixes. So these tests @@ -148,21 +148,21 @@ gdb_test "down" "No stack.*" #test down-silently gdb_test "down-silently" "No stack." # test dump -gdb_test "dump" "List of \"dump\" subcommands:.*" -gdb_test "dump binary" "List of \"dump binary\" subcommands:.*" -gdb_test "dump ihex" "List of \"dump ihex\" subcommands:.*" -gdb_test "dump memory" "Missing filename\." -gdb_test "dump srec" "List of \"dump srec\" subcommands:.*" -gdb_test "dump tekhex" "List of \"dump tekhex\" subcommands:.*" -gdb_test "dump value" "Missing filename\." -gdb_test "dump binary memory" "Missing filename\." -gdb_test "dump binary value" "Missing filename\." -gdb_test "dump ihex memory" "Missing filename\." -gdb_test "dump ihex value" "Missing filename\." -gdb_test "dump srec memory" "Missing filename\." -gdb_test "dump srec value" "Missing filename\." -gdb_test "dump tekhex memory" "Missing filename\." -gdb_test "dump tekhex value" "Missing filename\." +gdb_test "dump" "List of \"dump\" subcommands:.*" +gdb_test "dump binary" "List of \"dump binary\" subcommands:.*" +gdb_test "dump ihex" "List of \"dump ihex\" subcommands:.*" +gdb_test "dump memory" "Missing filename\." +gdb_test "dump srec" "List of \"dump srec\" subcommands:.*" +gdb_test "dump tekhex" "List of \"dump tekhex\" subcommands:.*" +gdb_test "dump value" "Missing filename\." +gdb_test "dump binary memory" "Missing filename\." +gdb_test "dump binary value" "Missing filename\." +gdb_test "dump ihex memory" "Missing filename\." +gdb_test "dump ihex value" "Missing filename\." +gdb_test "dump srec memory" "Missing filename\." +gdb_test "dump srec value" "Missing filename\." +gdb_test "dump tekhex memory" "Missing filename\." +gdb_test "dump tekhex value" "Missing filename\." #test echo gdb_test_no_output "echo" "echo" #test enable breakpoints delete @@ -527,7 +527,7 @@ gdb_test "ptype" "The history is empty." gdb_test "pwd" "Working directory .*" #test run "r" abbreviation -if $use_gdb_stub { +if {$use_gdb_stub} { # Only extended-remote supports "run". } else { gdb_test_multiple "r" "run \"r\" abbreviation" { @@ -549,7 +549,7 @@ if $use_gdb_stub { } #test run -if $use_gdb_stub { +if {$use_gdb_stub} { # Only extended-remote supports "run". } else { gdb_test_multiple "run" "run" { @@ -771,7 +771,7 @@ set show_conv_list \ {$_linker_namespace_count = 0} \ {$_linker_namespace = <error: No registers.>}\ } -if [allow_python_tests] { +if {[allow_python_tests]} { append show_conv_list \ { {$_memeq = <internal function _memeq>} \ diff --git a/gdb/testsuite/gdb.base/detach-sysroot-target.exp b/gdb/testsuite/gdb.base/detach-sysroot-target.exp index c7466c0..b6a9da1 100644 --- a/gdb/testsuite/gdb.base/detach-sysroot-target.exp +++ b/gdb/testsuite/gdb.base/detach-sysroot-target.exp @@ -48,7 +48,7 @@ gdb_test_multiple "show sysroot" "" { } } -if ![runto_main] { +if {![runto_main]} { return } diff --git a/gdb/testsuite/gdb.base/disasm-end-cu.exp b/gdb/testsuite/gdb.base/disasm-end-cu.exp index d863e9f..34f25be 100644 --- a/gdb/testsuite/gdb.base/disasm-end-cu.exp +++ b/gdb/testsuite/gdb.base/disasm-end-cu.exp @@ -21,7 +21,7 @@ if { [prepare_for_testing "failed to prepare" "disasm-end-cu" {disasm-end-cu-1.c return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/disasm-optim.exp b/gdb/testsuite/gdb.base/disasm-optim.exp index abb2a23..9b81a4c 100644 --- a/gdb/testsuite/gdb.base/disasm-optim.exp +++ b/gdb/testsuite/gdb.base/disasm-optim.exp @@ -23,7 +23,7 @@ if { [prepare_for_testing "failed to prepare" $testfile ${testfile}.S {nodebug}] return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/displaced-step-closure.exp b/gdb/testsuite/gdb.base/displaced-step-closure.exp index 0803e44..bbdd207 100644 --- a/gdb/testsuite/gdb.base/displaced-step-closure.exp +++ b/gdb/testsuite/gdb.base/displaced-step-closure.exp @@ -24,7 +24,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/display.exp b/gdb/testsuite/gdb.base/display.exp index 2fb6e07..d635982 100644 --- a/gdb/testsuite/gdb.base/display.exp +++ b/gdb/testsuite/gdb.base/display.exp @@ -35,7 +35,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile \ # Preserve the old timeout, and set a new one that should be # sufficient to avoid timing out during this test. set oldtimeout $timeout -set timeout [expr "$timeout + 60"] +set timeout [expr {$timeout + 60}] verbose "Timeout is now $timeout seconds" 2 # use this to debug: @@ -43,7 +43,7 @@ verbose "Timeout is now $timeout seconds" 2 # Some coverage stuff # -if !$use_gdb_stub { +if {!$use_gdb_stub} { gdb_test "kill" ".*The program is not being run.*" gdb_test "detach" ".*" gdb_test "run" ".*" diff --git a/gdb/testsuite/gdb.base/dlmopen.exp b/gdb/testsuite/gdb.base/dlmopen.exp index c4eb7cd..f8c4f6c 100644 --- a/gdb/testsuite/gdb.base/dlmopen.exp +++ b/gdb/testsuite/gdb.base/dlmopen.exp @@ -118,7 +118,7 @@ proc check_dso_count { dso num } { gdb_test_multiple "info shared" "info shared" { -re "$hex $hex \($::decimal\\s+\)\?Yes \[^\r\n\]*$dso\r\n" { # use longer form so debug remote does not interfere - set count [expr $count + 1] + set count [expr {$count + 1}] exp_continue } -re "$gdb_prompt " { diff --git a/gdb/testsuite/gdb.base/dprintf-bp-same-addr.exp b/gdb/testsuite/gdb.base/dprintf-bp-same-addr.exp index 11a8310..5d8ffa3 100644 --- a/gdb/testsuite/gdb.base/dprintf-bp-same-addr.exp +++ b/gdb/testsuite/gdb.base/dprintf-bp-same-addr.exp @@ -17,8 +17,8 @@ standard_testfile -if [build_executable "failed to prepare" \ - ${testfile} ${srcfile} {debug}] { +if {[build_executable "failed to prepare" \ + ${testfile} ${srcfile} {debug}]} { return -1 } @@ -31,7 +31,7 @@ proc test { style } { clean_restart gdb_load $binfile - if ![runto_main] { + if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/dprintf-detach.exp b/gdb/testsuite/gdb.base/dprintf-detach.exp index 431037c..573aa0a 100644 --- a/gdb/testsuite/gdb.base/dprintf-detach.exp +++ b/gdb/testsuite/gdb.base/dprintf-detach.exp @@ -26,8 +26,8 @@ require can_spawn_for_attach standard_testfile set escapedbinfile [string_to_regexp ${binfile}] -if [build_executable "failed to prepare for dprintf-detach" \ - ${testfile} ${srcfile} {debug}] { +if {[build_executable "failed to prepare for dprintf-detach" \ + ${testfile} ${srcfile} {debug}]} { return -1 } @@ -44,7 +44,7 @@ proc dprintf_detach_test { breakpoint_always_inserted dprintf_style disconnected gdb_test_no_output "set dprintf-style ${dprintf_style}" gdb_test_no_output "set disconnected-dprintf ${disconnected_dprintf}" - if ![runto_main] { + if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/dprintf-next.exp b/gdb/testsuite/gdb.base/dprintf-next.exp index b28f565..d8ba03d 100644 --- a/gdb/testsuite/gdb.base/dprintf-next.exp +++ b/gdb/testsuite/gdb.base/dprintf-next.exp @@ -19,12 +19,12 @@ set expfile $testfile.exp set dp_location [gdb_get_line_number "Set dprintf here"] -if [prepare_for_testing "failed to prepare for dprintf with next" \ - ${testfile} ${srcfile} {debug}] { +if {[prepare_for_testing "failed to prepare for dprintf with next" \ + ${testfile} ${srcfile} {debug}]} { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/dprintf-non-stop.exp b/gdb/testsuite/gdb.base/dprintf-non-stop.exp index 7386ac6..538f703 100644 --- a/gdb/testsuite/gdb.base/dprintf-non-stop.exp +++ b/gdb/testsuite/gdb.base/dprintf-non-stop.exp @@ -16,8 +16,8 @@ standard_testfile set executable ${testfile} -if [build_executable "failed to prepare for dprintf with non-stop" \ - ${testfile} ${srcfile} {debug}] { +if {[build_executable "failed to prepare for dprintf with non-stop" \ + ${testfile} ${srcfile} {debug}]} { return -1 } @@ -26,7 +26,7 @@ save_vars { GDBFLAGS } { clean_restart ${executable} } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/dprintf.exp b/gdb/testsuite/gdb.base/dprintf.exp index 262ccc1..6fb2085 100644 --- a/gdb/testsuite/gdb.base/dprintf.exp +++ b/gdb/testsuite/gdb.base/dprintf.exp @@ -26,7 +26,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile $flags] } { set bp_location1 [gdb_get_line_number "set breakpoint 1 here"] set dp_location1 [gdb_get_line_number "set dprintf 1 here"] -if ![runto_main] { +if {![runto_main]} { return -1 } @@ -77,7 +77,7 @@ proc restart {} { clean_restart gdb_load $binfile - if ![runto_main] { + if {![runto_main]} { return -1 } @@ -142,7 +142,7 @@ proc test_call {} { # The "call" style depends on having I/O functions available. -if ![target_info exists gdb,noinferiorio] { +if {![target_info exists gdb,noinferiorio]} { with_test_prefix "call" { test_call } @@ -171,7 +171,7 @@ proc test_agent {} { } } - if !$target_can_dprintf { + if {!$target_can_dprintf} { return } @@ -191,7 +191,7 @@ proc test_agent {} { } } - if $target_can_dprintf { + if {$target_can_dprintf} { gdb_test "continue" "Breakpoint \[0-9\]+, foo .*" "2nd dprintf" gdb_test_sequence "info breakpoints" "dprintf info" { @@ -218,7 +218,7 @@ gdb_test "set dprintf-style foobar" "Undefined item: \"foobar\"." \ # Test that force-disabling the BreakpointCommands RSP feature works # as expected. dprintf relies on support for target-side breakpoint # commands --- use it as proxy. -if [gdb_protocol_is_remote] { +if {[gdb_protocol_is_remote]} { gdb_test \ "set remote breakpoint-commands-packet off" \ "Support for the 'BreakpointCommands' packet on the current remote target is set to \"off\"." diff --git a/gdb/testsuite/gdb.base/dtrace-probe.exp b/gdb/testsuite/gdb.base/dtrace-probe.exp index 5d4b9df..a91e31f 100644 --- a/gdb/testsuite/gdb.base/dtrace-probe.exp +++ b/gdb/testsuite/gdb.base/dtrace-probe.exp @@ -21,7 +21,7 @@ proc dtrace_test {} { global testfile hex srcfile binfile standard_testfile - + if {[dtrace_build_usdt_test_program] == -1} { untested "failed to compile" return -1 @@ -29,8 +29,8 @@ proc dtrace_test {} { clean_restart gdb_load $binfile - - if ![runto_main] { + + if {![runto_main]} { return -1 } @@ -71,7 +71,7 @@ proc dtrace_test {} { # test:progress-counter probe. Set a breakpoint on it and see # that it gets reached. - if ![runto_main] { + if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/dump.exp b/gdb/testsuite/gdb.base/dump.exp index 64d897b..67f3195 100644 --- a/gdb/testsuite/gdb.base/dump.exp +++ b/gdb/testsuite/gdb.base/dump.exp @@ -192,7 +192,7 @@ proc capture_pointer_with_type { pointer } { # Expected output of "p ${pointer}" is like "$7 = (int (*)[32]) 0x804a0e0", # and we want to extract "(int (*)[32]) 0x804a0e0" from it via # following regexp. - if [regexp " \\(.*\\).* 0x\[0-9a-fA-F\]+" $expect_out(0,string) output_string] { + if {[regexp " \\(.*\\).* 0x\[0-9a-fA-F\]+" $expect_out(0,string) output_string]} { # OUTPUT_STRING is expected to be like "(int (*)[32]) 0x804a0e0". pass "$test" } else { @@ -261,12 +261,12 @@ make_dump_file \ proc test_restore_saved_value { restore_args msg oldval newval } { global gdb_prompt - + gdb_test "restore $restore_args" \ "Restoring .*" \ "$msg; file restored ok" if { ![string compare $oldval \ - [capture_value $newval "$msg"]] } then { + [capture_value $newval "$msg"]] } then { pass "$msg; value restored ok" } else { fail "$msg; value restored ok" @@ -398,7 +398,7 @@ test_restore_saved_value "[set intstr1.bin] binary $struct2_start" \ # # test restore with start/stop addresses. # -# For this purpose, we will restore just the third element of the array, +# For this purpose, we will restore just the third element of the array, # and check to see that adjacent elements are not modified. # # We will need the address and offset of the third and fourth elements. @@ -449,7 +449,7 @@ gdb_test "print intarray\[4\] == 0" " = 1" "element 4 not changed - 4" if {![string compare $is64bitonly "no"]} { print_zero_all - # restore with expressions + # restore with expressions test_restore_saved_value \ "[set intarr3.srec] (char*)${array2_start}-(char*)${array_start} &intarray\[3\] &intarray\[4\]" \ "array partial with expressions" 4 "intarray2\[3\]" @@ -475,7 +475,7 @@ gdb_file_cmd ${binfile} # Now fix the endianness at the correct state. gdb_test_multiple "set endian $endian" "set endianness" { - -re ".* (big|little) endian.*$gdb_prompt $" { + -re ".* (big|little) endian.*$gdb_prompt $" { pass "setting $endian endianness" } } @@ -498,10 +498,10 @@ if { ![string compare $struct_val \ proc test_reload_saved_value { filename msg oldval newval } { global gdb_prompt - + gdb_file_cmd $filename if { ![string compare $oldval \ - [capture_value $newval "$msg"]] } then { + [capture_value $newval "$msg"]] } then { pass "$msg; value restored ok" } else { fail "$msg; value restored ok" diff --git a/gdb/testsuite/gdb.base/dup-sect.exp b/gdb/testsuite/gdb.base/dup-sect.exp index 28cefbb..5a5ad91 100644 --- a/gdb/testsuite/gdb.base/dup-sect.exp +++ b/gdb/testsuite/gdb.base/dup-sect.exp @@ -42,7 +42,7 @@ if {[build_executable ${testfile}.exp $executable [list ${srcfile} ${srcmainfile set test "rename section" set objcopy_program [gdb_find_objcopy] -set result [catch "exec $objcopy_program --rename-section sect2=sect1 $binfile" output] +set result [catch {exec $objcopy_program --rename-section sect2=sect1 $binfile} output] verbose "result is $result" verbose "output is $output" if {$result != 0} { @@ -62,7 +62,7 @@ if {[gdb_gnu_strip_debug $binfile] != 0} { # in $binfile. set test "strip" set strip_program [transform strip] -set result [catch "exec $strip_program $binfile" output] +set result [catch {exec $strip_program $binfile} output] verbose "result is $result" verbose "output is $output" if {$result != 0} { diff --git a/gdb/testsuite/gdb.base/ena-dis-br.exp b/gdb/testsuite/gdb.base/ena-dis-br.exp index 82982c4..92815a7 100644 --- a/gdb/testsuite/gdb.base/ena-dis-br.exp +++ b/gdb/testsuite/gdb.base/ena-dis-br.exp @@ -240,7 +240,7 @@ with_test_prefix "run $count" { incr count } -# See the comments in condbreak.exp for "run until breakpoint at marker1" +# See the comments in condbreak.exp for "run until breakpoint at marker1" # for an explanation of the xfail below. set test "continue to break marker1, 2nd time" gdb_test_multiple "continue" "$test" { diff --git a/gdb/testsuite/gdb.base/endianity.exp b/gdb/testsuite/gdb.base/endianity.exp index 44a7cbb..013866d 100644 --- a/gdb/testsuite/gdb.base/endianity.exp +++ b/gdb/testsuite/gdb.base/endianity.exp @@ -16,8 +16,8 @@ standard_testfile .c set test_sso [expr \ - [supports_scalar_storage_order_attribute] \ - && [supports_gnuc]] + {[supports_scalar_storage_order_attribute] \ + && [supports_gnuc]}] if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \ [list debug additional_flags=-DTEST_SSO=$test_sso]] } { diff --git a/gdb/testsuite/gdb.base/ending-run.exp b/gdb/testsuite/gdb.base/ending-run.exp index 0b5eadf..8c542ef 100644 --- a/gdb/testsuite/gdb.base/ending-run.exp +++ b/gdb/testsuite/gdb.base/ending-run.exp @@ -78,7 +78,7 @@ gdb_test_multiple "info line ending-run.c:$break1_line" "" { gdb_test_multiple "i b" "all set to continue" { -re ".* breakpoint .* breakpoint .*$gdb_prompt $" { - fail "all set to continue (didn't clear bps)" + fail "all set to continue (didn't clear bps)" } -re ".*2.*main.*$break2_line.*$gdb_prompt $" { pass "all set to continue" @@ -92,7 +92,7 @@ gdb_test_multiple "i b" "all set to continue" { # See if we can step out with control. The "1 2 3" stuff # is output from the program. # -if ![gdb_skip_stdio_test "cont"] { +if {![gdb_skip_stdio_test "cont"]} { gdb_test_stdio "cont" \ "1 2 7 14 23 34 47 62 79" \ "Breakpoint.*$break2_line.*" @@ -100,7 +100,7 @@ if ![gdb_skip_stdio_test "cont"] { gdb_test "cont" ".*Breakpoint.*$break2_line.*" } -if ![gdb_skip_stdio_test "Step to return"] { +if {![gdb_skip_stdio_test "Step to return"]} { gdb_test_stdio "next" \ "Goodbye!" \ "[expr {$break2_line + 1}].*" \ @@ -129,13 +129,13 @@ gdb_test_multiple "next" "step out of main" { fail "step out of main" gdb_test "n" ".*" "" } - -re ".*in.*start.*$gdb_prompt $" { + -re ".*in.*start.*$gdb_prompt $" { pass "step out of main" } - -re ".*in.*bsp_trap.*$gdb_prompt $" { + -re ".*in.*bsp_trap.*$gdb_prompt $" { pass "step out of main" } - -re ".*in.*init.*$gdb_prompt $" { + -re ".*in.*init.*$gdb_prompt $" { # This is what happens on sparc64-elf ultra. pass "step out of main" } @@ -172,7 +172,7 @@ gdb_test_multiple "next" "step out of main" { # This is what happens on the ARM RVDS runtime pass "step out of main" } - -re ".*in.*\\\$START\\\$.*from.*dld.sl.*$gdb_prompt $" { + -re ".*in.*\\\$START\\\$.*from.*dld.sl.*$gdb_prompt $" { pass "step out of main" } -re ".*in __wrap__?main ().*$gdb_prompt $" { @@ -183,7 +183,7 @@ gdb_test_multiple "next" "step out of main" { # another `next' is necessary. gdb_test "next" ".*in start_l ().*" "step out of main" } - -re ".*in.*currently asm.*$gdb_prompt $" { + -re ".*in.*currently asm.*$gdb_prompt $" { pass "step out of main" } -re "_*start\[0-9\]* \\(\[^)\]*\\).*$gdb_prompt $" { @@ -245,7 +245,7 @@ if {!$use_gdb_stub set program_exited_normally 1 } -re ".*Single.*in exit.*from.*dld.sl.*$gdb_prompt $" { - pass "step to end of run" + pass "step to end of run" set program_in_exit 1 } -re ".*Single.*_int_reset.*$gdb_prompt $" { @@ -254,7 +254,7 @@ if {!$use_gdb_stub set program_exited_normally 1 } } - } + } } if {$program_in_exit} { @@ -275,10 +275,10 @@ if {!$use_gdb_stub set exec_output [remote_exec host "ls core"] - if [ regexp "core not found" $exec_output] { + if {[ regexp "core not found" $exec_output]} { pass "no core dumped on quit" } else { - if [ regexp "No such file or directory" $exec_output] { + if {[ regexp "No such file or directory" $exec_output]} { pass "ls: core (No core dumped on quit)" } else { remote_exec build "rm -f core" diff --git a/gdb/testsuite/gdb.base/errno.exp b/gdb/testsuite/gdb.base/errno.exp index ea1ff70..9607b81 100644 --- a/gdb/testsuite/gdb.base/errno.exp +++ b/gdb/testsuite/gdb.base/errno.exp @@ -47,7 +47,7 @@ standard_testfile proc do_tests {{do_xfail_cast 0} {do_xfail 0} {do_xfail_core_test 0}} { clean_restart gdb_load $::binfile - if ![runto_main] { + if {![runto_main]} { return } @@ -145,12 +145,12 @@ proc do_tests {{do_xfail_cast 0} {do_xfail 0} {do_xfail_core_test 0}} { } } - if $do_xfail { + if {$do_xfail} { setup_xfail *-*-* } gdb_test "print errno" ".* = 42" - if $do_xfail_cast { + if {$do_xfail_cast} { setup_xfail *-*-* } gdb_test "print (int) errno" ".* = 42" @@ -173,7 +173,7 @@ proc do_tests {{do_xfail_cast 0} {do_xfail 0} {do_xfail_core_test 0}} { gdb_test "print errno" ".* = 36" "print masking errno" # Finish test early if no core file was made. - if !$core_supported { + if {!$core_supported} { return } @@ -184,7 +184,7 @@ proc do_tests {{do_xfail_cast 0} {do_xfail 0} {do_xfail_core_test 0}} { if { $core_loaded == -1 } { return } - if $do_xfail_core_test { + if {$do_xfail_core_test} { setup_xfail *-*-* } gdb_test "print errno" ".* = 42" "check errno value from corefile" diff --git a/gdb/testsuite/gdb.base/eu-strip-infcall.exp b/gdb/testsuite/gdb.base/eu-strip-infcall.exp index 1040f6a..43f2bc0 100644 --- a/gdb/testsuite/gdb.base/eu-strip-infcall.exp +++ b/gdb/testsuite/gdb.base/eu-strip-infcall.exp @@ -28,7 +28,7 @@ if {[lindex $status 0] != 0} { clean_restart $testfile -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/eval-avoid-side-effects.exp b/gdb/testsuite/gdb.base/eval-avoid-side-effects.exp index f914594..fdd6bed 100644 --- a/gdb/testsuite/gdb.base/eval-avoid-side-effects.exp +++ b/gdb/testsuite/gdb.base/eval-avoid-side-effects.exp @@ -22,7 +22,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/eval-skip.exp b/gdb/testsuite/gdb.base/eval-skip.exp index b4c856e..aca5118 100644 --- a/gdb/testsuite/gdb.base/eval-skip.exp +++ b/gdb/testsuite/gdb.base/eval-skip.exp @@ -23,7 +23,7 @@ # operators, or in the non returned part of a (x ? y: z) expression. # the part that is not evaluated is parsed and evaluated anyway, but with # the EVAL_SKIP flag set -# +# # source file "int-type.c" # diff --git a/gdb/testsuite/gdb.base/examine-backward.exp b/gdb/testsuite/gdb.base/examine-backward.exp index cc162ee..0eef327 100644 --- a/gdb/testsuite/gdb.base/examine-backward.exp +++ b/gdb/testsuite/gdb.base/examine-backward.exp @@ -22,7 +22,7 @@ if { [prepare_for_testing "failed to prepare for examine-backward" \ return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } @@ -357,7 +357,7 @@ with_test_prefix "backward disassemble general" { lappend disassmbly $instructions } for {set i 0} {$i < [llength $length_to_examine]} {incr i} { - set idx [expr [llength $length_to_examine] - $i - 1] + set idx [expr {[llength $length_to_examine] - $i - 1}] set len [lindex $length_to_examine $idx] set actual [capture_command_output "x/-${len}i" ""] set expected [lindex $disassmbly $idx] diff --git a/gdb/testsuite/gdb.base/execution-termios.exp b/gdb/testsuite/gdb.base/execution-termios.exp index 55656be..c817db2 100644 --- a/gdb/testsuite/gdb.base/execution-termios.exp +++ b/gdb/testsuite/gdb.base/execution-termios.exp @@ -24,7 +24,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} { proc test { prefix body } { with_test_prefix $prefix { - if ![runto_main] { + if {![runto_main]} { return 0 } uplevel 1 $body @@ -39,7 +39,7 @@ test "next" { } test "infcall" { - if ![target_info exists gdb,cannot_call_functions] { + if {![target_info exists gdb,cannot_call_functions]} { gdb_test "print func ()" " = 1" "termios ok" } else { unsupported "cannot call functions" diff --git a/gdb/testsuite/gdb.base/expand-psymtabs.exp b/gdb/testsuite/gdb.base/expand-psymtabs.exp index 1315535..981a06d 100644 --- a/gdb/testsuite/gdb.base/expand-psymtabs.exp +++ b/gdb/testsuite/gdb.base/expand-psymtabs.exp @@ -26,7 +26,7 @@ # # This test is meant to verify that, even with lazy partial symtab # reading in effect, GDB can set breakpoints by line number -# successfully in either compilation unit. +# successfully in either compilation unit. standard_testfile diff --git a/gdb/testsuite/gdb.base/exprs.exp b/gdb/testsuite/gdb.base/exprs.exp index ee0c198..b1cc8fb 100644 --- a/gdb/testsuite/gdb.base/exprs.exp +++ b/gdb/testsuite/gdb.base/exprs.exp @@ -45,11 +45,11 @@ proc test_expr { args } { if { [llength $args] % 2 } { warning "an even # of arguments should be passed to test_expr" } - set last_ent [expr [llength $args] - 1] + set last_ent [expr {[llength $args] - 1}] set testname [lindex $args $last_ent] gdb_test [lindex $args 0] ".*" "$testname, setup" - for {set x 1} {$x < $last_ent} {set x [expr $x + 2]} { - gdb_test [lindex $args $x] [lindex $args [expr $x + 1]] "$testname, [lindex $args $x]" + for {set x 1} {$x < $last_ent} {set x [expr {$x + 2}]} { + gdb_test [lindex $args $x] [lindex $args [expr {$x + 1}]] "$testname, [lindex $args $x]" } } # @@ -224,10 +224,10 @@ gdb_test_multiple "print sizeof (long long) > sizeof (long)" \ pass "sizeof (long long) > sizeof (long) (false)" } } -if [expr ! $ok] { setup_xfail "*-*-*" } +if {!$ok} { setup_xfail "*-*-*" } gdb_test "print (void*) ((long long) (unsigned long) -1 + 1)" \ "warning: value truncated.*" "truncate (void*) 0x00000000ffffffff + 1" -if [expr ! $ok] { setup_xfail "*-*-*" } +if {!$ok} { setup_xfail "*-*-*" } gdb_test "print (void*) (~((long long)(unsigned long) -1) - 1)" \ "warning: value truncated.*" "truncate (void*) 0xffffffff00000000 - 1" diff --git a/gdb/testsuite/gdb.base/fileio.exp b/gdb/testsuite/gdb.base/fileio.exp index a6b4c23..e2b7354 100644 --- a/gdb/testsuite/gdb.base/fileio.exp +++ b/gdb/testsuite/gdb.base/fileio.exp @@ -39,7 +39,7 @@ if {[file exists $dir2] && ![file writable $dir2]} { system "rm -rf [standard_output_file *.fileio.test]" set oldtimeout $timeout -set timeout [expr "$timeout + 60"] +set timeout [expr {$timeout + 60}] clean_restart gdb_load $binfile @@ -51,7 +51,7 @@ if {![runto_main]} { return } -gdb_test "break stop" "Breakpoint .*$srcfile.*" +gdb_test "break stop" "Breakpoint .*$srcfile.*" set stop_msg ".*Breakpoint .* stop \\(\\) at.*$srcfile:.*static void stop \\(void\\) {}.*" @@ -73,7 +73,7 @@ gdb_test continue \ gdb_test "continue" ".*" "" -catch "system \"chmod -f -w [standard_output_file nowrt.fileio.test]\"" +catch {system "chmod -f -w [standard_output_file nowrt.fileio.test]"} # If the user is root, we will always have write permission. if { [root_user] } { @@ -241,7 +241,7 @@ gdb_test continue \ # This test fails on Cygwin because unlink() succeeds on Win32 systems # in that situation. -if [ishost *cygwin*] { +if {[ishost *cygwin*]} { setup_xfail "*-*-*" } # If the user is root, we will always have write permission. diff --git a/gdb/testsuite/gdb.base/filename-completion.exp b/gdb/testsuite/gdb.base/filename-completion.exp index c10941c..c80e634 100644 --- a/gdb/testsuite/gdb.base/filename-completion.exp +++ b/gdb/testsuite/gdb.base/filename-completion.exp @@ -148,7 +148,7 @@ proc test_tab_complete_within_line_multiple { input_line back_count \ [join [list \ [string range $input_line 0 end-$back_count] \ ${add_completed_line} \ - [string range $input_line end-[expr $back_count - 1] end]] \ + [string range $input_line end-[expr {$back_count - 1}] end]] \ ""] set expanded_line_re [string_to_regexp $expanded_line] @@ -166,7 +166,7 @@ proc test_tab_complete_within_line_multiple { input_line back_count \ set after_tab_re "^$input_line_re" set after_tab_re "$after_tab_re\\\x08{$back_count}" set after_tab_re "$after_tab_re${completion::bell_re}" - set tail [string range $input_line end-[expr $back_count - 1] end] + set tail [string range $input_line end-[expr {$back_count - 1}] end] set after_tab_re "$after_tab_re$add_completed_line_re" set after_tab_re "$after_tab_re[string_to_regexp $tail]" set after_tab_re "$after_tab_re\\\x08{$back_count}" @@ -218,7 +218,7 @@ proc test_tab_complete_within_line_unique { input_line back_count insert_str } { set re [string_to_regexp $input_line] set re $re\\\x08{$back_count} set re $re[string_to_regexp $insert_str] - set tail [string range $input_line end-[expr $back_count - 1] end] + set tail [string range $input_line end-[expr {$back_count - 1}] end] set re $re[string_to_regexp $tail] set re $re\\\x08{$back_count} diff --git a/gdb/testsuite/gdb.base/find-unmapped.exp b/gdb/testsuite/gdb.base/find-unmapped.exp index 28c5fd8..8f18650 100644 --- a/gdb/testsuite/gdb.base/find-unmapped.exp +++ b/gdb/testsuite/gdb.base/find-unmapped.exp @@ -19,7 +19,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile}] } { return -1 } -if ![runto breakpt] { +if {![runto breakpt]} { return -1 } diff --git a/gdb/testsuite/gdb.base/find.exp b/gdb/testsuite/gdb.base/find.exp index 3b2dfb0..aa4fc3c 100644 --- a/gdb/testsuite/gdb.base/find.exp +++ b/gdb/testsuite/gdb.base/find.exp @@ -165,7 +165,7 @@ gdb_test "find /w search_buf, +search_buf_size, 0x12345678" \ # For native targets, test a pattern straddling a chunk boundary. -if [isnative] { +if {[isnative]} { gdb_test_no_output "set *(int32_t*) &search_buf\[${CHUNK_SIZE}-1\] = 0xfdb97531" "" gdb_test "find /w search_buf, +search_buf_size, 0xfdb97531" \ "${hex_number}${one_pattern_found}" \ diff --git a/gdb/testsuite/gdb.base/finish-pretty.exp b/gdb/testsuite/gdb.base/finish-pretty.exp index 6c23cec..8f0c7c1 100644 --- a/gdb/testsuite/gdb.base/finish-pretty.exp +++ b/gdb/testsuite/gdb.base/finish-pretty.exp @@ -29,7 +29,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile $opts] } { } proc finish_pretty { } { - if ![runto foo] { + if {![runto foo]} { return } gdb_test_no_output "set print pretty" \ diff --git a/gdb/testsuite/gdb.base/fission-macro.exp b/gdb/testsuite/gdb.base/fission-macro.exp index c86a1a4..0680da6 100644 --- a/gdb/testsuite/gdb.base/fission-macro.exp +++ b/gdb/testsuite/gdb.base/fission-macro.exp @@ -14,7 +14,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. */ # Gcc 14 is the first release containing the fix for PR debug/111409. -require {expr [gcc_major_version] >= 14} +require {expr {[gcc_major_version] >= 14}} standard_testfile .c -2.c diff --git a/gdb/testsuite/gdb.base/foll-fork.exp b/gdb/testsuite/gdb.base/foll-fork.exp index 12db516..470f651 100644 --- a/gdb/testsuite/gdb.base/foll-fork.exp +++ b/gdb/testsuite/gdb.base/foll-fork.exp @@ -67,8 +67,8 @@ proc_with_prefix check_fork_catchpoints {} { # the followed process stops where it is expected to stop, that processes # are detached (or not) as expected, and that the inferior list has the # expected contents after following the fork. WHO is the argument to -# the 'set follow-fork-mode' command, DETACH is the argument to the -# 'set detach-on-fork' command, and CMD is the GDB command used to +# the 'set follow-fork-mode' command, DETACH is the argument to the +# 'set detach-on-fork' command, and CMD is the GDB command used to # execute the program past the fork. If the value of WHO or DETACH is # 'default', the corresponding GDB command is skipped for that test. # The value of CMD must be either 'next 2' or 'continue'. diff --git a/gdb/testsuite/gdb.base/foll-vfork.exp b/gdb/testsuite/gdb.base/foll-vfork.exp index 6ca7711..a480b93 100644 --- a/gdb/testsuite/gdb.base/foll-vfork.exp +++ b/gdb/testsuite/gdb.base/foll-vfork.exp @@ -53,7 +53,7 @@ if { [is_remote target] } { proc setup_gdb { binfile srcfile } { clean_restart $binfile - if ![runto_main] { + if {![runto_main]} { return -code return } diff --git a/gdb/testsuite/gdb.base/fork-print-inferior-events.exp b/gdb/testsuite/gdb.base/fork-print-inferior-events.exp index c24a9bc..0c6ad87 100644 --- a/gdb/testsuite/gdb.base/fork-print-inferior-events.exp +++ b/gdb/testsuite/gdb.base/fork-print-inferior-events.exp @@ -83,7 +83,7 @@ foreach_with_prefix print_inferior_events { "on" "off" } { # Always add the "Starting program..." string so that we # match exactly the lines we want. set output "Starting program: $binfile\\s*\r\n${thread_db_re}${output}${thread_db_re}${exited_normally_re}" - set i [expr $i + 1] + set i [expr {$i + 1}] gdb_test "run" $output } } diff --git a/gdb/testsuite/gdb.base/fortran-sym-case.exp b/gdb/testsuite/gdb.base/fortran-sym-case.exp index 58383c9..f0c4518 100644 --- a/gdb/testsuite/gdb.base/fortran-sym-case.exp +++ b/gdb/testsuite/gdb.base/fortran-sym-case.exp @@ -19,7 +19,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile}] } { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/frame-selection.exp b/gdb/testsuite/gdb.base/frame-selection.exp index fd492a3..9806a59 100644 --- a/gdb/testsuite/gdb.base/frame-selection.exp +++ b/gdb/testsuite/gdb.base/frame-selection.exp @@ -52,7 +52,7 @@ proc get_new_address { {addresses {}} } { set elem [lindex [lsort -integer -decreasing $addresses] 0] # Return a new address as a hex formatted string. - return [format "%#x" [expr $elem + 0x10]] + return [format "%#x" [expr {$elem + 0x10}]] } diff --git a/gdb/testsuite/gdb.base/fullname.exp b/gdb/testsuite/gdb.base/fullname.exp index ec90179..d989a48 100644 --- a/gdb/testsuite/gdb.base/fullname.exp +++ b/gdb/testsuite/gdb.base/fullname.exp @@ -35,7 +35,7 @@ if { [gdb_compile [standard_output_file tmp-${srcfile}] "${binfile}" executable return -1 } -# Unlike most GDB tests, we do not use gdb_reinitialize_dir in this script. +# Unlike most GDB tests, we do not use gdb_reinitialize_dir in this script. # We're testing GDB's ability to find files in other ways. # Get the line number. diff --git a/gdb/testsuite/gdb.base/fullpath-expand.exp b/gdb/testsuite/gdb.base/fullpath-expand.exp index d18a6f4..a94488f 100644 --- a/gdb/testsuite/gdb.base/fullpath-expand.exp +++ b/gdb/testsuite/gdb.base/fullpath-expand.exp @@ -33,7 +33,7 @@ with_cwd $srcdir { } } -set result [catch "exec realpath ${srcdir}/${subdir}/${srcfile2}" realsrcfile2] +set result [catch {exec realpath ${srcdir}/${subdir}/${srcfile2}} realsrcfile2] if { $result != 0 || $realsrcfile2 == "" } { untested "invalid realpath of ${srcfile2}: result $result output $realsrcfile2" return -1 diff --git a/gdb/testsuite/gdb.base/func-ptr.exp b/gdb/testsuite/gdb.base/func-ptr.exp index 4bc80ac..d2eb0bc 100644 --- a/gdb/testsuite/gdb.base/func-ptr.exp +++ b/gdb/testsuite/gdb.base/func-ptr.exp @@ -21,7 +21,7 @@ if { [prepare_for_testing "failed to prepare" "func-ptr" {func-ptr.c} {debug}] } return -1 } -if ![runto_main] { +if {![runto_main]} { return 0 } diff --git a/gdb/testsuite/gdb.base/funcargs.exp b/gdb/testsuite/gdb.base/funcargs.exp index 1c1b74b..e4c3c5b 100644 --- a/gdb/testsuite/gdb.base/funcargs.exp +++ b/gdb/testsuite/gdb.base/funcargs.exp @@ -21,7 +21,7 @@ standard_testfile set gcc_compiled [is_c_compiler_gcc] set compile_flags {debug nowarnings quiet} -if [support_complex_tests] { +if {[support_complex_tests]} { lappend compile_flags "additional_flags=-DTEST_COMPLEX" } @@ -55,7 +55,7 @@ proc_with_prefix integral_args {} { # Print each arg as a double check to see if we can print # them here as well as with backtrace. - gdb_test "print c" ".* = 97 'a'" "print c after run to call0a" + gdb_test "print c" ".* = 97 'a'" "print c after run to call0a" gdb_test "print s" ".* = 1" "print s after run to call0a" gdb_test "print i" ".* = 2" "print i after run to call0a" gdb_test "print l " ".* = 3" "print l after run to call0a" @@ -921,7 +921,7 @@ proc_with_prefix localvars_in_indirect_call { } { gdb_breakpoint call0a gdb_continue call0a delete_breakpoints - + # Print each arg as a double check to see if we can print # them here as well as with backtrace. @@ -937,9 +937,9 @@ proc_with_prefix localvars_in_indirect_call { } { "#0.*call0a \\(c=97 'a', s=1, i=2, l=3\\).*#1.*main.*" \ "backtrace in indirectly called function" - # + # # "finish" brings us back to main. We then will try to step through - # the second indirect call. + # the second indirect call. # On some targets (e.g. m68k) gdb will stop from the finish in midline # of the first indirect call. This is due to stack adjustment instructions # after the indirect call. In these cases we will step till we hit the @@ -1032,7 +1032,7 @@ proc_with_prefix stepping_over_trampolines { } { } set prev_timeout $timeout -if [istarget "mips*tx39-*"] { +if {[istarget "mips*tx39-*"]} { set timeout 300 } else { set timeout 60 @@ -1083,7 +1083,7 @@ if {$allow_float_test} { } # Test _Complex type here if supported. -if [support_complex_tests] { +if {[support_complex_tests]} { complex_args complex_integral_args diff --git a/gdb/testsuite/gdb.base/gcore-memory-usage.exp b/gdb/testsuite/gdb.base/gcore-memory-usage.exp index 14b03a0..ca47ad6 100644 --- a/gdb/testsuite/gdb.base/gcore-memory-usage.exp +++ b/gdb/testsuite/gdb.base/gcore-memory-usage.exp @@ -73,8 +73,8 @@ proc run_test {megs max_mem} { # Do the main part of the test: How much is the memory # usage of GDB going to grow after using the gcore command. - set diff_k [expr $mem_after - $mem_before] - set diff [expr $diff_k/1024] + set diff_k [expr {$mem_after - $mem_before}] + set diff [expr {$diff_k/1024}] verbose -log "The gcore command used $diff Mb ($diff_k Kb)" gdb_assert {$diff <= $max_mem} "gdb did not use too much memory" diff --git a/gdb/testsuite/gdb.base/gcore-relro-pie.exp b/gdb/testsuite/gdb.base/gcore-relro-pie.exp index 641caf1..a7a6e9b 100644 --- a/gdb/testsuite/gdb.base/gcore-relro-pie.exp +++ b/gdb/testsuite/gdb.base/gcore-relro-pie.exp @@ -29,7 +29,7 @@ set gcorefile ${binfile}.gcore set strip_program [transform strip] remote_file host delete ${stripped_binfile} -if [run_on_host "strip" "$strip_program" "-g -o ${stripped_binfile} $binfile"] { +if {[run_on_host "strip" "$strip_program" "-g -o ${stripped_binfile} $binfile"]} { return -1 } @@ -42,7 +42,7 @@ clean_restart gdb_load $stripped_binfile # The binary is stripped of debug info, but not minsyms. -if ![runto break_here] { +if {![runto break_here]} { return -1 } diff --git a/gdb/testsuite/gdb.base/gcore-relro.exp b/gdb/testsuite/gdb.base/gcore-relro.exp index 2bbd064..4d3d352 100644 --- a/gdb/testsuite/gdb.base/gcore-relro.exp +++ b/gdb/testsuite/gdb.base/gcore-relro.exp @@ -38,7 +38,7 @@ with_test_prefix "first session" { gdb_load $binfile gdb_load_shlib ${binfile_lib} - if ![runto lib] { + if {![runto lib]} { return -1 } diff --git a/gdb/testsuite/gdb.base/gcore-tls-pie.exp b/gdb/testsuite/gdb.base/gcore-tls-pie.exp index a8f7366..27df210 100644 --- a/gdb/testsuite/gdb.base/gcore-tls-pie.exp +++ b/gdb/testsuite/gdb.base/gcore-tls-pie.exp @@ -33,7 +33,7 @@ set gcorefile ${binfile}.gcore set strip_program [transform strip] remote_file host delete ${stripped_binfile} -if [run_on_host "strip" "$strip_program" "-g -o ${stripped_binfile} $binfile"] { +if {[run_on_host "strip" "$strip_program" "-g -o ${stripped_binfile} $binfile"]} { return -1 } @@ -46,7 +46,7 @@ clean_restart gdb_load $stripped_binfile # The binary is stripped of debug info, but not minsyms. -if ![runto break_here] { +if {![runto break_here]} { return -1 } diff --git a/gdb/testsuite/gdb.base/gcore.exp b/gdb/testsuite/gdb.base/gcore.exp index c8a4c11..a902760 100644 --- a/gdb/testsuite/gdb.base/gcore.exp +++ b/gdb/testsuite/gdb.base/gcore.exp @@ -102,7 +102,7 @@ if {![string compare $pre_corefile_sysregs $post_corefile_sysregs]} { set post_corefile_extern_array \ [capture_command_output "print extern_array" "$print_prefix"] -if ![string compare $pre_corefile_extern_array $post_corefile_extern_array] { +if {![string compare $pre_corefile_extern_array $post_corefile_extern_array]} { pass "corefile restored extern array" } else { fail "corefile restored extern array" @@ -110,7 +110,7 @@ if ![string compare $pre_corefile_extern_array $post_corefile_extern_array] { set post_corefile_static_array \ [capture_command_output "print static_array" "$print_prefix"] -if ![string compare $pre_corefile_static_array $post_corefile_static_array] { +if {![string compare $pre_corefile_static_array $post_corefile_static_array]} { pass "corefile restored static array" } else { fail "corefile restored static array" @@ -118,7 +118,7 @@ if ![string compare $pre_corefile_static_array $post_corefile_static_array] { set post_corefile_uninit_array \ [capture_command_output "print un_initialized_array" "$print_prefix"] -if ![string compare $pre_corefile_uninit_array $post_corefile_uninit_array] { +if {![string compare $pre_corefile_uninit_array $post_corefile_uninit_array]} { pass "corefile restored un-initialized array" } else { fail "corefile restored un-initialized array" @@ -126,7 +126,7 @@ if ![string compare $pre_corefile_uninit_array $post_corefile_uninit_array] { set post_corefile_heap_string \ [capture_command_output "print heap_string" "$print_prefix"] -if ![string compare $pre_corefile_heap_string $post_corefile_heap_string] { +if {![string compare $pre_corefile_heap_string $post_corefile_heap_string]} { pass "corefile restored heap array" } else { fail "corefile restored heap array" @@ -134,14 +134,14 @@ if ![string compare $pre_corefile_heap_string $post_corefile_heap_string] { set post_corefile_local_array \ [capture_command_output "print array_func::local_array" "$print_prefix"] -if ![string compare $pre_corefile_local_array $post_corefile_local_array] { +if {![string compare $pre_corefile_local_array $post_corefile_local_array]} { pass "corefile restored stack array" } else { fail "corefile restored stack array" } set post_corefile_backtrace [capture_command_output "backtrace" ""] -if ![string compare $pre_corefile_backtrace $post_corefile_backtrace] { +if {![string compare $pre_corefile_backtrace $post_corefile_backtrace]} { pass "corefile restored backtrace" } else { fail "corefile restored backtrace" diff --git a/gdb/testsuite/gdb.base/gdb-sigterm.exp b/gdb/testsuite/gdb.base/gdb-sigterm.exp index f0802c4..02410fd 100644 --- a/gdb/testsuite/gdb.base/gdb-sigterm.exp +++ b/gdb/testsuite/gdb.base/gdb-sigterm.exp @@ -34,7 +34,7 @@ if { [build_executable ${testfile}.exp ${testfile} $srcfile $options] == -1 } { proc do_test { pass } { global testfile gdb_prompt binfile pf_prefix - if ![runto_main] { + if {![runto_main]} { return -1 } @@ -53,7 +53,7 @@ proc do_test { pass } { set abort 0 } } - if $abort { + if {$abort} { verbose -log "$pf_prefix $test: did not run" return $abort } diff --git a/gdb/testsuite/gdb.base/gdb1555.exp b/gdb/testsuite/gdb.base/gdb1555.exp index ab12a28..174c8f7 100644 --- a/gdb/testsuite/gdb.base/gdb1555.exp +++ b/gdb/testsuite/gdb.base/gdb1555.exp @@ -49,8 +49,8 @@ gdb_test_multiple "s" $name \ -re "hithere2 \\(\\) at.*${libfile}.c:\[0-9\]+\r\n\[0-9\]+.*a = 21;.*$gdb_prompt $" { pass $name } - -re "0x\[0-9a-f\]+ in .* \\(\\) from /lib/ld.so.1.*$gdb_prompt $" { - kfail "gdb/1555" $name + -re "0x\[0-9a-f\]+ in .* \\(\\) from /lib/ld.so.1.*$gdb_prompt $" { + kfail "gdb/1555" $name } } @@ -61,8 +61,8 @@ gdb_test_multiple "n" $name \ -re "\[0-9\]+.*return a;.*$gdb_prompt $" { pass $name } - -re "Single stepping until exit from function .*, \r\nwhich has no line number information.\r\n\r\n$inferior_exited_re normally.*$gdb_prompt $" { - kfail "gdb/1555" $name + -re "Single stepping until exit from function .*, \r\nwhich has no line number information.\r\n\r\n$inferior_exited_re normally.*$gdb_prompt $" { + kfail "gdb/1555" $name } } diff --git a/gdb/testsuite/gdb.base/gdb1821.exp b/gdb/testsuite/gdb.base/gdb1821.exp index c377150..cd9c542 100644 --- a/gdb/testsuite/gdb.base/gdb1821.exp +++ b/gdb/testsuite/gdb.base/gdb1821.exp @@ -30,6 +30,6 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} { if {![runto_main]} { return -} -gdb_test "print /x bar" "{x__0 = 0x0, y__0 = 0x0, z__1 = 0x0}" +} +gdb_test "print /x bar" "{x__0 = 0x0, y__0 = 0x0, z__1 = 0x0}" diff --git a/gdb/testsuite/gdb.base/gnu-debugdata.exp b/gdb/testsuite/gdb.base/gnu-debugdata.exp index e959078..2fabd45 100644 --- a/gdb/testsuite/gdb.base/gnu-debugdata.exp +++ b/gdb/testsuite/gdb.base/gnu-debugdata.exp @@ -15,7 +15,7 @@ standard_testfile -if [build_executable ${testfile}.exp $testfile] { +if {[build_executable ${testfile}.exp $testfile]} { return -1 } diff --git a/gdb/testsuite/gdb.base/hbreak-unmapped.exp b/gdb/testsuite/gdb.base/hbreak-unmapped.exp index 80b1247..80c7aa8 100644 --- a/gdb/testsuite/gdb.base/hbreak-unmapped.exp +++ b/gdb/testsuite/gdb.base/hbreak-unmapped.exp @@ -21,7 +21,7 @@ if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile}]} { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/hbreak.exp b/gdb/testsuite/gdb.base/hbreak.exp index dca3bdd..6a9bcbe 100644 --- a/gdb/testsuite/gdb.base/hbreak.exp +++ b/gdb/testsuite/gdb.base/hbreak.exp @@ -21,7 +21,7 @@ if { [prepare_for_testing "failed to prepare" ${test} ${srcfile}] } { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/hbreak2.exp b/gdb/testsuite/gdb.base/hbreak2.exp index 9390e40..65f08e2 100644 --- a/gdb/testsuite/gdb.base/hbreak2.exp +++ b/gdb/testsuite/gdb.base/hbreak2.exp @@ -477,7 +477,7 @@ proc test_next_with_recursion {} { delete_breakpoints - if [istarget "mips*tx39-*"] { + if {[istarget "mips*tx39-*"]} { set timeout 60 } # We used to set timeout here for all other targets as well. This diff --git a/gdb/testsuite/gdb.base/huge.exp b/gdb/testsuite/gdb.base/huge.exp index cb12964..01bc9ea 100644 --- a/gdb/testsuite/gdb.base/huge.exp +++ b/gdb/testsuite/gdb.base/huge.exp @@ -23,14 +23,14 @@ require {!target_info exists gdb,skip_huge_test} standard_testfile .c -set max [expr 2 * 1024 * 1024] +set max [expr {2 * 1024 * 1024}] set min 16 set opts {} lappend opts debug set compilation_succeeded 0 -for { set size $max } { $size >= $min } { set size [expr $size / 2] } { +for { set size $max } { $size >= $min } { set size [expr {$size / 2}] } { set try_opts [concat $opts [list additional_flags=-DCRASH_GDB=$size]] if { [build_executable $testfile.exp $testfile $srcfile $try_opts] == -1 } { continue @@ -39,7 +39,7 @@ for { set size $max } { $size >= $min } { set size [expr $size / 2] } { set compilation_succeeded 1 break } -require {expr $compilation_succeeded} +require {expr {$compilation_succeeded}} # Start with a fresh gdb. clean_restart @@ -84,6 +84,6 @@ save_vars { timeout } { unsupported $test } else { # At 56 passes with and without the fix, so use 55. - gdb_assert {$space_used < [expr 55 * 4 * $size] } $test + gdb_assert {$space_used < [expr {55 * 4 * $size}] } $test } } diff --git a/gdb/testsuite/gdb.base/hw-sw-break-same-address.exp b/gdb/testsuite/gdb.base/hw-sw-break-same-address.exp index 93c8f54..a342104 100644 --- a/gdb/testsuite/gdb.base/hw-sw-break-same-address.exp +++ b/gdb/testsuite/gdb.base/hw-sw-break-same-address.exp @@ -26,7 +26,7 @@ if { [prepare_for_testing "failed to prepare" ${test} ${srcfile}] } { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/included.exp b/gdb/testsuite/gdb.base/included.exp index e5223c9..a125a27 100644 --- a/gdb/testsuite/gdb.base/included.exp +++ b/gdb/testsuite/gdb.base/included.exp @@ -26,7 +26,7 @@ gdb_test_no_output "set listsize 1" gdb_test "list -q main" ".*" get_debug_format -set non_dwarf [expr ! [test_debug_format "DWARF \[0-9\]"]] +set non_dwarf [expr {! [test_debug_format "DWARF \[0-9\]"]}] # We should be able to find the source file containing the definition, # even though it was an included header. diff --git a/gdb/testsuite/gdb.base/index-cache.exp b/gdb/testsuite/gdb.base/index-cache.exp index a1f64b0..c7dbc46 100644 --- a/gdb/testsuite/gdb.base/index-cache.exp +++ b/gdb/testsuite/gdb.base/index-cache.exp @@ -29,8 +29,8 @@ if { [build_executable "failed to prepare" $testfile [list $srcfile $srcfile2] \ # - the binary already has an index section # - we use the -readnow switch set has_index_section [exec_has_index_section $binfile] -set uses_readnow [expr [string first "-readnow" $GDBFLAGS] != -1] -set expecting_index_cache_use [expr !$has_index_section && !$uses_readnow] +set uses_readnow [expr {[string first "-readnow" $GDBFLAGS] != -1}] +set expecting_index_cache_use [expr {!$has_index_section && !$uses_readnow}] # List the files in DIR on the host (where GDB-under-test runs). # Return a list of two elements: diff --git a/gdb/testsuite/gdb.base/infcall-nested-structs.exp.tcl b/gdb/testsuite/gdb.base/infcall-nested-structs.exp.tcl index 6c95934..b633cf2 100644 --- a/gdb/testsuite/gdb.base/infcall-nested-structs.exp.tcl +++ b/gdb/testsuite/gdb.base/infcall-nested-structs.exp.tcl @@ -18,7 +18,7 @@ # Some targets can't call functions, so don't even bother with this # test. -if [target_info exists gdb,cannot_call_functions] { +if {[target_info exists gdb,cannot_call_functions]} { unsupported "this target can not call functions" continue } @@ -28,7 +28,7 @@ set float_types { tf td tld } set complex_types { tfc tdc tldc } set compile_flags {debug} -if [support_complex_tests] { +if {[support_complex_tests]} { lappend compile_flags "additional_flags=-DTEST_COMPLEX" lappend compile_flags "additional_flags=-Wno-psabi" } @@ -164,7 +164,7 @@ foreach ta $int_types { start_gdb_and_run_tests $lang $ta } -if [support_complex_tests] { +if {[support_complex_tests]} { foreach ta $complex_types { start_gdb_and_run_tests $lang $ta } diff --git a/gdb/testsuite/gdb.base/inferior-args.exp b/gdb/testsuite/gdb.base/inferior-args.exp index 6b92c08..6ac25fc 100644 --- a/gdb/testsuite/gdb.base/inferior-args.exp +++ b/gdb/testsuite/gdb.base/inferior-args.exp @@ -17,7 +17,7 @@ # This does not work on boards that don't support inferior arguments. require {!target_info exists noargs} -require {expr [have_startup_shell] != -1} +require {expr {[have_startup_shell] != -1}} standard_testfile .c @@ -127,13 +127,13 @@ proc do_test { method startup_with_shell inferior_args expected_results \ error "invalid method $method" } - set argc [expr [llength $expected_results] + 1] + set argc [expr {[llength $expected_results] + 1}] # Now that we are stopped at main, inspect argc/argv. gdb_test "print argc" " = $argc" gdb_test "print argv\[0\]" " = $hex \"\[^\r\n\]+\"" for { set i 1 } { $i < $argc } { incr i } { - set idx [expr $i - 1] + set idx [expr {$i - 1}] gdb_test "print argv\[$i\]" " = [lindex $expected_results $idx]" } } diff --git a/gdb/testsuite/gdb.base/inferior-died.exp b/gdb/testsuite/gdb.base/inferior-died.exp index 9ba3a4c..83f500b 100644 --- a/gdb/testsuite/gdb.base/inferior-died.exp +++ b/gdb/testsuite/gdb.base/inferior-died.exp @@ -31,7 +31,7 @@ save_vars { GDBFLAGS } { gdb_test_no_output "set detach-on-fork off" -if ![runto_main] { +if {![runto_main]} { return } diff --git a/gdb/testsuite/gdb.base/info-macros.exp b/gdb/testsuite/gdb.base/info-macros.exp index 2dd0fc9..1e10604 100644 --- a/gdb/testsuite/gdb.base/info-macros.exp +++ b/gdb/testsuite/gdb.base/info-macros.exp @@ -22,7 +22,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug macr return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/info-os.exp b/gdb/testsuite/gdb.base/info-os.exp index 20d28db..be7a746 100644 --- a/gdb/testsuite/gdb.base/info-os.exp +++ b/gdb/testsuite/gdb.base/info-os.exp @@ -128,7 +128,7 @@ proc expect_multiline { command expect test } { exp_continue } -re "^$gdb_prompt $" { - if $found { + if {$found} { set ok 1 } # Exit the loop. diff --git a/gdb/testsuite/gdb.base/info-shared.exp b/gdb/testsuite/gdb.base/info-shared.exp index e81b28e..7475749 100644 --- a/gdb/testsuite/gdb.base/info-shared.exp +++ b/gdb/testsuite/gdb.base/info-shared.exp @@ -84,7 +84,7 @@ check_info_shared "info sharedlibrary before running" 0 0 # Start the inferior, and check neither of the libraries are loaded at # the start. -if ![runto_main] { +if {![runto_main]} { return 0 } check_info_shared "info sharedlibrary #1" 0 0 diff --git a/gdb/testsuite/gdb.base/info_sources.exp b/gdb/testsuite/gdb.base/info_sources.exp index d26362d..3340c83 100644 --- a/gdb/testsuite/gdb.base/info_sources.exp +++ b/gdb/testsuite/gdb.base/info_sources.exp @@ -68,7 +68,7 @@ proc test_info_sources {args expect_seen_info_sources \ } } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/info_sources_2.exp b/gdb/testsuite/gdb.base/info_sources_2.exp index 09e9972..aa26140 100644 --- a/gdb/testsuite/gdb.base/info_sources_2.exp +++ b/gdb/testsuite/gdb.base/info_sources_2.exp @@ -40,7 +40,7 @@ gdb_load $binfile set solib_name [gdb_load_shlib $solib_name] -if ![runto foo] { +if {![runto foo]} { untested "failed to run to function foo" return -1 } @@ -148,7 +148,7 @@ proc run_info_sources { extra_args args } { # Make sure we handle the case where there are no source files # associated with a particular objfile. set source_list {} - if [info exists info_sources($objfile)] { + if {[info exists info_sources($objfile)]} { set source_list $info_sources($objfile) } diff --git a/gdb/testsuite/gdb.base/infoline-reloc-main-from-zero.exp b/gdb/testsuite/gdb.base/infoline-reloc-main-from-zero.exp index bc70a5d..90300c8 100644 --- a/gdb/testsuite/gdb.base/infoline-reloc-main-from-zero.exp +++ b/gdb/testsuite/gdb.base/infoline-reloc-main-from-zero.exp @@ -51,6 +51,6 @@ gdb_test "add-symbol-file $binfile 0xffff0000" \ "add symbol table from file \".*\" at.*\\(y or n\\) " "y" # Check if we are able to read offset adjusted line information of main - + gdb_test "info line main" \ "Line.*starts at address 0xffff0000.*and ends at.*" diff --git a/gdb/testsuite/gdb.base/interrupt-daemon.exp b/gdb/testsuite/gdb.base/interrupt-daemon.exp index b909437..aa6b675 100644 --- a/gdb/testsuite/gdb.base/interrupt-daemon.exp +++ b/gdb/testsuite/gdb.base/interrupt-daemon.exp @@ -35,7 +35,7 @@ proc do_test {} { gdb_test "set follow-fork-mode child" ".*" - if ![runto "daemon_main"] { + if {![runto "daemon_main"]} { return } diff --git a/gdb/testsuite/gdb.base/interrupt-noterm.exp b/gdb/testsuite/gdb.base/interrupt-noterm.exp index fc50bd0..c09a84c 100644 --- a/gdb/testsuite/gdb.base/interrupt-noterm.exp +++ b/gdb/testsuite/gdb.base/interrupt-noterm.exp @@ -15,15 +15,15 @@ standard_testfile -if [prepare_for_testing "failed to prepare for testing" \ - ${testfile} ${srcfile} {debug}] { +if {[prepare_for_testing "failed to prepare for testing" \ + ${testfile} ${srcfile} {debug}]} { return -1 } # Pretend there's no terminal. gdb_test_no_output "set interactive-mode off" -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/jit-bfd-name.exp b/gdb/testsuite/gdb.base/jit-bfd-name.exp index 756a38b..723922c 100644 --- a/gdb/testsuite/gdb.base/jit-bfd-name.exp +++ b/gdb/testsuite/gdb.base/jit-bfd-name.exp @@ -54,11 +54,11 @@ if { ![runto_main] } { # Poke desired values directly into inferior instead of using "set # args" because "set args" does not work under gdbserver. -set count [expr [llength $jit_solibs_target] + 1] +set count [expr {[llength $jit_solibs_target] + 1}] gdb_test_no_output "set var argc=$count" "forging argc" gdb_test_no_output "set var argv=fake_argv" "forging argv" for {set i 1} {$i < $count} {incr i} { - set jit_solib_target [lindex $jit_solibs_target [expr $i-1]] + set jit_solib_target [lindex $jit_solibs_target [expr {$i-1}]] gdb_test_no_output "set var argv\[$i\]=\"${jit_solib_target}\"" \ "forging argv\[$i\]" } @@ -124,7 +124,7 @@ set count 0 foreach addr $symfile_addrs len $symfile_lengths { incr count set output [standard_output_file "dump-elf-solib.${count}.so"] - set end [expr $addr + $len] + set end [expr {$addr + $len}] gdb_test_no_output "dump binary memory $output $addr $end" \ "dump jit solib $count" @@ -141,7 +141,7 @@ foreach addr $symfile_addrs len $symfile_lengths { set start [format 0x%x $addr] # Calculate the end address. - set end [format 0x%x [expr $addr + $len]] + set end [format 0x%x [expr {$addr + $len}]] # This is what we expect the address range to look like in the BFD # filename. diff --git a/gdb/testsuite/gdb.base/jit-elf-so.exp b/gdb/testsuite/gdb.base/jit-elf-so.exp index 8f16bdb..a709c0c 100644 --- a/gdb/testsuite/gdb.base/jit-elf-so.exp +++ b/gdb/testsuite/gdb.base/jit-elf-so.exp @@ -102,10 +102,10 @@ proc one_jit_test {solib_binfiles_target match_str} { # Poke desired values directly into inferior instead of using "set args" # because "set args" does not work under gdbserver. - gdb_test_no_output "set var argc=[expr $count + 1]" "forging argc" + gdb_test_no_output "set var argc=[expr {$count + 1}]" "forging argc" gdb_test_no_output "set var argv=fake_argv" "forging argv" for {set i 1} {$i <= $count} {incr i} { - set binfile_target [lindex $solib_binfiles_target [expr $i-1]] + set binfile_target [lindex $solib_binfiles_target [expr {$i-1}]] gdb_test_no_output "set var argv\[$i\]=\"${binfile_target}\"" \ "forging argv\[$i\]" } diff --git a/gdb/testsuite/gdb.base/jit-elf.exp b/gdb/testsuite/gdb.base/jit-elf.exp index 2dc67a5..2ce9c77 100644 --- a/gdb/testsuite/gdb.base/jit-elf.exp +++ b/gdb/testsuite/gdb.base/jit-elf.exp @@ -103,7 +103,7 @@ proc one_jit_test {jit_solibs_target match_str reattach} { gdb_test_no_output "set var argc=$count" "forging argc" gdb_test_no_output "set var argv=fake_argv" "forging argv" for {set i 1} {$i < $count} {incr i} { - set jit_solib_target [lindex $jit_solibs_target [expr $i-1]] + set jit_solib_target [lindex $jit_solibs_target [expr {$i-1}]] gdb_test_no_output "set var argv\[$i\]=\"${jit_solib_target}\"" \ "forging argv\[$i\]" } diff --git a/gdb/testsuite/gdb.base/jit-reader-simple.exp b/gdb/testsuite/gdb.base/jit-reader-simple.exp index f577dba..eebab22 100644 --- a/gdb/testsuite/gdb.base/jit-reader-simple.exp +++ b/gdb/testsuite/gdb.base/jit-reader-simple.exp @@ -126,7 +126,7 @@ proc jit_test_reread {standalone change_addr} { # second, gdb might not reload the executable automatically. sleep 1 - if ${change_addr} { + if {${change_addr}} { set options "additional_flags=-DSPACER" if {$standalone} { gdb_rename_execfile $binfile ${binfile}x @@ -155,7 +155,7 @@ proc jit_test_reread {standalone change_addr} { "maint info breakpoints shows jit breakpoint" } - if ${change_addr} { + if {${change_addr}} { gdb_assert {$addr_before != $addr_after} "address changed" } else { gdb_assert {$addr_before == $addr_after} "address didn't change" @@ -163,7 +163,7 @@ proc jit_test_reread {standalone change_addr} { } foreach standalone {1 0} { - with_test_prefix [expr ($standalone)?"standalone":"shared"] { + with_test_prefix [expr {($standalone)?"standalone":"shared"}] { with_test_prefix "change addr" { jit_test_reread $standalone 1 } diff --git a/gdb/testsuite/gdb.base/kill-after-signal.exp b/gdb/testsuite/gdb.base/kill-after-signal.exp index 9ed67f8..de0093e 100644 --- a/gdb/testsuite/gdb.base/kill-after-signal.exp +++ b/gdb/testsuite/gdb.base/kill-after-signal.exp @@ -19,13 +19,13 @@ require can_single_step_to_signal_handler require {!target_info exists gdb,nosignals} -if [prepare_for_testing "failed to prepare" ${testfile}] { +if {[prepare_for_testing "failed to prepare" ${testfile}]} { return -1 } gdb_test "handle SIGUSR1 stop print pass" "SIGUSR1\[ \t\]+Yes\[ \t\]+Yes\[ \t\]+Yes\[ \t\]+.*" -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/kill-detach-inferiors-cmd.exp b/gdb/testsuite/gdb.base/kill-detach-inferiors-cmd.exp index 57ec330..b97d2c2 100644 --- a/gdb/testsuite/gdb.base/kill-detach-inferiors-cmd.exp +++ b/gdb/testsuite/gdb.base/kill-detach-inferiors-cmd.exp @@ -24,7 +24,7 @@ require allow_multi_inferior_tests standard_testfile set executable $testfile -if [prepare_for_testing "failed to prepare" $executable] { +if {[prepare_for_testing "failed to prepare" $executable]} { return -1 } diff --git a/gdb/testsuite/gdb.base/killed-outside.exp b/gdb/testsuite/gdb.base/killed-outside.exp index 2b367e4..6cdbdb4 100644 --- a/gdb/testsuite/gdb.base/killed-outside.exp +++ b/gdb/testsuite/gdb.base/killed-outside.exp @@ -49,7 +49,7 @@ proc test {cmds_after_kill} { clean_restart gdb_load $binfile - if ![runto done] { + if {![runto done]} { return } diff --git a/gdb/testsuite/gdb.base/langs.exp b/gdb/testsuite/gdb.base/langs.exp index aa8d8e0..ab09d82 100644 --- a/gdb/testsuite/gdb.base/langs.exp +++ b/gdb/testsuite/gdb.base/langs.exp @@ -16,7 +16,7 @@ standard_testfile langs0.c langs1.c langs2.c -if [is_remote host] { +if {[is_remote host]} { remote_download host ${srcdir}/${subdir}/langs1.f remote_download host ${srcdir}/${subdir}/langs2.cxx } @@ -88,7 +88,7 @@ if {[runto csub]} { gdb_test "show language" "currently $lang\".*" \ "show language at main" - if [target_info exists gdb,noresults] { return } + if {[target_info exists gdb,noresults]} { return } gdb_continue_to_end "first session" } @@ -102,7 +102,7 @@ if {[runto csub]} { # Also test warn-language-frame-mismatch. gdb_test_no_output "set warn-language-frame-mismatch off" gdb_test_no_output "set lang minimal" "set lang to minimal" - + gdb_test "print x" " = 5000" "print parameter value" # Ensure this at least does not crash. diff --git a/gdb/testsuite/gdb.base/ldbl_e308.exp b/gdb/testsuite/gdb.base/ldbl_e308.exp index c7b2bcb..cb997cb 100644 --- a/gdb/testsuite/gdb.base/ldbl_e308.exp +++ b/gdb/testsuite/gdb.base/ldbl_e308.exp @@ -19,7 +19,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/limited-length.exp b/gdb/testsuite/gdb.base/limited-length.exp index cd628b4..3b0857d 100644 --- a/gdb/testsuite/gdb.base/limited-length.exp +++ b/gdb/testsuite/gdb.base/limited-length.exp @@ -74,7 +74,7 @@ with_test_prefix "with standard max-value size" { # Set the max-value-size so we can only print 51 elements. set elements 51 set int_size [get_valueof "/d" "sizeof(large_1d_array\[0\])" "*unknown*"] -gdb_test_no_output "set max-value-size [expr $int_size * $elements]" +gdb_test_no_output "set max-value-size [expr {$int_size * $elements}]" with_test_prefix "with reduced max-value size" { gdb_test "print large_1d_array" \ diff --git a/gdb/testsuite/gdb.base/line-symtabs.exp b/gdb/testsuite/gdb.base/line-symtabs.exp index cd3326d..f937b32 100644 --- a/gdb/testsuite/gdb.base/line-symtabs.exp +++ b/gdb/testsuite/gdb.base/line-symtabs.exp @@ -24,7 +24,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/lineinc.exp b/gdb/testsuite/gdb.base/lineinc.exp index 2382fa5..61983cc 100644 --- a/gdb/testsuite/gdb.base/lineinc.exp +++ b/gdb/testsuite/gdb.base/lineinc.exp @@ -21,7 +21,7 @@ # # Compiling lineinc.c with Dwarf 2 macro information will produce # something like this: -# +# # $ gcc -g3 lineinc.c -o lineinc # $ readelf -wml lineinc # ... @@ -33,10 +33,10 @@ # 4 0 0 0 lineinc3.h # ... # Contents of the .debug_macinfo section: -# +# # DW_MACINFO_start_file - lineno: 0 filenum: 1 # DW_MACINFO_define - lineno : 1 macro : __VERSION__ "3.2 20020903 (Red Hat Linux 8.0 3.2-7)" -# DW_MACINFO_define - lineno : 2 macro : __USER_LABEL_PREFIX__ +# DW_MACINFO_define - lineno : 2 macro : __USER_LABEL_PREFIX__ # ... # DW_MACINFO_define - lineno : 1 macro : __i386__ 1 # DW_MACINFO_define - lineno : 1 macro : __tune_i386__ 1 @@ -52,7 +52,7 @@ # DW_MACINFO_define - lineno : 2 macro : FOO 3 # DW_MACINFO_end_file # DW_MACINFO_end_file -# $ +# $ # # Note how the inclusions of lineinc1.h and lineinc2.h are both # attributed to line 10 of lineinc.c, and the #inclusion of lineinc3.h @@ -105,7 +105,7 @@ gdb_test_multiple "break -q main" $test_name { exp_continue } -re "$gdb_prompt" { - } + } timeout { fail "$test_name (timeout)" } diff --git a/gdb/testsuite/gdb.base/list-ambiguous.exp b/gdb/testsuite/gdb.base/list-ambiguous.exp index cc1210e..e3c821d 100644 --- a/gdb/testsuite/gdb.base/list-ambiguous.exp +++ b/gdb/testsuite/gdb.base/list-ambiguous.exp @@ -48,8 +48,8 @@ proc test_list_ambiguous_symbol {symbol_line symbol} { set lineno0 [gdb_get_line_number $symbol_line $srcfile] set lineno1 [gdb_get_line_number $symbol_line $srcfile2] - set lines0_re [line_range_pattern [expr $lineno0 - 5] [expr $lineno0 + 4]] - set lines1_re [line_range_pattern [expr $lineno1 - 5] [expr $lineno1 + 4]] + set lines0_re [line_range_pattern [expr {$lineno0 - 5}] [expr {$lineno0 + 4}]] + set lines1_re [line_range_pattern [expr {$lineno1 - 5}] [expr {$lineno1 + 4}]] set any "\[^\r\n\]*" set h0_re "file: \"${any}list-ambiguous0.c\", line number: $lineno0, symbol: \"$symbol\"" diff --git a/gdb/testsuite/gdb.base/list.exp b/gdb/testsuite/gdb.base/list.exp index bdbb52b..2da2742 100644 --- a/gdb/testsuite/gdb.base/list.exp +++ b/gdb/testsuite/gdb.base/list.exp @@ -44,14 +44,14 @@ proc set_listsize { arg } { global set_listsize_count incr set_listsize_count - if [gdb_test_no_output "set listsize $arg" "setting listsize to $arg #$set_listsize_count"] { + if {[gdb_test_no_output "set listsize $arg" "setting listsize to $arg #$set_listsize_count"]} { return 0 } if { $arg == 0 } { set arg "unlimited" } - if [gdb_test "show listsize" "Number of source lines.* is ${arg}.*" "show listsize $arg #$set_listsize_count"] { + if {[gdb_test "show listsize" "Number of source lines.* is ${arg}.*" "show listsize $arg #$set_listsize_count"]} { return 0 } return 1 @@ -68,21 +68,21 @@ proc test_listsize {} { # Show default size gdb_test "show listsize" "Number of source lines gdb will list by default is 10.*" "show default list size" - + # Show the default lines gdb_test "list" "(1\[ \t\]+#include \"list0.h\".*7\[ \t\]+x = 0;\r\n.*10\[ \t\]+foo .x\[+)\]+;)" "list default lines around main" # Ensure we can limit printouts to one line - if [set_listsize 1] { + if {[set_listsize 1]} { gdb_test "list 1" "1\[ \t\]+#include \"list0.h\"" "list line 1 with listsize 1" gdb_test "list 2" "2\[ \t\]+" "list line 2 with listsize 1" - } + } # Try just two lines - - if [ set_listsize 2 ] { + + if {[ set_listsize 2 ]} { gdb_test "list 1" "1\[ \t\]+#include \"list0.h\"\r\n2\[ \t\]+" "list line 1 with listsize 2" gdb_test "list 2" "1\[ \t\]+#include \"list0.h\"\r\n2\[ \t\]+" "list line 2 with listsize 2" gdb_test "list 3" "2\[ \t\]+\r\n3\[ \t\]+int main \[)(\]+" "list line 3 with listsize 2" @@ -90,7 +90,7 @@ proc test_listsize {} { # Try small listsize > 1 that is an odd number - if [ set_listsize 3 ] { + if {[ set_listsize 3 ]} { gdb_test "list 1" "1\[ \t\]+#include \"list0.h\".*3\[ \t\]+int main \[)(\]+" "list line 1 with listsize 3" gdb_test "list 2" "1\[ \t\]+#include \"list0.h\".*3\[ \t\]+int main \[)(\]+" "list line 2 with listsize 3" gdb_test "list 3" "2\[ \t\]+\r\n3\[ \t\]+int main \[(\]+\[)\]+\r\n4\[ \t\]+\{" "list line 3 with listsize 3" @@ -101,7 +101,7 @@ proc test_listsize {} { if {[set_listsize 4]} { gdb_test "list 1" "1\[ \t\]+#include \"list0.h\".*4\[ \t\]+\{" "list line 1 with listsize 4" gdb_test "list 2" "1\[ \t\]+#include \"list0.h\".*4\[ \t\]+\{" "list line 2 with listsize 4" - + gdb_test "list 3" "1\[ \t\]+#include \"list0.h\".*4\[ \t\]+\{" "list line 3 with listsize 4" gdb_test "list 4" "2\[ \t\]+\r\n.*5\[ \t\]+int x;.*" "list line 4 with listsize 4" } @@ -110,7 +110,7 @@ proc test_listsize {} { if {[set_listsize 100]} { gdb_test "list 1" "1\[ \t\]+#include \"list0.h\".*\r\n${last_line_re}" "list line 1 with listsize 100" - + gdb_test "list 10" "1\[ \t\]+#include \"list0.h\".*\r\n${last_line_re}" "list line 10 with listsize 100" } @@ -182,7 +182,7 @@ proc_with_prefix test_list_forward {} { # Test that repeating the list linenum command doesn't print the same # lines over again. Note that this test makes sure that the argument # linenum is dropped, when we repeat the previous command. 'x/5i $pc' -# works the same way. +# works the same way. proc_with_prefix test_repeat_list_command {} { global last_line_re @@ -227,8 +227,8 @@ proc test_list_range {} { # gdb_test "list -100,-40" "Line number -60 out of range; .*list0.c has 39 lines." "list range; both bounds negative" - set past_end [expr ${last_line} + 10] - set much_past_end [expr ${past_end} + 10] + set past_end [expr {${last_line} + 10}] + set much_past_end [expr {${past_end} + 10}] gdb_test "list 30,${past_end}" "30\[ \t\]+foo \(.*\);.*${last_line_re}" "list range; upper bound past EOF" @@ -323,7 +323,7 @@ proc test_list_filename_and_function {} { # Test some invalid specs # The following test takes the FIXME result on most systems using # DWARF. It fails to notice that main() is not in the file requested. - + setup_xfail "*-*-*" # Does this actually work ANYWHERE? I believe not, as this is an `aspect' of @@ -369,7 +369,7 @@ proc test_forward_reverse_search {} { # Test that GDB won't crash if the line being searched is extremely long. set oldtimeout $timeout - set timeout [expr "$timeout + 300"] + set timeout [expr {$timeout + 300}] verbose "Timeout is now $timeout seconds" 2 gdb_test "search 1234" ".*1234.*" "search extremely long line (> 5000 chars)" set timeout $oldtimeout diff --git a/gdb/testsuite/gdb.base/load-command.exp b/gdb/testsuite/gdb.base/load-command.exp index 1581873..8111404 100644 --- a/gdb/testsuite/gdb.base/load-command.exp +++ b/gdb/testsuite/gdb.base/load-command.exp @@ -17,7 +17,7 @@ standard_testfile -if [gdb_protocol_is_native] { +if {[gdb_protocol_is_native]} { unsupported "the native target does not support the load command" return } @@ -27,11 +27,11 @@ if [gdb_protocol_is_native] { set opts {debug nopie} -if [prepare_for_testing "failed to prepare" $testfile $srcfile $opts] { +if {[prepare_for_testing "failed to prepare" $testfile $srcfile $opts]} { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/logical.exp b/gdb/testsuite/gdb.base/logical.exp index b00d6d5..f924b09 100644 --- a/gdb/testsuite/gdb.base/logical.exp +++ b/gdb/testsuite/gdb.base/logical.exp @@ -49,7 +49,7 @@ proc evaluate { vars ops } { set var [lindex $vars $vari] for {set opi 0} {$opi < [llength $ops]} {incr opi} { set op [lindex [lindex $ops $opi] 0] - set val [lindex [lindex $ops $opi] [expr $vari + 1]] + set val [lindex [lindex $ops $opi] [expr {$vari + 1}]] gdb_test "print $var, $op" " = $val" "evaluate $op; variables $var; expecting $val" } } diff --git a/gdb/testsuite/gdb.base/long-inferior-output.exp b/gdb/testsuite/gdb.base/long-inferior-output.exp index 8ef7c53..90369f8 100644 --- a/gdb/testsuite/gdb.base/long-inferior-output.exp +++ b/gdb/testsuite/gdb.base/long-inferior-output.exp @@ -32,7 +32,7 @@ require {!target_info exists gdb,noinferiorio} standard_testfile -if [prepare_for_testing "failed to prepare" $testfile {} {debug}] { +if {[prepare_for_testing "failed to prepare" $testfile {} {debug}]} { return -1 } diff --git a/gdb/testsuite/gdb.base/long_long.exp b/gdb/testsuite/gdb.base/long_long.exp index 4fbb757..2e2400b 100644 --- a/gdb/testsuite/gdb.base/long_long.exp +++ b/gdb/testsuite/gdb.base/long_long.exp @@ -34,7 +34,7 @@ clean_restart gdb_load $binfile if {![runto known_types]} { - return + return } # Detect the size of the target's basic types. @@ -53,7 +53,7 @@ set sizeof_long_double [get_sizeof "long double" 8] proc pat2 { n pats } { set i 0 while { $n > 1 } { - set n [expr $n / 2] + set n [expr {$n / 2}] incr i } return [lindex $pats $i] diff --git a/gdb/testsuite/gdb.base/macscp.exp b/gdb/testsuite/gdb.base/macscp.exp index 63f1356..c275d74 100644 --- a/gdb/testsuite/gdb.base/macscp.exp +++ b/gdb/testsuite/gdb.base/macscp.exp @@ -44,7 +44,7 @@ gdb_load $binfile # # If GDB complains that it doesn't have any information about # preprocessor macro definitions, return the string `no-macro-info'. -# +# # If expect times out waiting for GDB, we return the string `timeout'. # # If GDB's output doesn't otherwise match what we're expecting, we @@ -208,7 +208,7 @@ if {$macro_support == 0} { unsupported "skipping test because debug information does not include macro information." return 0 } - + list_and_check_macro main WHERE {macscp1.c {before macscp1_3}} list_and_check_macro macscp2_2 WHERE {macscp2.h macscp1.c {before macscp2_2}} list_and_check_macro macscp3_2 WHERE {macscp3.h macscp1.c {before macscp3_2}} @@ -234,10 +234,10 @@ switch -exact -- [info_macro WHERE] { pass "info macro WHERE after `list macscp_4_2_from_macscp2'" } {macscp4.h macscp3.h macscp1.c {before macscp4_2_..., from macscp3.h}} { - setup_kfail "gdb/7660" *-*-* + setup_kfail "gdb/7660" *-*-* fail "info macro WHERE after `list macscp_4_2_from_macscp2' (gdb/7660)" } - timeout { + timeout { fail "info macro WHERE after `list macscp_4_2_from_macscp2' (timeout)" } default { fail "info macro WHERE after `list macscp_4_2_from_macscp2'" } @@ -249,7 +249,7 @@ switch -exact -- [info_macro WHERE] { pass "info macro WHERE after `list macscp_4_2_from_macscp3'" } {macscp4.h macscp2.h macscp1.c {before macscp4_2_..., from macscp2.h}} { - setup_kfail "gdb/7660" *-*-* + setup_kfail "gdb/7660" *-*-* fail "info macro WHERE after `list macscp_4_2_from_macscp3' (gdb/7660)" } timeout { @@ -360,7 +360,7 @@ for {set i 0} {$i < [llength $funcs]} {incr i} { if {[string compare $result $expected] == 0} { pass "info macro WHERE stopped in $func" } elseif {[string compare $result $kfail_expected] == 0} { - setup_kfail "gdb/7660" *-*-* + setup_kfail "gdb/7660" *-*-* fail "info macro WHERE stopped in $func (gdb/7660)" } elseif {[string compare $result timeout] == 0} { fail "info macro WHERE stopped in $func (timeout)" @@ -393,7 +393,7 @@ for {set i 0} {$i < [llength $funcs]} {incr i} { switch -- [lindex $result end] { undefined { pass $test_name } timeout { fail "$test_name (timeout)" } - default { + default { maybe_kfail $func "$test_name" } } @@ -408,7 +408,7 @@ for {set i 0} {$i < [llength $funcs]} {incr i} { switch -- [lindex $result end] { undefined { pass $test_name } timeout { fail "$test_name (timeout)" } - default { + default { maybe_kfail $func "$test_name" } } diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp index 3d49b36..fd366d6 100644 --- a/gdb/testsuite/gdb.base/maint.exp +++ b/gdb/testsuite/gdb.base/maint.exp @@ -179,7 +179,7 @@ if { $index_cache_misses == 0 && $using_index_cache } { set have_gdb_index 1 } -set have_psyms [expr ! ( $have_gdb_index || $readnow_p )] +set have_psyms [expr {! ( $have_gdb_index || $readnow_p )}] # # this command does not produce any output @@ -223,9 +223,9 @@ gdb_test "maint set per-command off" \ # The timeout value is raised, because printing all the symbols and # statistical information about Cygwin and Windows libraries takes a lot # of time. -if [istarget "*-*-cygwin*"] { +if {[istarget "*-*-cygwin*"]} { set oldtimeout $timeout - set timeout [expr $timeout + 500] + set timeout [expr {$timeout + 500}] } set re \ @@ -288,7 +288,7 @@ gdb_test_multiple "$cmd $re" "$cmd" -lbl { } proc maint_pass_if {val name} { - if $val { pass $name } else { fail $name } + if {$val} { pass $name } else { fail $name } } maint_pass_if $header "maint print objfiles: header" @@ -378,7 +378,7 @@ gdb_test_multiple "maint print type argc" $msg { } } -if [istarget "hppa*-*-11*"] { +if {[istarget "hppa*-*-11*"]} { setup_xfail hppa*-*-*11* CLLbs14860 gdb_test_multiple "maint print unwind &main" "maint print unwind" { -re ".*unwind_table_entry \\($hex\\):\r\n\tregion_start = $hex <main>\r\n\tregion_end = $hex <main\\+\[0-9\]*>\r\n\tflags = Args_stored Save_RP\r\n\tRegion_description = $hex\r\n\tEntry_FR = $hex\r\n\tEntry_GR = $hex\r\n\tTotal_frame_size = $hex\r\n$gdb_prompt $" { @@ -391,7 +391,7 @@ if [istarget "hppa*-*-11*"] { } set oldtimeout $timeout -set timeout [expr $timeout + 300] +set timeout [expr {$timeout + 300}] set bp_location6 [gdb_get_line_number "set breakpoint 6 here"] @@ -406,7 +406,7 @@ gdb_test_multiple "maint info breakpoints" "maint info breakpoints" { gdb_test "maint print" \ "List.*unambiguous\\..*" \ - "maint print w/o args" + "maint print w/o args" gdb_test "maint info" \ "List.*unambiguous\\..*" \ @@ -506,7 +506,7 @@ test_prefix_command_help {"maint" "maintenance"} { } #set oldtimeout $timeout -#set timeout [expr $timeout + 300] +#set timeout [expr {$timeout + 300}] gdb_test_multiple "maint dump-me" "maint dump-me" { -re "Should GDB dump core.*\\(y or n\\) $" { @@ -522,7 +522,7 @@ send_gdb "maint internal-error\n" gdb_expect { -re "A problem internal to GDB has been detected" { pass "maint internal-error" - if [gdb_internal_error_resync] { + if {[gdb_internal_error_resync]} { pass "internal-error resync" } else { fail "internal-error resync" diff --git a/gdb/testsuite/gdb.base/memops-watchpoint.exp b/gdb/testsuite/gdb.base/memops-watchpoint.exp index 1a8d6d9..09500b3 100644 --- a/gdb/testsuite/gdb.base/memops-watchpoint.exp +++ b/gdb/testsuite/gdb.base/memops-watchpoint.exp @@ -25,7 +25,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \ } set linespec ${srcfile}:[gdb_get_line_number "Break here"] -if ![runto ${linespec}] { +if {![runto ${linespec}]} { return -1 } diff --git a/gdb/testsuite/gdb.base/memtag.exp b/gdb/testsuite/gdb.base/memtag.exp index 4cd593c..2951c91 100644 --- a/gdb/testsuite/gdb.base/memtag.exp +++ b/gdb/testsuite/gdb.base/memtag.exp @@ -39,7 +39,7 @@ with_test_prefix "before program execution" { clean_restart $testfile -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/miscexprs.exp b/gdb/testsuite/gdb.base/miscexprs.exp index f723d75..9d2d1d2 100644 --- a/gdb/testsuite/gdb.base/miscexprs.exp +++ b/gdb/testsuite/gdb.base/miscexprs.exp @@ -20,14 +20,14 @@ # # tests for expressions with struct/array elements and mixed operator types # with elementary types -# +# # By default, the datastructures are allocated on the stack. For targets # with very small stack, that will not work. In that case, just set # storage to `-DSTORAGE=static' which changes the datastructures to be # allocated in data segment. set storage "-DSTORAGE=" -if [target_info exists gdb,small_stack_section] { +if {[target_info exists gdb,small_stack_section]} { set storage "-DSTORAGE=static" } diff --git a/gdb/testsuite/gdb.base/morestack.exp b/gdb/testsuite/gdb.base/morestack.exp index d8da583..96cc15c 100644 --- a/gdb/testsuite/gdb.base/morestack.exp +++ b/gdb/testsuite/gdb.base/morestack.exp @@ -25,7 +25,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} $srcfile \ return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/moribund-step.exp b/gdb/testsuite/gdb.base/moribund-step.exp index b643f07..d28e33f 100644 --- a/gdb/testsuite/gdb.base/moribund-step.exp +++ b/gdb/testsuite/gdb.base/moribund-step.exp @@ -24,7 +24,7 @@ save_vars { GDBFLAGS } { } } -if ![runto_main] { +if {![runto_main]} { return } diff --git a/gdb/testsuite/gdb.base/msym-bp-shl.exp b/gdb/testsuite/gdb.base/msym-bp-shl.exp index 41dc818..fb0a99d 100644 --- a/gdb/testsuite/gdb.base/msym-bp-shl.exp +++ b/gdb/testsuite/gdb.base/msym-bp-shl.exp @@ -75,7 +75,7 @@ proc test {debug} { } } - if ![runto_main] { + if {![runto_main]} { return } diff --git a/gdb/testsuite/gdb.base/msym-bp.exp b/gdb/testsuite/gdb.base/msym-bp.exp index 62e8ec1..08da72e 100644 --- a/gdb/testsuite/gdb.base/msym-bp.exp +++ b/gdb/testsuite/gdb.base/msym-bp.exp @@ -68,7 +68,7 @@ proc test {debug} { test_break "before run" - if ![runto_main] { + if {![runto_main]} { return } diff --git a/gdb/testsuite/gdb.base/multi-forks.exp b/gdb/testsuite/gdb.base/multi-forks.exp index 5d2d220..73bd1c4 100644 --- a/gdb/testsuite/gdb.base/multi-forks.exp +++ b/gdb/testsuite/gdb.base/multi-forks.exp @@ -151,7 +151,7 @@ gdb_test "show detach-on-fork" "on." "show detach default on" gdb_test_no_output "set detach off" "set detach off" # -# We will now run every fork up to the exit bp, +# We will now run every fork up to the exit bp, # eventually winding up with 16 inferiors. # @@ -180,9 +180,9 @@ gdb_test "inferior 2" " main .*" "restart final" # Now we should examine all the pids. # -# +# # Test detach inferior -# +# # [assumes we're at #1] gdb_test "detach inferior 2" "Detaching .*" "detach 2" @@ -190,7 +190,7 @@ gdb_test "detach inferior 3" "Detaching .*" "detach 3" gdb_test "detach inferior 4" "Detaching .*" "detach 4" gdb_test "detach inferior 5" "Detaching .*" "detach 5" -# +# # Test kill inferior # diff --git a/gdb/testsuite/gdb.base/nested-addr.exp b/gdb/testsuite/gdb.base/nested-addr.exp index c4450f6..8f19017 100644 --- a/gdb/testsuite/gdb.base/nested-addr.exp +++ b/gdb/testsuite/gdb.base/nested-addr.exp @@ -19,7 +19,7 @@ if {[prepare_for_testing "failed to prepare" "${testfile}" "${srcfile}"]} { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/nested-subp1.exp b/gdb/testsuite/gdb.base/nested-subp1.exp index 7ea461a..9d0e873 100644 --- a/gdb/testsuite/gdb.base/nested-subp1.exp +++ b/gdb/testsuite/gdb.base/nested-subp1.exp @@ -24,7 +24,7 @@ standard_testfile set testcase "nested-subp1" -if ![support_nested_function_tests] { +if {![support_nested_function_tests]} { untested "compiler does not support nested functions" return -1 } @@ -40,7 +40,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${testcase}.c" \ # Run until the variables we are interested in are visible. clean_restart "${testcase}" -if ![runto_main] { +if {![runto_main]} { return } diff --git a/gdb/testsuite/gdb.base/nested-subp2.exp b/gdb/testsuite/gdb.base/nested-subp2.exp index d6c67a4..1846685 100644 --- a/gdb/testsuite/gdb.base/nested-subp2.exp +++ b/gdb/testsuite/gdb.base/nested-subp2.exp @@ -24,7 +24,7 @@ standard_testfile set testcase "nested-subp2" -if ![support_nested_function_tests] { +if {![support_nested_function_tests]} { untested "compiler does not support nested functions" return -1 } @@ -49,7 +49,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${testcase}.c" \ # Run until the variables we are interested in are visible. clean_restart "${testcase}" -if ![runto_main] { +if {![runto_main]} { return } diff --git a/gdb/testsuite/gdb.base/nested-subp3.exp b/gdb/testsuite/gdb.base/nested-subp3.exp index f5ea4ce..4099667 100644 --- a/gdb/testsuite/gdb.base/nested-subp3.exp +++ b/gdb/testsuite/gdb.base/nested-subp3.exp @@ -24,7 +24,7 @@ standard_testfile set testcase "nested-subp3" -if ![support_nested_function_tests] { +if {![support_nested_function_tests]} { untested "compiler does not support nested functions" return -1 } @@ -49,7 +49,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${testcase}.c" \ # Run until the variables we are interested in are visible. clean_restart "${testcase}" -if ![runto_main] { +if {![runto_main]} { return } diff --git a/gdb/testsuite/gdb.base/new-ui.exp b/gdb/testsuite/gdb.base/new-ui.exp index f66ddc5..345cd36 100644 --- a/gdb/testsuite/gdb.base/new-ui.exp +++ b/gdb/testsuite/gdb.base/new-ui.exp @@ -81,7 +81,7 @@ proc_with_prefix do_test {} { clean_restart $testfile - if ![runto_main] { + if {![runto_main]} { return -1 } @@ -184,14 +184,14 @@ proc_with_prefix do_test_invalid_args {} { "new-ui with bad interpreter name" # Test that the TUI cannot be used for a new UI. - if [allow_tui_tests] { + if {[allow_tui_tests]} { gdb_test "new-ui tui $extra_tty_name" \ "interpreter 'tui' cannot be used with a new UI" \ "new-ui with tui" } # Test that we can continue working normally. - if ![runto_main] { + if {![runto_main]} { return } } diff --git a/gdb/testsuite/gdb.base/nodebug.exp b/gdb/testsuite/gdb.base/nodebug.exp index b839317..6ed428e 100644 --- a/gdb/testsuite/gdb.base/nodebug.exp +++ b/gdb/testsuite/gdb.base/nodebug.exp @@ -18,9 +18,9 @@ standard_testfile .c -if [test_compiler_info "xlc-*"] { +if {[test_compiler_info "xlc-*"]} { # By default, IBM'x xlc compiler doesn't add static variables into the symtab. - # Use "-qstatsym" to do so. + # Use "-qstatsym" to do so. set exec_opts additional_flags=-qstatsym } else { set exec_opts "" @@ -42,7 +42,7 @@ gdb_load $binfile proc nodebug_runto {func} { with_test_prefix $func { - if ![runto $func] { + if {![runto $func]} { return false } gdb_test_no_output "nosharedlibrary" \ @@ -55,7 +55,7 @@ proc nodebug_runto {func} { # require coercion/promotion, both prototyped and unprototyped, both # return-type-cast style, and function-pointer-cast styles. proc test_call_promotion {} { - if [target_info exists gdb,cannot_call_functions] { + if {[target_info exists gdb,cannot_call_functions]} { return } @@ -86,9 +86,9 @@ proc test_call_promotion {} { } if {[nodebug_runto inner]} { - + # Expect to find global/local symbols in each of text/data/bss. - + # The exact format for some of this output is not necessarily # ideal, particularly interpreting "p top" requires a fair bit of # savvy about gdb's workings and the meaning of the "{}" @@ -100,7 +100,7 @@ if {[nodebug_runto inner]} { # to detect that gdb does not know the type, rather than just # being told they are ints or functions returning int like old # versions of gdb used to do. - + # On alpha (and other ecoff systems) the native compilers put # out debugging info for non-aggregate return values of functions # even without -g, which should be accepted. @@ -220,7 +220,7 @@ if {[nodebug_runto inner]} { # Check that pointer arithmetic works as expected. set addr1 [get_hexadecimal_valueof "&dataglobal" "*UNKNOWN*"] set addr2 [get_hexadecimal_valueof "(int *) &dataglobal + 1" "*UNKNOWN*"] - set offset [expr $addr2 - $addr1] + set offset [expr {$addr2 - $addr1}] set int_size [get_integer_valueof "sizeof (int)" "*UNKNOWN*"] gdb_assert { $offset == $int_size } @@ -271,14 +271,14 @@ if {[nodebug_runto inner]} { # ever, why bother with a weaker test? #gdb_test "backtrace 10" "#0.*inner.*#1.*#2.*top.*#3.*main.*" \ # "backtrace from inner for externals" - + # This test is not as obscure as it might look. `p getenv ("TERM")' # is a real-world example, at least on many systems. foreach cmd {"p/c" "ptype" "whatis"} { gdb_test "$cmd array_index(\"abcdef\",2)" \ "'array_index' has unknown return type; cast the call to its declared return type" } - if [target_info exists gdb,cannot_call_functions] { + if {[target_info exists gdb,cannot_call_functions]} { unsupported "p/c (int) array_index(\"abcdef\",2)" } else { # We need to up this because this can be really slow on some boards. diff --git a/gdb/testsuite/gdb.base/noreturn-finish.exp b/gdb/testsuite/gdb.base/noreturn-finish.exp index 43b2353..2da0a40 100644 --- a/gdb/testsuite/gdb.base/noreturn-finish.exp +++ b/gdb/testsuite/gdb.base/noreturn-finish.exp @@ -15,7 +15,7 @@ standard_testfile -if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug}] { +if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug}]} { return -1 } diff --git a/gdb/testsuite/gdb.base/noreturn-return.exp b/gdb/testsuite/gdb.base/noreturn-return.exp index e653749..e6f8117 100644 --- a/gdb/testsuite/gdb.base/noreturn-return.exp +++ b/gdb/testsuite/gdb.base/noreturn-return.exp @@ -15,7 +15,7 @@ standard_testfile -if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug}] { +if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug}]} { return -1 } diff --git a/gdb/testsuite/gdb.base/nostdlib.exp b/gdb/testsuite/gdb.base/nostdlib.exp index 8dcefcf..826fbd9 100644 --- a/gdb/testsuite/gdb.base/nostdlib.exp +++ b/gdb/testsuite/gdb.base/nostdlib.exp @@ -34,13 +34,15 @@ foreach_with_prefix pie { "nopie" "pie" } { set binfile [standard_output_file $testfile-$pie] set board [target_info name] - if [board_info $board exists mathlib] { + if {[board_info $board exists mathlib]} { set mathlib [board_info $dest mathlib] set_board_info mathlib "" + # tclint-disable-next-line command-args set err [eval $compile] set_board_info mathlib $mathlib } else { set_board_info mathlib "" + # tclint-disable-next-line command-args set err [eval $compile] unset_board_info mathlib } diff --git a/gdb/testsuite/gdb.base/offsets.exp b/gdb/testsuite/gdb.base/offsets.exp index 548f2a4..3193ed9 100644 --- a/gdb/testsuite/gdb.base/offsets.exp +++ b/gdb/testsuite/gdb.base/offsets.exp @@ -35,7 +35,7 @@ gdb_test_multiple "print &big_struct.second" "$test" { -re "\\$\[0-9\]* = .* (0x\[0-9a-fA-F\]*) .*\[\r\n\]*$gdb_prompt $" { set addr2 $expect_out(1,string) - if {[expr $addr2 - $addr1] == [expr 0x10000000 + 16]} { + if {[expr {$addr2 - $addr1}] == [expr {0x10000000 + 16}]} { pass "big offsets" } else { fail "big offsets" diff --git a/gdb/testsuite/gdb.base/opaque.exp b/gdb/testsuite/gdb.base/opaque.exp index 9a5364a..c010fb8 100644 --- a/gdb/testsuite/gdb.base/opaque.exp +++ b/gdb/testsuite/gdb.base/opaque.exp @@ -110,7 +110,7 @@ gdb_reinitialize_dir $srcdir/$subdir gdb_load ${binfile} # Run to main, where struct foo is incomplete. -if ![runto_main] { +if {![runto_main]} { return } @@ -160,7 +160,7 @@ gdb_reinitialize_dir $srcdir/$subdir gdb_load ${binfile} # Run to getfoo, where struct foo is complete. -if ![runto getfoo] { +if {![runto getfoo]} { perror "cannot run to breakpoint at getfoo" } diff --git a/gdb/testsuite/gdb.base/options.exp b/gdb/testsuite/gdb.base/options.exp index 8ac9f4e..067f55e 100644 --- a/gdb/testsuite/gdb.base/options.exp +++ b/gdb/testsuite/gdb.base/options.exp @@ -208,7 +208,7 @@ proc_with_prefix test-print {{prefix ""}} { clean_restart gdb_load $binfile - if ![runto_main] { + if {![runto_main]} { return } @@ -321,7 +321,7 @@ proc_with_prefix test-backtrace {} { clean_restart gdb_load $binfile - if ![runto_main] { + if {![runto_main]} { return } @@ -1163,7 +1163,7 @@ foreach prefix { # Same for "compile print". Not really a wrapper prefix command like # "frame apply", but similar enough that we test pretty much the same # things. -if ![skip_compile_feature_tests] { +if {![skip_compile_feature_tests]} { test-print "compile " } diff --git a/gdb/testsuite/gdb.base/overlays.exp b/gdb/testsuite/gdb.base/overlays.exp index 0aa94f9..8e7e0c0 100644 --- a/gdb/testsuite/gdb.base/overlays.exp +++ b/gdb/testsuite/gdb.base/overlays.exp @@ -1,5 +1,5 @@ # Copyright 1997-2025 Free Software Foundation, Inc. -# +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or @@ -64,7 +64,7 @@ proc get_func_address { func func_sym msg } { global hexx set func_addr 0 - send_gdb "print $func\n" + send_gdb "print $func\n" gdb_expect { -re "\\$\[0-9\]+ = $fptrcast (${hexx}) <$func_sym>.*$gdb_prompt $" { set func_addr $expect_out(1,string) @@ -99,39 +99,39 @@ if {$data_overlays} { # map each overlay successively, and # capture the VMA addresses of [foo bar baz grbx foox barx bazx grbxx] -gdb_test "overlay map .ovly0" "" +gdb_test "overlay map .ovly0" "" gdb_test "overlay list" "Section .ovly0, loaded at.*, mapped at.*" "list ovly0" set foo_vma [get_func_address "foo" "foo" "foo runtime address"] -gdb_test "overlay map .ovly1" "" +gdb_test "overlay map .ovly1" "" gdb_test "overlay list" "Section .ovly1, loaded at.*, mapped at.*" "list ovly1" set bar_vma [get_func_address "bar" "bar" "bar runtime address"] -gdb_test "overlay map .ovly2" "" +gdb_test "overlay map .ovly2" "" gdb_test "overlay list" "Section .ovly2, loaded at.*, mapped at.*" "list ovly2" set baz_vma [get_func_address "baz" "baz" "baz runtime address"] -gdb_test "overlay map .ovly3" "" +gdb_test "overlay map .ovly3" "" gdb_test "overlay list" "Section .ovly3, loaded at.*, mapped at.*" "list ovly3" set grbx_vma [get_func_address "grbx" "grbx" "grbx runtime address"] if {$data_overlays} { - gdb_test "overlay map .data00" "" + gdb_test "overlay map .data00" "" gdb_test "overlay list" "Section .data00, loaded .*, mapped .*" "list data00" gdb_test "print \$foox_vma = &foox" \ ".* $iptrcast 0x.*" "foox runtime addr" - gdb_test "overlay map .data01" "" + gdb_test "overlay map .data01" "" gdb_test "overlay list" "Section .data01, loaded .*, mapped .*" "list data01" gdb_test "print \$barx_vma = &barx" \ ".* $iptrcast 0x.*" "barx runtime addr" - gdb_test "overlay map .data02" "" + gdb_test "overlay map .data02" "" gdb_test "overlay list" "Section .data02, loaded .*, mapped .*" "list data02" gdb_test "print \$bazx_vma = &bazx" \ ".* $iptrcast 0x.*" "bazx runtime addr" - gdb_test "overlay map .data03" "" + gdb_test "overlay map .data03" "" gdb_test "overlay list" "Section .data03, loaded .*, mapped .*" "list data03" gdb_test "print \$grbxx_vma = &grbxx" \ ".* $iptrcast 0x.*" "grbxx runtime addr" @@ -149,7 +149,7 @@ if {$data_overlays} { gdb_test "print \$grbxx_lma != \$grbxx_vma" ".* = 1" "grbxx's LMA != VMA" } -# Verify that early-mapped overlays have been bumped out +# Verify that early-mapped overlays have been bumped out # by later-mapped overlays laid over in the same VMA range. send_gdb "overlay list\n" diff --git a/gdb/testsuite/gdb.base/paginate-execution-startup.exp b/gdb/testsuite/gdb.base/paginate-execution-startup.exp index 430bda3..8f971c8 100644 --- a/gdb/testsuite/gdb.base/paginate-execution-startup.exp +++ b/gdb/testsuite/gdb.base/paginate-execution-startup.exp @@ -23,7 +23,7 @@ if {[build_executable "failed to prepare" $testfile $srcfile debug] == -1} { } set file_arg $binfile -if [is_remote host] { +if {[is_remote host]} { set file_arg [remote_download host $file_arg] } @@ -176,7 +176,7 @@ save_vars { INTERNAL_GDBFLAGS } { if {[probe_can_run_cmdline] > 0} { test_fg_execution_pagination_return - if ![target_info exists gdb,nointerrupts] { + if {![target_info exists gdb,nointerrupts]} { test_fg_execution_pagination_cancel "ctrl-c" } test_fg_execution_pagination_cancel "quit" diff --git a/gdb/testsuite/gdb.base/parse_number.exp b/gdb/testsuite/gdb.base/parse_number.exp index 14ccd8e..7f6e37f 100644 --- a/gdb/testsuite/gdb.base/parse_number.exp +++ b/gdb/testsuite/gdb.base/parse_number.exp @@ -48,21 +48,21 @@ proc fits_in_type { n type_bits type_signedness } { if { $n < 0} { set n_sign -1 - set n [expr -$n] + set n [expr {-$n}] } else { set n_sign 1 } - set smax [expr 1 << ($type_bits - 1)]; + set smax [expr {1 << ($type_bits - 1)}]; if { $n_sign == -1 } { # Negative number, signed type. - return [expr ($n <= $smax)] + return [expr {($n <= $smax)}] } elseif { $n_sign == 1 && $type_signed_p } { # Positive number, signed type. - return [expr ($n < $smax)] + return [expr {($n < $smax)}] } elseif { $n_sign == 1 && !$type_signed_p } { # Positive number, unsigned type. - return [expr ($n >> $type_bits) == 0] + return [expr {($n >> $type_bits) == 0}] } else { error "unreachable" } @@ -99,9 +99,9 @@ proc parse_number { lang n } { } global sizeof_long_long sizeof_long sizeof_int - set long_long_bits [expr $sizeof_long_long * 8] - set long_bits [expr $sizeof_long * 8] - set int_bits [expr $sizeof_int * 8] + set long_long_bits [expr {$sizeof_long_long * 8}] + set long_bits [expr {$sizeof_long * 8}] + set int_bits [expr {$sizeof_int * 8}] if { $lang == "rust" } { if { [fits_in_type $n 32 s] } { @@ -303,7 +303,7 @@ proc test_parse_numbers {arch} { foreach_with_prefix prefix $prefixes { foreach baseval $basevals { foreach offset { -2 -1 0 1 2 } { - set dec_val [expr $baseval + $offset] + set dec_val [expr {$baseval + $offset}] set hex_val [format "0x%llx" $dec_val] if { $dec_val < 0 } { continue diff --git a/gdb/testsuite/gdb.base/pending.exp b/gdb/testsuite/gdb.base/pending.exp index 150adbe..fc1820a 100644 --- a/gdb/testsuite/gdb.base/pending.exp +++ b/gdb/testsuite/gdb.base/pending.exp @@ -103,8 +103,8 @@ gdb_test "info break" \ "pending plus real breakpoint info" -# -# Test not setting a pending breakpoint +# +# Test not setting a pending breakpoint # gdb_test "break pendfunc2" \ "" \ @@ -113,7 +113,7 @@ gdb_test "break pendfunc2" \ "n" # -# Add condition to pending breakpoint +# Add condition to pending breakpoint # gdb_test_no_output "condition 1 k == 1" diff --git a/gdb/testsuite/gdb.base/pie-execl.exp b/gdb/testsuite/gdb.base/pie-execl.exp index d26aa62..0400a99 100644 --- a/gdb/testsuite/gdb.base/pie-execl.exp +++ b/gdb/testsuite/gdb.base/pie-execl.exp @@ -49,7 +49,7 @@ clean_restart ${executable1} gdb_test_no_output "set args ${binfile2}" "set args ${binfile2_test_msg}" -if ![runto_main] { +if {![runto_main]} { return -1 } @@ -113,7 +113,7 @@ verbose -log "addr2 is $addr2" # Ensure we cannot get a false PASS and the inferior has really changed. set test "pie_execl_marker address has changed" -if [string equal $addr1 $addr2] { +if {[string equal $addr1 $addr2]} { fail $test } else { pass $test diff --git a/gdb/testsuite/gdb.base/pie-fork.exp b/gdb/testsuite/gdb.base/pie-fork.exp index 9d232c8..fcc6ad4 100644 --- a/gdb/testsuite/gdb.base/pie-fork.exp +++ b/gdb/testsuite/gdb.base/pie-fork.exp @@ -22,7 +22,7 @@ standard_testfile set opts [list debug pie] -if [build_executable "failed to prepare" $testfile $srcfile $opts] { +if {[build_executable "failed to prepare" $testfile $srcfile $opts]} { return } @@ -32,7 +32,7 @@ proc setup_test {detach_on_fork {follow_fork_mode "parent"}} { clean_restart gdb_load $binfile - if ![runto_main] { + if {![runto_main]} { return } diff --git a/gdb/testsuite/gdb.base/pointers.exp b/gdb/testsuite/gdb.base/pointers.exp index 4d4d58e..9895a2f 100644 --- a/gdb/testsuite/gdb.base/pointers.exp +++ b/gdb/testsuite/gdb.base/pointers.exp @@ -19,7 +19,7 @@ # # tests for pointer arithmetic and pointer dereferencing # with integer type variables and pointers to integers -# +# # # test running programs @@ -65,7 +65,7 @@ gdb_test "next " "more_code.*;" "continuing after dummy()" # pass "illegal pointer assignment rejected" # } # -re ".*$gdb_prompt $" { fail "illegal pointer assignment rejected" } -# timeout { fail "(timeout) illegal pointer assignment rejected" } +# timeout { fail "(timeout) illegal pointer assignment rejected" } # } @@ -75,7 +75,7 @@ gdb_test "next " "more_code.*;" "continuing after dummy()" # pass "illegal pointer assignment rejected" # } # -re ".*$gdb_prompt $" { fail "illegal pointer assignment rejected" } -# timeout { fail "(timeout) ilegal pointer assignment rejected" } +# timeout { fail "(timeout) ilegal pointer assignment rejected" } # } #send_gdb "print v_unsigned_int_pointer == v_double_pointer\n" @@ -84,7 +84,7 @@ gdb_test "next " "more_code.*;" "continuing after dummy()" # pass "illegal pointer operation (+) rejected" # } # -re ".*$gdb_prompt $" { fail "illegal pointer operation (+) rejected" } -# timeout { fail "(timeout) illegal pointer operation (+) rejected" } +# timeout { fail "(timeout) illegal pointer operation (+) rejected" } # } @@ -94,7 +94,7 @@ gdb_test "next " "more_code.*;" "continuing after dummy()" # pass "illegal pointer operation (*) rejected" # } # -re ".*$gdb_prompt $" { fail "illegal pointer operation (*) rejected" } -# timeout { fail "(timeout) illegal pointer operation (*) rejected" } +# timeout { fail "(timeout) illegal pointer operation (*) rejected" } # } @@ -104,7 +104,7 @@ gdb_test "next " "more_code.*;" "continuing after dummy()" # pass "ilegal pointer assignment rejected" # } # -re ".*$gdb_prompt $" { fail "illegal pointer assignment rejected" } -# timeout { fail "(timeout) illegal pointer assignment rejected" } +# timeout { fail "(timeout) illegal pointer assignment rejected" } # } @@ -114,7 +114,7 @@ gdb_test "next " "more_code.*;" "continuing after dummy()" # pass "illegal pointer assignment rejected" # } # -re ".*$gdb_prompt $" { fail "illegal pointer assignment rejected" } -# timeout { fail "(timeout) illegal pointer assignment rejected" } +# timeout { fail "(timeout) illegal pointer assignment rejected" } # } gdb_test_no_output "set variable v_int_pointer=&v_int_array\[0\]" \ @@ -203,9 +203,9 @@ gdb_test "print *( *(matrix+1) +2)" " = 5" \ gdb_test "print **ptr_to_ptr_to_float" " = 100" \ "print through ptr to ptr" -# tests for pointers +# tests for pointers # with elementary type variables and pointers. -# +# gdb_test "break marker1" ".*" "" gdb_test "cont" "Break.* marker1 \\(\\) at .*:$decimal.*" \ @@ -221,7 +221,7 @@ gdb_test "print *pS" " = -14" "print value of *pS" gdb_test_multiple "ptype pS" "ptype pS" { -re "type = short \\*.*$gdb_prompt $" { pass "ptype pS" } -re "type = short int \\*.*$gdb_prompt $" { pass "ptype pS" } -} +} gdb_test "print *pUS" " = 7" "print value of *pUS" diff --git a/gdb/testsuite/gdb.base/pr10179.exp b/gdb/testsuite/gdb.base/pr10179.exp index dfb8f9b..a6d8a83 100644 --- a/gdb/testsuite/gdb.base/pr10179.exp +++ b/gdb/testsuite/gdb.base/pr10179.exp @@ -22,7 +22,7 @@ if {[build_executable ${testname}.exp $testname $sources {debug}] == -1} { clean_restart ${testname} -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/prelink.exp b/gdb/testsuite/gdb.base/prelink.exp index 5dd4cdc..73380bb 100644 --- a/gdb/testsuite/gdb.base/prelink.exp +++ b/gdb/testsuite/gdb.base/prelink.exp @@ -43,13 +43,13 @@ if {$prelink_args == ""} { } set test "split debug of executable" -if [gdb_gnu_strip_debug $binfile] { +if {[gdb_gnu_strip_debug $binfile]} { fail $test } else { pass $test } -if ![prelink_yes $prelink_args] { +if {![prelink_yes $prelink_args]} { # Maybe we don't have prelink. return -1 } @@ -57,10 +57,10 @@ if ![prelink_yes $prelink_args] { set found 0 set coredir "[standard_output_file coredir.[getpid]]" file mkdir $coredir -catch "system \"(cd ${coredir}; ulimit -c unlimited; ${binfile}; true) >/dev/null 2>&1\"" +catch {system "(cd ${coredir}; ulimit -c unlimited; ${binfile}; true) >/dev/null 2>&1"} foreach i "${coredir}/core ${coredir}/core.coremaker.c ${binfile}.core" { - if [remote_file build exists $i] { + if {[remote_file build exists $i]} { remote_exec build "mv $i [standard_output_file prelink.core]" set found 1 } @@ -85,7 +85,7 @@ if { $found == 0 } { } # Relink $libfile to a different address. -if ![prelink_yes $prelink_args] { +if {![prelink_yes $prelink_args]} { return -1 } diff --git a/gdb/testsuite/gdb.base/pretty-array.exp b/gdb/testsuite/gdb.base/pretty-array.exp index e512d19..1e93ea7 100644 --- a/gdb/testsuite/gdb.base/pretty-array.exp +++ b/gdb/testsuite/gdb.base/pretty-array.exp @@ -22,7 +22,7 @@ if {[prepare_for_testing $testfile.exp $testfile $srcfile debug]} { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/pretty-print.exp b/gdb/testsuite/gdb.base/pretty-print.exp index 8b60d13..8533481 100644 --- a/gdb/testsuite/gdb.base/pretty-print.exp +++ b/gdb/testsuite/gdb.base/pretty-print.exp @@ -22,7 +22,7 @@ if {[prepare_for_testing $testfile.exp $testfile $srcfile debug]} { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/print-file-var.exp b/gdb/testsuite/gdb.base/print-file-var.exp index a9d3064..d4866ad 100644 --- a/gdb/testsuite/gdb.base/print-file-var.exp +++ b/gdb/testsuite/gdb.base/print-file-var.exp @@ -81,7 +81,7 @@ proc test {hidden dlopen version_id_main lang} { gdb_load_shlib $libobj1 gdb_locate_shlib $libobj2 - if ![runto_main] { + if {![runto_main]} { return -1 } @@ -129,7 +129,7 @@ proc test {hidden dlopen version_id_main lang} { } } - if $version_id_main { + if {$version_id_main} { compare "'print-file-var-main.c'::this_version_id" "vm" compare "this_version_id" "vm" } diff --git a/gdb/testsuite/gdb.base/print-internal-string.exp b/gdb/testsuite/gdb.base/print-internal-string.exp index 156fb80..ddfaaef 100644 --- a/gdb/testsuite/gdb.base/print-internal-string.exp +++ b/gdb/testsuite/gdb.base/print-internal-string.exp @@ -27,7 +27,7 @@ if {![runto_main]} { return 0 } -if [allow_python_tests] { +if {[allow_python_tests]} { # The $_as_string convenience function is implemented in Python. gdb_test {printf "%s\n", $_as_string("aabbcc")} "\"aabbcc\"" diff --git a/gdb/testsuite/gdb.base/print-symbol-loading.exp b/gdb/testsuite/gdb.base/print-symbol-loading.exp index 91e818b..695a3d2 100644 --- a/gdb/testsuite/gdb.base/print-symbol-loading.exp +++ b/gdb/testsuite/gdb.base/print-symbol-loading.exp @@ -39,7 +39,7 @@ clean_restart gdb_load $binfile gdb_load_shlib ${binfile_lib} -if ![runto lib] { +if {![runto lib]} { return -1 } @@ -97,7 +97,7 @@ proc test_load_shlib { print_symbol_loading } { with_test_prefix "shlib ${print_symbol_loading}" { clean_restart gdb_load $binfile - if ![runto_main] { + if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/printcmds.exp b/gdb/testsuite/gdb.base/printcmds.exp index 8634668..0165791 100644 --- a/gdb/testsuite/gdb.base/printcmds.exp +++ b/gdb/testsuite/gdb.base/printcmds.exp @@ -96,18 +96,18 @@ proc test_integer_literals_rejected {} { # Test various octal values. - test_print_reject "p 09" - test_print_reject "p 079" + test_print_reject "p 09" + test_print_reject "p 079" # Test various hexadecimal values. - test_print_reject "p 0xG" - test_print_reject "p 0xAG" + test_print_reject "p 0xG" + test_print_reject "p 0xAG" # Test various binary values. - test_print_reject "p 0b2" - test_print_reject "p 0b12" + test_print_reject "p 0b2" + test_print_reject "p 0b12" } proc test_float_accepted {} { @@ -458,14 +458,14 @@ proc test_print_repeats_10_one { setting } { for { set x 1 } { $x <= 16 } { incr x } { gdb_test_no_output "set print $setting $x" "$setting $x repeats" for { set e 1 } { $e <= 16 } {incr e } { - set v [expr $e - 1] + set v [expr {$e - 1}] set command "p &ctable2\[${v}*16\]" if { $x < $e } { set aval $x } else { set aval $e } - set xval [expr $x - $e] + set xval [expr {$x - $e}] if { $xval < 0 } { set xval 0 } @@ -703,7 +703,7 @@ proc test_artificial_arrays {} { # for the test because that character isn't recognized as an # escape character. set ctrlv "\026" - if [ishost *-*-mingw*] { + if {[ishost *-*-mingw*]} { set ctrlv "" } gdb_test_escape_braces "p int1dim\[0\]${ctrlv}@2" " = {0, 1}" {p int1dim[0]@2} @@ -797,7 +797,7 @@ proc test_print_string_constants {} { gdb_test_no_output "set print elements 50" - if [target_info exists gdb,cannot_call_functions] { + if {[target_info exists gdb,cannot_call_functions]} { unsupported "this target can not call functions" return } @@ -821,7 +821,7 @@ proc test_print_string_constants {} { proc test_print_array_constants {} { global hex - if [target_info exists gdb,cannot_call_functions] { + if {[target_info exists gdb,cannot_call_functions]} { unsupported "this target can not call functions" return } @@ -1028,7 +1028,7 @@ proc test_print_symbol {} { gdb_test_no_output "set print symbol off" } -# Escape a left curly brace to prevent it from being interpreted as +# Escape a left curly brace to prevent it from being interpreted as # the beginning of a bound proc gdb_test_escape_braces { args } { diff --git a/gdb/testsuite/gdb.base/ptr-typedef.exp b/gdb/testsuite/gdb.base/ptr-typedef.exp index 8bffb26..f7bdf08 100644 --- a/gdb/testsuite/gdb.base/ptr-typedef.exp +++ b/gdb/testsuite/gdb.base/ptr-typedef.exp @@ -25,7 +25,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb clean_restart gdb_load $binfile -if ![runto marker1] { +if {![runto marker1]} { untested "couldn't run to marker1" } diff --git a/gdb/testsuite/gdb.base/ptype.exp b/gdb/testsuite/gdb.base/ptype.exp index 04d2d2b..25dd4c9 100644 --- a/gdb/testsuite/gdb.base/ptype.exp +++ b/gdb/testsuite/gdb.base/ptype.exp @@ -51,7 +51,7 @@ gdb_test_multiple "ptype red1" "ptype unnamed enumeration member" { # Here and elsewhere, we accept # "long", "long int", or "int" for long variables (whatis.exp already # has an XFAIL for "int" (Sun cc bug), so no need to fail it here). -gdb_test "ptype struct t_struct" "type = struct t_struct \{.*\[\r\n\] (unsigned |)char v_char_member;.*\[\r\n\] (short|short int) v_short_member;.*\[\r\n\] int v_int_member;.*\[\r\n\] (long|long int|int) v_long_member;.*\[\r\n\] float v_float_member;.*\[\r\n\] double v_double_member;.*\[\r\n\]\}.*" "ptype structure" +gdb_test "ptype struct t_struct" "type = struct t_struct \{.*\[\r\n\] (unsigned |)char v_char_member;.*\[\r\n\] (short|short int) v_short_member;.*\[\r\n\] int v_int_member;.*\[\r\n\] (long|long int|int) v_long_member;.*\[\r\n\] float v_float_member;.*\[\r\n\] double v_double_member;.*\[\r\n\]\}.*" "ptype structure" # Test the equivalence between '.' and '->' for struct member references. @@ -73,30 +73,30 @@ if {[gdb_test "ptype v_t_struct_p->v_float_member" "type = float"] < 0} { # IBM's xlc puts out bogus stabs--the stuff field is type 42, # which isn't defined. -gdb_test "ptype struct link" "type = struct link \{\[\r\n\]+\[ \t\]+struct link \\*next;\[\r\n\]+\[ \t\]+struct link \\*\\(\\*linkfunc\\)\\((struct link \\*, int|void|)\\);\[\r\n\]+\[ \t\]+struct t_struct stuff.1..2..3.;\[\r\n\]+\}.*" "ptype linked list structure" +gdb_test "ptype struct link" "type = struct link \{\[\r\n\]+\[ \t\]+struct link \\*next;\[\r\n\]+\[ \t\]+struct link \\*\\(\\*linkfunc\\)\\((struct link \\*, int|void|)\\);\[\r\n\]+\[ \t\]+struct t_struct stuff.1..2..3.;\[\r\n\]+\}.*" "ptype linked list structure" # # test ptype command with unions # -gdb_test "ptype union t_union" "type = union t_union \{.*\[\r\n\] (unsigned |)char v_char_member;.*\[\r\n\] (short|short int) v_short_member;.*\[\r\n\] int v_int_member;.*\[\r\n\] (long|long int|int) v_long_member;.*\[\r\n\] float v_float_member;.*\[\r\n\] double v_double_member;.*\[\r\n\]\}.*" "ptype union" +gdb_test "ptype union t_union" "type = union t_union \{.*\[\r\n\] (unsigned |)char v_char_member;.*\[\r\n\] (short|short int) v_short_member;.*\[\r\n\] int v_int_member;.*\[\r\n\] (long|long int|int) v_long_member;.*\[\r\n\] float v_float_member;.*\[\r\n\] double v_double_member;.*\[\r\n\]\}.*" "ptype union" # IBM's xlc puts out bogus stabs--the stuff field is type 42, # which isn't defined. -gdb_test "ptype union tu_link" "type = union tu_link \{\[\r\n\]+\[ \t\]+struct link \\*next;\[\r\n\]+\[ \t\]+struct link \\*\\(\\*linkfunc\\)\\((struct link \\*, int|void|)\\);\[\r\n\]+\[ \t\]+struct t_struct stuff.1..2..3.;\[\r\n\]+\}.*" "ptype linked list union" +gdb_test "ptype union tu_link" "type = union tu_link \{\[\r\n\]+\[ \t\]+struct link \\*next;\[\r\n\]+\[ \t\]+struct link \\*\\(\\*linkfunc\\)\\((struct link \\*, int|void|)\\);\[\r\n\]+\[ \t\]+struct t_struct stuff.1..2..3.;\[\r\n\]+\}.*" "ptype linked list union" # # test ptype command with enums # -gdb_test "ptype primary" "type = enum .red, green, blue.*" "ptype unnamed enumeration" +gdb_test "ptype primary" "type = enum .red, green, blue.*" "ptype unnamed enumeration" -gdb_test "ptype enum colors" "type = enum colors \{yellow, purple, pink\}.*" "ptype named enumeration" +gdb_test "ptype enum colors" "type = enum colors \{yellow, purple, pink\}.*" "ptype named enumeration" # # test ptype command with enums as typedef # -gdb_test "ptype boolean" "type = enum (boolean |)\{FALSE, TRUE\}.*" "ptype unnamed typedef'd enumeration" +gdb_test "ptype boolean" "type = enum (boolean |)\{FALSE, TRUE\}.*" "ptype unnamed typedef'd enumeration" # And check that whatis shows the name, not "enum {...}". # This probably fails for all DWARF 1 cases, so assume so for now. -fnf @@ -132,20 +132,20 @@ gdb_test "ptype enum bvals" "type = enum bvals \{my_false, my_true\}.*" "ptype n # # test ptype command with out-of-order enum values # -gdb_test "ptype enum misordered" "type = enum misordered \{two = 2, one = 1, zero = 0, three = 3\}.*" "ptype misordered enumeration" +gdb_test "ptype enum misordered" "type = enum misordered \{two = 2, one = 1, zero = 0, three = 3\}.*" "ptype misordered enumeration" # # test ptype command with a named enum's value # -gdb_test "ptype three" "type = enum misordered \{two = 2, one = 1, zero = 0, three = 3\}.*" "ptype named enumeration member" +gdb_test "ptype three" "type = enum misordered \{two = 2, one = 1, zero = 0, three = 3\}.*" "ptype named enumeration member" -gdb_test "ptype red" "type = enum \{red, green, blue\}.*" "ptype unnamed enumeration member #2" +gdb_test "ptype red" "type = enum \{red, green, blue\}.*" "ptype unnamed enumeration member #2" # # test ptype command with basic C types # # I've commented most of this out because it duplicates tests in whatis.exp. -# I've just left in a token test or 2 which is designed to test that ptype +# I've just left in a token test or 2 which is designed to test that ptype # acts like whatis for basic types. If it is thought to be necessary to # test both whatis and ptype for all the types, the tests should be # merged into whatis.exp, or else maintenance will be a royal pain -kingdon @@ -174,7 +174,7 @@ gdb_test "ptype red" "type = enum \{red, green, blue\}.*" "ptype unnamed enumera # timeout { fail "(timeout) ptype unsigned char" } #} -gdb_test "ptype v_short" "type = short(| int).*" "ptype short" +gdb_test "ptype v_short" "type = short(| int).*" "ptype short" #send "ptype v_signed_short\n" #gdb_expect { @@ -192,7 +192,7 @@ gdb_test "ptype v_short" "type = short(| int).*" "ptype short" #} -gdb_test "ptype v_int" "type = int.*" "ptype int" +gdb_test "ptype v_int" "type = int.*" "ptype int" #send "ptype v_signed_int\n" #gdb_expect { @@ -306,7 +306,7 @@ gdb_test "ptype v_int" "type = int.*" "ptype int" # #send "ptype v_long_array\n" #gdb_expect { -# -re "type = (long|int|long int) .2..*$gdb_prompt $" { +# -re "type = (long|int|long int) .2..*$gdb_prompt $" { # pass "ptype long array" } # -re ".*$gdb_prompt $" { fail "ptype long array" } # timeout { fail "(timeout) ptype long array" } @@ -315,7 +315,7 @@ gdb_test "ptype v_int" "type = int.*" "ptype int" # #send "ptype v_signed_long_array\n" #gdb_expect { -# -re "type = (long|int|long int) .2..*$gdb_prompt $" { +# -re "type = (long|int|long int) .2..*$gdb_prompt $" { # pass "ptype signed long array" } # -re ".*$gdb_prompt $" { fail "ptype signed long array" } # timeout { fail "(timeout) ptype signed long array" } @@ -585,7 +585,7 @@ gdb_test "ptype foo" "type = char" "ptype foo typedef after second list of charf if {[runto_main]} { - if [target_info exists gdb,cannot_call_functions] { + if {[target_info exists gdb,cannot_call_functions]} { unsupported "this target can not call functions" return } diff --git a/gdb/testsuite/gdb.base/quit-live.exp b/gdb/testsuite/gdb.base/quit-live.exp index 46579d4..e33d8bc 100644 --- a/gdb/testsuite/gdb.base/quit-live.exp +++ b/gdb/testsuite/gdb.base/quit-live.exp @@ -120,8 +120,13 @@ proc quit_with_live_inferior {appear_how extra_inferior quit_how} { } if {$extra_inferior} { - gdb_test "add-inferior" "Added inferior 2 on connection .*" \ - "add empty inferior 2" + if {[target_info gdb_protocol] ne "remote"} { + gdb_test "add-inferior" "Added inferior 2 on connection .*" \ + "add empty inferior 2" + } else { + gdb_test "add-inferior -no-connection" "Added inferior 2" \ + "add empty inferior 2" + } gdb_test "inferior 2" "Switching to inferior 2.*" \ "switch to inferior 2" } diff --git a/gdb/testsuite/gdb.base/radix.exp b/gdb/testsuite/gdb.base/radix.exp index 0d32baa..eeeb9bb 100644 --- a/gdb/testsuite/gdb.base/radix.exp +++ b/gdb/testsuite/gdb.base/radix.exp @@ -59,20 +59,20 @@ proc test_input_radix { iradix iradixhex iradixoctal } { test_one_input $iradix "-1" "-1" # test simple two-digit constants - test_one_input $iradix "10" [expr $iradix] - test_one_input $iradix "11" [expr $iradix + 1] - test_one_input $iradix "-10" [expr 0 - $iradix] - test_one_input $iradix "-11" [expr 0 - $iradix - 1] + test_one_input $iradix "10" [expr {$iradix}] + test_one_input $iradix "11" [expr {$iradix + 1}] + test_one_input $iradix "-10" [expr {0 - $iradix}] + test_one_input $iradix "-11" [expr {0 - $iradix - 1}] # test simple three-digit constants - test_one_input $iradix "100" [expr $iradix * $iradix] - test_one_input $iradix "101" [expr $iradix * $iradix + 1] - test_one_input $iradix "-100" [expr 0 - $iradix * $iradix] - test_one_input $iradix "-101" [expr 0 - $iradix * $iradix - 1] + test_one_input $iradix "100" [expr {$iradix * $iradix}] + test_one_input $iradix "101" [expr {$iradix * $iradix + 1}] + test_one_input $iradix "-100" [expr {0 - $iradix * $iradix}] + test_one_input $iradix "-101" [expr {0 - $iradix * $iradix - 1}] # test a five-digit constant test_one_input $iradix "10101" \ - [expr $iradix * $iradix * $iradix * $iradix + $iradix * $iradix + 1] + [expr {$iradix * $iradix * $iradix * $iradix + $iradix * $iradix + 1}] } test_input_radix 2 "2" "2" diff --git a/gdb/testsuite/gdb.base/randomize.exp b/gdb/testsuite/gdb.base/randomize.exp index 63bff21..5a7b089 100644 --- a/gdb/testsuite/gdb.base/randomize.exp +++ b/gdb/testsuite/gdb.base/randomize.exp @@ -60,7 +60,7 @@ gdb_test "show disable-randomization" \ set addr1 [address_get "randomized first address"] set addr2 [address_get "randomized second address"] set test "randomized addresses should not match" -if [string equal $addr1 $addr2] { +if {[string equal $addr1 $addr2]} { untested "no randomization detected on this system" return -1 } else { @@ -75,7 +75,7 @@ gdb_test "show disable-randomization" \ set addr1 [address_get "fixed first address"] set addr2 [address_get "fixed second address"] set test "fixed addresses should match" -if [string equal $addr1 $addr2] { +if {[string equal $addr1 $addr2]} { pass $test } else { fail $test diff --git a/gdb/testsuite/gdb.base/range-stepping.exp b/gdb/testsuite/gdb.base/range-stepping.exp index af78a2a..d1131c8 100644 --- a/gdb/testsuite/gdb.base/range-stepping.exp +++ b/gdb/testsuite/gdb.base/range-stepping.exp @@ -22,11 +22,11 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile {debug}] } { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } -if ![gdb_range_stepping_enabled] { +if {![gdb_range_stepping_enabled]} { unsupported "range stepping not supported by the target" return -1 } @@ -171,7 +171,7 @@ with_test_prefix "loop 2" { # Check that range stepping works well even when it is interrupted by # ctrl-c. -if ![target_info exists gdb,nointerrupts] { +if {![target_info exists gdb,nointerrupts]} { with_test_prefix "interrupt" { gdb_test_no_output "set debug remote 1" diff --git a/gdb/testsuite/gdb.base/recpar.exp b/gdb/testsuite/gdb.base/recpar.exp index 7e69790..5676067 100644 --- a/gdb/testsuite/gdb.base/recpar.exp +++ b/gdb/testsuite/gdb.base/recpar.exp @@ -19,7 +19,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/recurse.exp b/gdb/testsuite/gdb.base/recurse.exp index efe50db..e05f7e0 100644 --- a/gdb/testsuite/gdb.base/recurse.exp +++ b/gdb/testsuite/gdb.base/recurse.exp @@ -108,10 +108,10 @@ proc recurse_tests {} { # The former version expected the test to return to main(). # Now it expects the test to return to main or to stop in the # function's epilogue. - # + # # The problem is that gdb needs to (but doesn't) understand # function epilogues in the same way as for prologues. - # + # # If there is no hardware watchpoint (such as a x86 debug register), # then watchpoints are done "the hard way" by single-stepping the # target until the value of the watched variable changes. If you @@ -119,7 +119,7 @@ proc recurse_tests {} { # When you do that, the "top" stack frame may become partially # deconstructed (as when you pop the frame pointer, for instance), # and from that point on, GDB can no longer make sense of the stack. - # + # # A test which stops in the epilogue is trying to determine when GDB # leaves the stack frame in which the watchpoint was created. It does # this basically by watching for the frame pointer to change. When @@ -134,7 +134,7 @@ proc recurse_tests {} { # Preserve the old timeout, and set a new one that should be # sufficient to avoid timing out during this test. set oldtimeout $timeout -set timeout [expr "$timeout + 60"] +set timeout [expr {$timeout + 60}] verbose "Timeout is now $timeout seconds" 2 recurse_tests diff --git a/gdb/testsuite/gdb.base/reggroups.exp b/gdb/testsuite/gdb.base/reggroups.exp index 9e549bd..0d333af 100644 --- a/gdb/testsuite/gdb.base/reggroups.exp +++ b/gdb/testsuite/gdb.base/reggroups.exp @@ -114,7 +114,7 @@ set reggroups [fetch_reggroups "fetch reggroups"] set regcount 0 foreach reggroup $reggroups { set regs [fetch_reggroup_regs $reggroup "fetch reggroup regs $reggroup"] - set regcount [expr $regcount + [llength $regs]] + set regcount [expr {$regcount + [llength $regs]}] } gdb_assert "[llength $regcount] != 0" "system has reggroup registers" diff --git a/gdb/testsuite/gdb.base/relational.exp b/gdb/testsuite/gdb.base/relational.exp index 886cc4d..d79e205 100644 --- a/gdb/testsuite/gdb.base/relational.exp +++ b/gdb/testsuite/gdb.base/relational.exp @@ -19,7 +19,7 @@ # # tests for correctenss of relational operators, associativity and precedence # with integer type variables -# +# # # test running programs diff --git a/gdb/testsuite/gdb.base/relocate.exp b/gdb/testsuite/gdb.base/relocate.exp index c1c0815..db42885 100644 --- a/gdb/testsuite/gdb.base/relocate.exp +++ b/gdb/testsuite/gdb.base/relocate.exp @@ -29,7 +29,7 @@ clean_restart #Check that invalid options are rejected. foreach x {"-raednow" "readnow" "foo" "-readnow s"} { - set word [lindex $x [expr [llength $x]-1]] + set word [lindex $x [expr {[llength $x]-1}]] gdb_test "add-symbol-file ${binfile} 0 $x" \ "Unrecognized argument \"$word\"" \ "add-symbol-file: unknown option $word" @@ -278,7 +278,7 @@ with_test_prefix "functions, 2nd" { # Re-load the object giving an explicit address for .text -set text [ format "0x%x" [expr ${function_foo_addr} + 0x20000] ] +set text [ format "0x%x" [expr {${function_foo_addr} + 0x20000}] ] clean_restart gdb_test "add-symbol-file $binfile -o $offset $text" \ "Reading symbols from ${binfile}\.\.\.(\r\n$readnow_re)?" \ @@ -295,7 +295,7 @@ with_test_prefix "functions, 3rd" { # Re-load the object giving an explicit address for .data -set data [ format "0x%x" [expr ${global_foo_addr} + 0x20000] ] +set data [ format "0x%x" [expr {${global_foo_addr} + 0x20000}] ] clean_restart gdb_test "add-symbol-file $binfile -o $offset -s .data $data" \ "Reading symbols from ${binfile}\.\.\.(\r\n$readnow_re)?" \ diff --git a/gdb/testsuite/gdb.base/remote.exp b/gdb/testsuite/gdb.base/remote.exp index c1d6a99..1d97726 100644 --- a/gdb/testsuite/gdb.base/remote.exp +++ b/gdb/testsuite/gdb.base/remote.exp @@ -136,7 +136,7 @@ proc gdb_load_timed {executable class writesize} { fail "$test - loading executable" return } - verbose "$test - time [expr ($load_end_time - $load_begin_time) / 1000] ms" + verbose "$test - time [expr {($load_end_time - $load_begin_time) / 1000}] ms" pass $test } diff --git a/gdb/testsuite/gdb.base/reread.exp b/gdb/testsuite/gdb.base/reread.exp index 6c71f40..065cf1b 100644 --- a/gdb/testsuite/gdb.base/reread.exp +++ b/gdb/testsuite/gdb.base/reread.exp @@ -86,7 +86,7 @@ foreach_with_prefix opts { "" "pie" } { # Should see "Breakpoint 1, foo () at reread2.c:9" set test "run to foo() second time" - if [is_remote target] { + if {[is_remote target]} { unsupported $test } else { gdb_run_cmd @@ -97,7 +97,7 @@ foreach_with_prefix opts { "" "pie" } { ### Second pass: verify that GDB checks the executable file's ### timestamp when the program is *restarted*, not just when it exits. - if [is_remote target] { + if {[is_remote target]} { unsupported "second pass: GDB should check for changes before running" } else { diff --git a/gdb/testsuite/gdb.base/restore.exp b/gdb/testsuite/gdb.base/restore.exp index 5448fb4..a19c956 100644 --- a/gdb/testsuite/gdb.base/restore.exp +++ b/gdb/testsuite/gdb.base/restore.exp @@ -55,10 +55,10 @@ proc restore_tests { } { gdb_test "tbreak callee$e" "Temporary breakpoint.*\[0-9\]*\\." \ "caller$c calls callee$e; tbreak callee" - + gdb_test "continue" " callee$e prologue .*/" \ "caller$c calls callee$e; continue to callee" - + # Do a forced return from the callee. set test "caller$c calls callee$e; return callee now" @@ -71,7 +71,7 @@ proc restore_tests { } { # Check that the values of the local variables are what # they should be. for {set var 1} {$var <= $c} {incr var} { - set expected [expr 0x7eeb + $var] + set expected [expr {0x7eeb + $var}] set test "caller$c calls callee$e; return restored l$var to $expected" set pass_pattern " = $expected" set unsupported_pattern " = <optimized out>" diff --git a/gdb/testsuite/gdb.base/return.exp b/gdb/testsuite/gdb.base/return.exp index f39eebd..2d8665f 100644 --- a/gdb/testsuite/gdb.base/return.exp +++ b/gdb/testsuite/gdb.base/return.exp @@ -36,8 +36,8 @@ proc return_tests { } { send_gdb "step\n" exp_continue } - -re ".*in main after func1.*$gdb_prompt $" { - pass "simple return" + -re ".*in main after func1.*$gdb_prompt $" { + pass "simple return" } } diff --git a/gdb/testsuite/gdb.base/rtld-step.exp b/gdb/testsuite/gdb.base/rtld-step.exp index d1e240b..a2086a1 100644 --- a/gdb/testsuite/gdb.base/rtld-step.exp +++ b/gdb/testsuite/gdb.base/rtld-step.exp @@ -53,7 +53,7 @@ set binfile_rtld [standard_output_file ${rtld_basename}] # the flags -static-pie -fPIE were needed for Fedora 35 through Fedora # 38. The source file rtld-step-rtld.c didn't need the _start() # function either. And, better still, it was possible to call -# printf() to output progress messages in the pretend/fake RTLD. +# printf() to output progress messages in the pretend/fake RTLD. # Sadly, these output statements had to be removed in order to obtain # code which would work on other Linux distributions / releases. # diff --git a/gdb/testsuite/gdb.base/run-after-attach.exp b/gdb/testsuite/gdb.base/run-after-attach.exp index fde3854..2b8b4d0 100644 --- a/gdb/testsuite/gdb.base/run-after-attach.exp +++ b/gdb/testsuite/gdb.base/run-after-attach.exp @@ -21,7 +21,7 @@ require can_spawn_for_attach standard_testfile set executable $testfile -if [prepare_for_testing "failed to prepare" $executable] { +if {[prepare_for_testing "failed to prepare" $executable]} { return -1 } diff --git a/gdb/testsuite/gdb.base/save-bp.exp b/gdb/testsuite/gdb.base/save-bp.exp index 8a696cd..00b216a 100644 --- a/gdb/testsuite/gdb.base/save-bp.exp +++ b/gdb/testsuite/gdb.base/save-bp.exp @@ -19,7 +19,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} $srcfile] } { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } # Delete all breakpoints, watchpoints, tracepoints, and catchpoints so that @@ -61,7 +61,7 @@ gdb_test "save breakpoint $bps" "" "save breakpoint bps" # Now start a new debugger session... clean_restart $testfile -if ![runto_main] { +if {![runto_main]} { return -1 } # Delete all breakpoints, watchpoints, tracepoints, and catchpoints so that diff --git a/gdb/testsuite/gdb.base/savedregs.exp b/gdb/testsuite/gdb.base/savedregs.exp index d71d872..74b402f 100644 --- a/gdb/testsuite/gdb.base/savedregs.exp +++ b/gdb/testsuite/gdb.base/savedregs.exp @@ -96,7 +96,7 @@ proc process_saved_regs { current inner outer } { } incr level } - + # Now iterate through the list of OUTER frames checking that the # "info frame" output from each still matches what was captured # during an early query. To avoid cascading failures, checking is @@ -109,7 +109,7 @@ proc process_saved_regs { current inner outer } { foreach func $outer { set test [concat "Check $func info frame; stack contains" \ $current $inner $outer] - if $ok { + if {$ok} { set ok 0 set pat [string_to_regexp "$saved_regs($func)"] gdb_test_multiple "info frame $level" "$test" { diff --git a/gdb/testsuite/gdb.base/scope.exp b/gdb/testsuite/gdb.base/scope.exp index bb902a1..38ab6ca 100644 --- a/gdb/testsuite/gdb.base/scope.exp +++ b/gdb/testsuite/gdb.base/scope.exp @@ -263,7 +263,7 @@ proc_with_prefix test_at_autovars {} { set count 0 while {$count < 100} { gdb_test "print i$count" ".* = $count" "" - set count [expr $count+1] + set count [expr {$count+1}] } clear_xfail "*-*-*" pass "$count auto variables correctly initialized" @@ -327,7 +327,7 @@ clean_restart gdb_file_cmd $binfile # Test that variables in various segments print out correctly before -# the program is run. +# the program is run. # AIX--sections get mapped to the same address so we can't get the right one. setup_xfail "rs6000-*-*" diff --git a/gdb/testsuite/gdb.base/sepdebug.exp b/gdb/testsuite/gdb.base/sepdebug.exp index 71cc0eb..0235cbe 100644 --- a/gdb/testsuite/gdb.base/sepdebug.exp +++ b/gdb/testsuite/gdb.base/sepdebug.exp @@ -42,7 +42,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb # the name of a debuginfo only file. This file will be stored in the # gdb.base/ subdirectory. -if [gdb_gnu_strip_debug $binfile$EXEEXT] { +if {[gdb_gnu_strip_debug $binfile$EXEEXT]} { # check that you have a recent version of strip and objcopy installed unsupported "cannot produce separate debug info files" return -1 @@ -461,7 +461,7 @@ gdb_test "finish 123" \ # Verify that GDB responds gracefully to a request to "finish" from # the outermost frame. On a stub that never exits, this will just -# run to the stubs routine, so we don't get this error... Thus the +# run to the stubs routine, so we don't get this error... Thus the # second condition. # @@ -478,7 +478,7 @@ gdb_test_multiple "finish" "finish from outermost frame disallowed" { # Test "next" over recursive function call. # -proc test_next_with_recursion {} { +proc test_next_with_recursion {} { global gdb_prompt global decimal global binfile @@ -520,7 +520,7 @@ proc test_next_with_recursion {} { delete_breakpoints - if [istarget "mips*tx39-*"] { + if {[istarget "mips*tx39-*"]} { set timeout 60 } # We used to set timeout here for all other targets as well. This @@ -610,7 +610,7 @@ proc test_different_dir {type test_different_dir xfail} { # # Add a second pass pattern. The behavior differs here between stabs # and dwarf for one-line functions. Stabs preserves two line symbols - # (one before the prologue and one after) with the same line number, + # (one before the prologue and one after) with the same line number, # but dwarf regards these as duplicates and discards one of them. # Therefore the address after the prologue (where the breakpoint is) # has no exactly matching line symbol, and GDB reports the breakpoint diff --git a/gdb/testsuite/gdb.base/sepsymtab.exp b/gdb/testsuite/gdb.base/sepsymtab.exp index ed7a7a2..1822f1f 100644 --- a/gdb/testsuite/gdb.base/sepsymtab.exp +++ b/gdb/testsuite/gdb.base/sepsymtab.exp @@ -25,7 +25,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ return -1 } -if [gdb_gnu_strip_debug $binfile no-main] { +if {[gdb_gnu_strip_debug $binfile no-main]} { # check that you have a recent version of strip and objcopy installed unsupported "cannot produce separate debug info files" return -1 diff --git a/gdb/testsuite/gdb.base/setshow.exp b/gdb/testsuite/gdb.base/setshow.exp index 0e38a9d..de62692 100644 --- a/gdb/testsuite/gdb.base/setshow.exp +++ b/gdb/testsuite/gdb.base/setshow.exp @@ -411,7 +411,7 @@ proc_with_prefix test_setshow_print_characters {} { proc_with_prefix test_setshow_prompt {} { clean_restart - if [board_info target exists gdb_prompt] { + if {[board_info target exists gdb_prompt]} { return } diff --git a/gdb/testsuite/gdb.base/setvar.exp b/gdb/testsuite/gdb.base/setvar.exp index 0bce620..5335eff 100644 --- a/gdb/testsuite/gdb.base/setvar.exp +++ b/gdb/testsuite/gdb.base/setvar.exp @@ -33,7 +33,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} { # # set it up at a breakpoint so we canplay with the variable values # -gdb_test_no_output "set print sevenbit-strings" +gdb_test_no_output "set print sevenbit-strings" if {![runto_main]} { return @@ -51,22 +51,22 @@ gdb_test_multiple "print sizeof (unsigned long)" "sizeof ulong" { set ulong_minus_1 18446744073709551615 set ulong_minus_456 18446744073709551160 } -} +} proc test_set { args } { global gdb_prompt - set length [expr [llength $args] - 1] + set length [expr {[llength $args] - 1}] set message "[lindex $args $length]" - set final [expr $length - 2] + set final [expr {$length - 2}] set count 1 # Set up the variables. for {set x 0} {$x < $length} {incr x} { if { "[lindex $args $x]" != "" } { set arg [lindex $args $x] - if { ($x == $final) || ([string first ".*" [lindex $args [expr $x + 1]]] >= 0) } { - set match [lindex $args [expr $x + 1]] + if { ($x == $final) || ([string first ".*" [lindex $args [expr {$x + 1}]]] >= 0) } { + set match [lindex $args [expr {$x + 1}]] set mess "$message -- $match" if { $count != 1 } { append mess " (#$count)" @@ -78,7 +78,7 @@ proc test_set { args } { set mess "$message -- $match" } verbose "doing $arg $match" - if [gdb_test -nopass "$arg" "$match" "$mess"] { + if {[gdb_test -nopass "$arg" "$match" "$mess"]} { return 1 } } @@ -91,27 +91,27 @@ proc test_set { args } { # # Because bare char types can be either signed or unsigned, we just test the # range of values that are common to both (0-127). -# +# -test_set "set variable v_char=0" "print v_char" ".\[0-9\]* = 0 \'.000\'" "set variable char=0" -test_set "set variable v_char=1" "print v_char" ".\[0-9\]* = 1 \'.001\'" "set variable char=1" -test_set "set variable v_char=7" "print v_char" ".\[0-9\]* = 7 \'.a\'" "set variable char=7 (Bel)" -test_set "set variable v_char=32" "print v_char" ".\[0-9\]* = 32 \' \'" "set variable char=32 (SPC)" -test_set "set variable v_char=65" "print v_char" ".\[0-9\]* = 65 \'A\'" "set variable char=65 ('A')" -test_set "set variable v_char=97" "print v_char" ".\[0-9\]* = 97 \'a\'" "set variable char=97 ('a')" -test_set "set variable v_char=126" "print v_char" ".\[0-9\]* = 126 \'~\'" "set variable char=126 ('~')" -test_set "set variable v_char=127" "print v_char" ".\[0-9\]* = 127 \'.177\'" "set variable char=127 (8-bit)" +test_set "set variable v_char=0" "print v_char" ".\[0-9\]* = 0 \'.000\'" "set variable char=0" +test_set "set variable v_char=1" "print v_char" ".\[0-9\]* = 1 \'.001\'" "set variable char=1" +test_set "set variable v_char=7" "print v_char" ".\[0-9\]* = 7 \'.a\'" "set variable char=7 (Bel)" +test_set "set variable v_char=32" "print v_char" ".\[0-9\]* = 32 \' \'" "set variable char=32 (SPC)" +test_set "set variable v_char=65" "print v_char" ".\[0-9\]* = 65 \'A\'" "set variable char=65 ('A')" +test_set "set variable v_char=97" "print v_char" ".\[0-9\]* = 97 \'a\'" "set variable char=97 ('a')" +test_set "set variable v_char=126" "print v_char" ".\[0-9\]* = 126 \'~\'" "set variable char=126 ('~')" +test_set "set variable v_char=127" "print v_char" ".\[0-9\]* = 127 \'.177\'" "set variable char=127 (8-bit)" # # test "set variable" for type "signed char" -# -test_set "set variable v_char=0" "print v_signed_char" ".\[0-9\]* = 0 \'.000\'" "set variable signed char=0" -test_set "set variable v_signed_char=1" "print v_signed_char" ".\[0-9\]* = 1 \'.001\'" "set variable signed char=1" -test_set "set variable v_signed_char=7" "print v_signed_char" ".\[0-9\]* = 7 \'.a\'" "set variable signed char=7 (Bel)" -test_set "set variable v_signed_char=32" "print v_signed_char" ".\[0-9\]* = 32 \' \'" "set variable signed char=32 (SPC)" -test_set "set variable v_signed_char=65" "print v_signed_char" ".\[0-9\]* = 65 \'A\'" "set variable signed char=65 ('A')" -test_set "set variable v_signed_char=97" "print v_signed_char" ".\[0-9\]* = 97 \'a\'" "set variable signed char=97 ('a')" -test_set "set variable v_signed_char=126" "print v_signed_char" ".\[0-9\]* = 126 \'~\'" "set variable signed char=126 ('~')" -test_set "set variable v_signed_char=127" "print v_signed_char" ".\[0-9\]* = 127 \'.177\'" "set variable signed char=127 (8-bit)" +# +test_set "set variable v_char=0" "print v_signed_char" ".\[0-9\]* = 0 \'.000\'" "set variable signed char=0" +test_set "set variable v_signed_char=1" "print v_signed_char" ".\[0-9\]* = 1 \'.001\'" "set variable signed char=1" +test_set "set variable v_signed_char=7" "print v_signed_char" ".\[0-9\]* = 7 \'.a\'" "set variable signed char=7 (Bel)" +test_set "set variable v_signed_char=32" "print v_signed_char" ".\[0-9\]* = 32 \' \'" "set variable signed char=32 (SPC)" +test_set "set variable v_signed_char=65" "print v_signed_char" ".\[0-9\]* = 65 \'A\'" "set variable signed char=65 ('A')" +test_set "set variable v_signed_char=97" "print v_signed_char" ".\[0-9\]* = 97 \'a\'" "set variable signed char=97 ('a')" +test_set "set variable v_signed_char=126" "print v_signed_char" ".\[0-9\]* = 126 \'~\'" "set variable signed char=126 ('~')" +test_set "set variable v_signed_char=127" "print v_signed_char" ".\[0-9\]* = 127 \'.177\'" "set variable signed char=127 (8-bit)" gdb_test_no_output "set variable v_signed_char=-1" with_target_charset "ASCII" { @@ -129,156 +129,156 @@ with_target_charset "ASCII" { # # test "set variable" for type "unsigned char" # -test_set "set variable v_unsigned_char=0" "print v_unsigned_char" ".\[0-9\]* = 0 \'.000\'" "set variable unsigned char=0" -test_set "set variable v_unsigned_char=1" "print v_unsigned_char" ".\[0-9\]* = 1 \'.001\'" "set variable unsigned char=1" -test_set "set variable v_unsigned_char=7" "print v_unsigned_char" ".\[0-9\]* = 7 \'.a\'" "set variable unsigned char=7 (Bel)" -test_set "set variable v_unsigned_char=32" "print v_unsigned_char" ".\[0-9\]* = 32 \' \'" "set variable unsigned char=32 (SPC)" -test_set "set variable v_unsigned_char=65" "print v_unsigned_char" ".\[0-9\]* = 65 \'A\'" "set variable unsigned char=65 ('A')" -test_set "set variable v_unsigned_char=97" "print v_unsigned_char" ".\[0-9\]* = 97 \'a\'" "set variable unsigned char=97 ('a')" -test_set "set variable v_unsigned_char=126" "print v_unsigned_char" ".\[0-9\]* = 126 \'~\'" "set variable unsigned char=126 ('~')" +test_set "set variable v_unsigned_char=0" "print v_unsigned_char" ".\[0-9\]* = 0 \'.000\'" "set variable unsigned char=0" +test_set "set variable v_unsigned_char=1" "print v_unsigned_char" ".\[0-9\]* = 1 \'.001\'" "set variable unsigned char=1" +test_set "set variable v_unsigned_char=7" "print v_unsigned_char" ".\[0-9\]* = 7 \'.a\'" "set variable unsigned char=7 (Bel)" +test_set "set variable v_unsigned_char=32" "print v_unsigned_char" ".\[0-9\]* = 32 \' \'" "set variable unsigned char=32 (SPC)" +test_set "set variable v_unsigned_char=65" "print v_unsigned_char" ".\[0-9\]* = 65 \'A\'" "set variable unsigned char=65 ('A')" +test_set "set variable v_unsigned_char=97" "print v_unsigned_char" ".\[0-9\]* = 97 \'a\'" "set variable unsigned char=97 ('a')" +test_set "set variable v_unsigned_char=126" "print v_unsigned_char" ".\[0-9\]* = 126 \'~\'" "set variable unsigned char=126 ('~')" with_target_charset "ASCII" { - test_set "set variable v_unsigned_char=~0" "print v_unsigned_char" ".\[0-9\]* = 255 \'.377\'" "set variable unsigned char=255 (8-bit)" + test_set "set variable v_unsigned_char=~0" "print v_unsigned_char" ".\[0-9\]* = 255 \'.377\'" "set variable unsigned char=255 (8-bit)" } # # test "set variable" for type "short" # -test_set "set variable v_short=0" "print v_short" ".\[0-9\]* = 0" "set variable short=0" -test_set "set variable v_short=1" "print v_short" ".\[0-9\]* = 1" "set variable short=1" -test_set "set variable v_short=-1" "print v_short" ".\[0-9\]* = -1" "set variable short=-1 (minus)" +test_set "set variable v_short=0" "print v_short" ".\[0-9\]* = 0" "set variable short=0" +test_set "set variable v_short=1" "print v_short" ".\[0-9\]* = 1" "set variable short=1" +test_set "set variable v_short=-1" "print v_short" ".\[0-9\]* = -1" "set variable short=-1 (minus)" # # test "set variable" for type "signed short" # -test_set "set variable v_signed_short=0" "print v_signed_short" ".\[0-9\]* = 0" "set variable signed short=0" -test_set "set variable v_signed_short=1" "print v_signed_short" ".\[0-9\]* = 1" "set variable signed short=1" -test_set "set variable v_signed_short=-1" "print v_signed_short" ".\[0-9\]* = -1" "set variable signed short=-1 (minus)" +test_set "set variable v_signed_short=0" "print v_signed_short" ".\[0-9\]* = 0" "set variable signed short=0" +test_set "set variable v_signed_short=1" "print v_signed_short" ".\[0-9\]* = 1" "set variable signed short=1" +test_set "set variable v_signed_short=-1" "print v_signed_short" ".\[0-9\]* = -1" "set variable signed short=-1 (minus)" # # test "set variable" for type "unsigned short" # -test_set "set variable v_unsigned_short=0" "print v_unsigned_short" ".\[0-9\]* = 0" "set variable unsigned short=0" -test_set "set variable v_unsigned_short=1" "print v_unsigned_short" ".\[0-9\]* = 1" "set variable unsigned short=1" -test_set "set variable v_unsigned_short=~0" "print v_unsigned_short" ".\[0-9\]* = 65535" "set variable unsigned short=~0 (minus)" +test_set "set variable v_unsigned_short=0" "print v_unsigned_short" ".\[0-9\]* = 0" "set variable unsigned short=0" +test_set "set variable v_unsigned_short=1" "print v_unsigned_short" ".\[0-9\]* = 1" "set variable unsigned short=1" +test_set "set variable v_unsigned_short=~0" "print v_unsigned_short" ".\[0-9\]* = 65535" "set variable unsigned short=~0 (minus)" # # test "set variable" for type "int" # -test_set "set variable v_int=0" "print v_int" ".\[0-9\]* = 0" "set variable int=0" -test_set "set variable v_int=1" "print v_int" ".\[0-9\]* = 1" "set variable int=1" -test_set "set variable v_int=-1" "print v_int" ".\[0-9\]* = -1" "set variable int=-1 (minus)" +test_set "set variable v_int=0" "print v_int" ".\[0-9\]* = 0" "set variable int=0" +test_set "set variable v_int=1" "print v_int" ".\[0-9\]* = 1" "set variable int=1" +test_set "set variable v_int=-1" "print v_int" ".\[0-9\]* = -1" "set variable int=-1 (minus)" # # test "set variable" for type "signed int" # -test_set "set variable v_signed_int=0" "print v_signed_int" ".\[0-9\]* = 0" "set variable signed int=0" -test_set "set variable v_signed_int=1" "print v_signed_int" ".\[0-9\]* = 1" "set variable signed int=1" -test_set "set variable v_signed_int=-1" "print v_signed_int" ".\[0-9\]* = -1" "set variable signed int=-1 (minus)" +test_set "set variable v_signed_int=0" "print v_signed_int" ".\[0-9\]* = 0" "set variable signed int=0" +test_set "set variable v_signed_int=1" "print v_signed_int" ".\[0-9\]* = 1" "set variable signed int=1" +test_set "set variable v_signed_int=-1" "print v_signed_int" ".\[0-9\]* = -1" "set variable signed int=-1 (minus)" # # test "set variable" for type "unsigned int" # -test_set "set variable v_unsigned_int=0" "print v_unsigned_int" ".\[0-9\]* = 0" "set variable unsigned int=0" -test_set "set variable v_unsigned_int=1" "print v_unsigned_int" ".\[0-9\]* = 1" "set variable unsigned int=1" -test_set "set variable v_unsigned_int=~0" "print v_unsigned_int" ".\[0-9\]* = (4294967295|65535)" "set variable unsigned int=~0 (minus)" -#test_set ".\[0-9\]* = 65535" "set variable unsigned int=~0 (minus)" +test_set "set variable v_unsigned_int=0" "print v_unsigned_int" ".\[0-9\]* = 0" "set variable unsigned int=0" +test_set "set variable v_unsigned_int=1" "print v_unsigned_int" ".\[0-9\]* = 1" "set variable unsigned int=1" +test_set "set variable v_unsigned_int=~0" "print v_unsigned_int" ".\[0-9\]* = (4294967295|65535)" "set variable unsigned int=~0 (minus)" +#test_set ".\[0-9\]* = 65535" "set variable unsigned int=~0 (minus)" # # test "set variable" for type "long" # -test_set "set variable v_long=0" "print v_long" ".\[0-9\]* = 0" "set variable long=0" -test_set "set variable v_long=1" "print v_long" ".\[0-9\]* = 1" "set variable long=1" -test_set "set variable v_long=-1" "print v_long" ".\[0-9\]* = -1" "set variable long=-1 (minus)" +test_set "set variable v_long=0" "print v_long" ".\[0-9\]* = 0" "set variable long=0" +test_set "set variable v_long=1" "print v_long" ".\[0-9\]* = 1" "set variable long=1" +test_set "set variable v_long=-1" "print v_long" ".\[0-9\]* = -1" "set variable long=-1 (minus)" # # test "set variable" for type "signed long" # -test_set "set variable v_signed_long=0" "print v_signed_long" ".\[0-9\]* = 0" "set variable signed long=0" -test_set "set variable v_signed_long=1" "print v_signed_long" ".\[0-9\]* = 1" "set variable signed long=1" -test_set "set variable v_signed_long=-1" "print v_signed_long" ".\[0-9\]* = -1" "set variable signed long=-1 (minus)" +test_set "set variable v_signed_long=0" "print v_signed_long" ".\[0-9\]* = 0" "set variable signed long=0" +test_set "set variable v_signed_long=1" "print v_signed_long" ".\[0-9\]* = 1" "set variable signed long=1" +test_set "set variable v_signed_long=-1" "print v_signed_long" ".\[0-9\]* = -1" "set variable signed long=-1 (minus)" # # test "set variable" for type "unsigned long" # -test_set "set variable v_unsigned_long=0" "print v_unsigned_long" ".\[0-9\]* = 0" "set variable unsigned long=0" -test_set "set variable v_unsigned_long=1" "print v_unsigned_long" ".\[0-9\]* = 1" "set variable unsigned long=1" -test_set "set variable v_unsigned_long=~0" "print v_unsigned_long" ".\[0-9\]* = $ulong_minus_1" "set variable unsigned long=~0 (minus)" +test_set "set variable v_unsigned_long=0" "print v_unsigned_long" ".\[0-9\]* = 0" "set variable unsigned long=0" +test_set "set variable v_unsigned_long=1" "print v_unsigned_long" ".\[0-9\]* = 1" "set variable unsigned long=1" +test_set "set variable v_unsigned_long=~0" "print v_unsigned_long" ".\[0-9\]* = $ulong_minus_1" "set variable unsigned long=~0 (minus)" # # test "set variable" for type "float" # -test_set "set variable v_float=0.0" "print v_float" ".\[0-9\]* = 0" "set variable float=0" -test_set "set variable v_float=1.0" "print v_float" ".\[0-9\]* = 1" "set variable float=1" -test_set "set variable v_float=-1.0" "print v_float" ".\[0-9\]* = -1" "set variable float=-1 (minus)" +test_set "set variable v_float=0.0" "print v_float" ".\[0-9\]* = 0" "set variable float=0" +test_set "set variable v_float=1.0" "print v_float" ".\[0-9\]* = 1" "set variable float=1" +test_set "set variable v_float=-1.0" "print v_float" ".\[0-9\]* = -1" "set variable float=-1 (minus)" # # test "set variable" for type "double" # -test_set "set variable v_double=0.0" "print v_double" ".\[0-9\]* = 0" "set variable double=0" -test_set "set variable v_double=1.0" "print v_double" ".\[0-9\]* = 1" "set variable double=1" -test_set "set variable v_double=-1.0" "print v_double" ".*.\[0-9\]* = -1" "set variable double=-1 (minus)" +test_set "set variable v_double=0.0" "print v_double" ".\[0-9\]* = 0" "set variable double=0" +test_set "set variable v_double=1.0" "print v_double" ".\[0-9\]* = 1" "set variable double=1" +test_set "set variable v_double=-1.0" "print v_double" ".*.\[0-9\]* = -1" "set variable double=-1 (minus)" # # test "set variable" for "char array[2]" # -test_set "set variable v_char_array\[0\]='h'" "set variable v_char_array\[1\]='i'" "print v_char_array" ".*.\[0-9\]* =.*\"hi\"" "set variable char array=\"hi\" (string)" +test_set "set variable v_char_array\[0\]='h'" "set variable v_char_array\[1\]='i'" "print v_char_array" ".*.\[0-9\]* =.*\"hi\"" "set variable char array=\"hi\" (string)" # # test "set variable" for "signed char array[2]" # -test_set "set variable v_signed_char_array\[0\]='h'" "set variable v_signed_char_array\[1\]='i'" "print v_signed_char_array" ".*.\[0-9\]* =.*\"hi\"" "set variable signed char array=\"hi\" (string)" +test_set "set variable v_signed_char_array\[0\]='h'" "set variable v_signed_char_array\[1\]='i'" "print v_signed_char_array" ".*.\[0-9\]* =.*\"hi\"" "set variable signed char array=\"hi\" (string)" # # test "set variable" for "unsigned char array[2]" # -test_set "set variable v_unsigned_char_array\[0\]='h'" "set variable v_unsigned_char_array\[1\]='i'" "print v_unsigned_char_array" ".*.\[0-9\]* =.*\"hi\"" "set variable unsigned char array=\"hi\" (string)" +test_set "set variable v_unsigned_char_array\[0\]='h'" "set variable v_unsigned_char_array\[1\]='i'" "print v_unsigned_char_array" ".*.\[0-9\]* =.*\"hi\"" "set variable unsigned char array=\"hi\" (string)" # # test "set variable" for "short array[2]" # -test_set "set variable v_short_array\[0\]=123" "set variable v_short_array\[1\]=-456" "print v_short_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable short array" +test_set "set variable v_short_array\[0\]=123" "set variable v_short_array\[1\]=-456" "print v_short_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable short array" # # test "set variable" for "signed short array[2]" # -test_set "set variable v_signed_short_array\[0\]=123" "set variable v_signed_short_array\[1\]=-456" "print v_signed_short_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable signed short array" +test_set "set variable v_signed_short_array\[0\]=123" "set variable v_signed_short_array\[1\]=-456" "print v_signed_short_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable signed short array" # # test "set variable" for "unsigned short array[2]" # -test_set "set variable v_unsigned_short_array\[0\]=123" "set variable v_unsigned_short_array\[1\]=-456" "print v_unsigned_short_array" ".*.\[0-9\]* =.*\\{123,.*65080\\}" "set variable unsigned short array" +test_set "set variable v_unsigned_short_array\[0\]=123" "set variable v_unsigned_short_array\[1\]=-456" "print v_unsigned_short_array" ".*.\[0-9\]* =.*\\{123,.*65080\\}" "set variable unsigned short array" # # test "set variable" for "int array[2]" # -test_set "set variable v_int_array\[0\]=123" "set variable v_int_array\[1\]=-456" "print v_int_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable int array" +test_set "set variable v_int_array\[0\]=123" "set variable v_int_array\[1\]=-456" "print v_int_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable int array" # # test "set variable" for "signed int array[2]" # -test_set "set variable v_signed_int_array\[0\]=123" "set variable v_signed_int_array\[1\]=-456" "print v_signed_int_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable signed int array" +test_set "set variable v_signed_int_array\[0\]=123" "set variable v_signed_int_array\[1\]=-456" "print v_signed_int_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable signed int array" # # test "set variable" for "unsigned int array[2]" # -test_set "set variable v_unsigned_int_array\[0\]=123" "set variable v_unsigned_int_array\[1\]=-456" "print v_unsigned_int_array" ".*.\[0-9\]* =.*\\{123,.*(4294966840|65080)\\}" "set variable unsigned int array" +test_set "set variable v_unsigned_int_array\[0\]=123" "set variable v_unsigned_int_array\[1\]=-456" "print v_unsigned_int_array" ".*.\[0-9\]* =.*\\{123,.*(4294966840|65080)\\}" "set variable unsigned int array" # # test "set variable" for "long array[2]" # -test_set "set variable v_long_array\[0\]=123" "set variable v_long_array\[1\]=-456" "print v_long_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable long array" +test_set "set variable v_long_array\[0\]=123" "set variable v_long_array\[1\]=-456" "print v_long_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable long array" # # test "set variable" for "signed long array[2]" # -test_set "set variable v_signed_long_array\[0\]=123" "set variable v_signed_long_array\[1\]=-456" "print v_signed_long_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable signed long array" +test_set "set variable v_signed_long_array\[0\]=123" "set variable v_signed_long_array\[1\]=-456" "print v_signed_long_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable signed long array" # # test "set variable" for "unsigned long array[2]" # -test_set "set variable v_unsigned_long_array\[0\]=123" "set variable v_unsigned_long_array\[1\]=-456" "print v_unsigned_long_array" ".*.\[0-9\]* =.*\\{123,.*$ulong_minus_456\\}" "set variable unsigned long array" +test_set "set variable v_unsigned_long_array\[0\]=123" "set variable v_unsigned_long_array\[1\]=-456" "print v_unsigned_long_array" ".*.\[0-9\]* =.*\\{123,.*$ulong_minus_456\\}" "set variable unsigned long array" # # test "set variable" for "float array[2]" # -test_set "set variable v_float_array\[0\]=123.0" "set variable v_float_array\[1\]=-456.0" "print v_float_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable float array" +test_set "set variable v_float_array\[0\]=123.0" "set variable v_float_array\[1\]=-456.0" "print v_float_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable float array" # # test "set variable" for "double array[2]" # -test_set "set variable v_double_array\[0\]=123.0" "set variable v_double_array\[1\]=-456.0" "print v_double_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable double array" +test_set "set variable v_double_array\[0\]=123.0" "set variable v_double_array\[1\]=-456.0" "print v_double_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable double array" # # test "set variable" for type "char *" # -test_set "set v_char_pointer=v_char_array" "set variable *(v_char_pointer)='h'" "set variable *(v_char_pointer+1)='i'" "print v_char_array" ".*.\[0-9\]* =.*\"hi\"" "print *(v_char_pointer+1)" ".*.\[0-9\]* = 105 \'i\'" "set variable char pointer=\"hi\" (string)" +test_set "set v_char_pointer=v_char_array" "set variable *(v_char_pointer)='h'" "set variable *(v_char_pointer+1)='i'" "print v_char_array" ".*.\[0-9\]* =.*\"hi\"" "print *(v_char_pointer+1)" ".*.\[0-9\]* = 105 \'i\'" "set variable char pointer=\"hi\" (string)" # # test "set variable" for type "signed char *" # -test_set "set v_signed_char_pointer=v_signed_char_array" "set variable *(v_signed_char_pointer)='h'" "set variable *(v_signed_char_pointer+1)='i'" "print v_signed_char_array" ".*.\[0-9\]* =.*\"hi\"" "print *(v_signed_char_pointer+1)" ".*.\[0-9\]* = 105 \'i\'" "set variable signed char pointer=\"hi\" (string)" +test_set "set v_signed_char_pointer=v_signed_char_array" "set variable *(v_signed_char_pointer)='h'" "set variable *(v_signed_char_pointer+1)='i'" "print v_signed_char_array" ".*.\[0-9\]* =.*\"hi\"" "print *(v_signed_char_pointer+1)" ".*.\[0-9\]* = 105 \'i\'" "set variable signed char pointer=\"hi\" (string)" # # test "set variable" for type "unsigned char *" # -test_set "set v_unsigned_char_pointer=v_unsigned_char_array" "set variable *(v_unsigned_char_pointer)='h'" "set variable *(v_unsigned_char_pointer+1)='i'" "print v_unsigned_char_array" ".*.\[0-9\]* =.*\"hi\"" "print *(v_unsigned_char_pointer+1)" ".*.\[0-9\]* = 105 \'i\'" "set variable unsigned char pointer=\"hi\" (string)" +test_set "set v_unsigned_char_pointer=v_unsigned_char_array" "set variable *(v_unsigned_char_pointer)='h'" "set variable *(v_unsigned_char_pointer+1)='i'" "print v_unsigned_char_array" ".*.\[0-9\]* =.*\"hi\"" "print *(v_unsigned_char_pointer+1)" ".*.\[0-9\]* = 105 \'i\'" "set variable unsigned char pointer=\"hi\" (string)" # # test "set variable" for type "short *" # -test_set "set v_short_pointer=v_short_array" "set variable *(v_short_pointer)=123" "set variable *(v_short_pointer+1)=-456" "print v_short_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "print *(v_short_pointer+1)" ".*.\[0-9\]* = -456" "set variable short pointer" +test_set "set v_short_pointer=v_short_array" "set variable *(v_short_pointer)=123" "set variable *(v_short_pointer+1)=-456" "print v_short_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "print *(v_short_pointer+1)" ".*.\[0-9\]* = -456" "set variable short pointer" # # test "set variable" for type "signed short *" # @@ -300,11 +300,11 @@ gdb_test "print *(v_unsigned_short_pointer+1)" ".\[0-9\]* = 65080" # # test "set variable" for type "int *" # -test_set "set v_int_pointer=v_int_array" "set variable *(v_int_pointer)=123" "set variable *(v_int_pointer+1)=-456" "print v_int_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "print *(v_int_pointer+1)" ".*.\[0-9\]* = -456" "set variable int pointer" +test_set "set v_int_pointer=v_int_array" "set variable *(v_int_pointer)=123" "set variable *(v_int_pointer+1)=-456" "print v_int_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "print *(v_int_pointer+1)" ".*.\[0-9\]* = -456" "set variable int pointer" # # test "set variable" for type "signed int *" # -test_set "set v_signed_int_pointer=v_signed_int_array" "set variable *(v_signed_int_pointer)=123" "set variable *(v_signed_int_pointer+1)=-456" "print v_signed_int_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "print *(v_signed_int_pointer+1)" ".*.\[0-9\]* = -456" "set variable signed int pointer" +test_set "set v_signed_int_pointer=v_signed_int_array" "set variable *(v_signed_int_pointer)=123" "set variable *(v_signed_int_pointer+1)=-456" "print v_signed_int_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "print *(v_signed_int_pointer+1)" ".*.\[0-9\]* = -456" "set variable signed int pointer" # # test "set variable" for type "unsigned int *" # @@ -313,32 +313,32 @@ test_set "" "print *(v_unsigned_int_pointer+1)" ".*.\[0-9\]* = (4294966840|65080 # # test "set variable" for type "long *" # -test_set "set v_long_pointer=v_long_array" "set variable *(v_long_pointer)=123" "set variable *(v_long_pointer+1)=-456" "print v_long_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "print *(v_long_pointer+1)" ".*.\[0-9\]* = -456" "set variable long pointer" +test_set "set v_long_pointer=v_long_array" "set variable *(v_long_pointer)=123" "set variable *(v_long_pointer+1)=-456" "print v_long_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "print *(v_long_pointer+1)" ".*.\[0-9\]* = -456" "set variable long pointer" # # test "set variable" for type "signed long *" # -test_set "set v_signed_long_pointer=v_signed_long_array" "set variable *(v_signed_long_pointer)=123" "set variable *(v_signed_long_pointer+1)=-456" "print v_signed_long_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "print *(v_signed_long_pointer+1)" ".*.\[0-9\]* = -456" "set variable signed long pointer" +test_set "set v_signed_long_pointer=v_signed_long_array" "set variable *(v_signed_long_pointer)=123" "set variable *(v_signed_long_pointer+1)=-456" "print v_signed_long_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "print *(v_signed_long_pointer+1)" ".*.\[0-9\]* = -456" "set variable signed long pointer" # # test "set variable" for type "unsigned long *" # -test_set "set v_unsigned_long_pointer=v_unsigned_long_array" "set variable *(v_unsigned_long_pointer)=123" "set variable *(v_unsigned_long_pointer+1)=-456" "print v_unsigned_long_array" ".*.\[0-9\]* =.*\\{123,.*$ulong_minus_456\\}" "print *(v_unsigned_long_pointer+1)" ".*.\[0-9\]* = $ulong_minus_456" "set variable unsigned long pointer" +test_set "set v_unsigned_long_pointer=v_unsigned_long_array" "set variable *(v_unsigned_long_pointer)=123" "set variable *(v_unsigned_long_pointer+1)=-456" "print v_unsigned_long_array" ".*.\[0-9\]* =.*\\{123,.*$ulong_minus_456\\}" "print *(v_unsigned_long_pointer+1)" ".*.\[0-9\]* = $ulong_minus_456" "set variable unsigned long pointer" # # test "set variable" for type "float *" # -test_set "set v_float_pointer=v_float_array" "set variable *(v_float_pointer)=123.0" "set variable *(v_float_pointer+1)=-456.0" "print v_float_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "print *(v_float_pointer+1)" ".*.\[0-9\]* = -456" "set variable float pointer" +test_set "set v_float_pointer=v_float_array" "set variable *(v_float_pointer)=123.0" "set variable *(v_float_pointer+1)=-456.0" "print v_float_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "print *(v_float_pointer+1)" ".*.\[0-9\]* = -456" "set variable float pointer" # # test "set variable" for type "double *" # -test_set "set v_double_pointer=v_double_array" "set variable *(v_double_pointer)=123.0" "set variable *(v_double_pointer+1)=-456.0" "print v_double_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "print *(v_double_pointer+1)" ".*.\[0-9\]* = -456" "set variable double pointer" +test_set "set v_double_pointer=v_double_array" "set variable *(v_double_pointer)=123.0" "set variable *(v_double_pointer+1)=-456.0" "print v_double_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "print *(v_double_pointer+1)" ".*.\[0-9\]* = -456" "set variable double pointer" # # test "set variable" for struct members # -test_set "set variable v_struct1.v_char_member='h'" "print v_struct1.v_char_member" ".*.\[0-9\]* = 104 \'h\'" "set variable structure char member" -test_set "set variable v_struct1.v_short_member=1" "print v_struct1.v_short_member" ".*.\[0-9\]* = 1" "set variable structure short member" -test_set "set variable v_struct1.v_int_member=2" "print v_struct1.v_int_member" ".*.\[0-9\]* = 2" "set variable structure int member" -test_set "set variable v_struct1.v_long_member=3" "print v_struct1.v_long_member" ".*.\[0-9\]* = 3" "set variable structure long member" -test_set "set variable v_struct1.v_float_member=4.0" "print v_struct1.v_float_member" ".*.\[0-9\]* = 4" "set variable structure float member" -test_set "set variable v_struct1.v_double_member=5.0" "print v_struct1.v_double_member" ".*.\[0-9\]* = 5" "set variable structure double member" +test_set "set variable v_struct1.v_char_member='h'" "print v_struct1.v_char_member" ".*.\[0-9\]* = 104 \'h\'" "set variable structure char member" +test_set "set variable v_struct1.v_short_member=1" "print v_struct1.v_short_member" ".*.\[0-9\]* = 1" "set variable structure short member" +test_set "set variable v_struct1.v_int_member=2" "print v_struct1.v_int_member" ".*.\[0-9\]* = 2" "set variable structure int member" +test_set "set variable v_struct1.v_long_member=3" "print v_struct1.v_long_member" ".*.\[0-9\]* = 3" "set variable structure long member" +test_set "set variable v_struct1.v_float_member=4.0" "print v_struct1.v_float_member" ".*.\[0-9\]* = 4" "set variable structure float member" +test_set "set variable v_struct1.v_double_member=5.0" "print v_struct1.v_double_member" ".*.\[0-9\]* = 5" "set variable structure double member" gdb_test "print v_struct1" \ ".*.\[0-9\]* = \{.*v_char_member = 104 \'h\',.*v_short_member = 1,\ diff --git a/gdb/testsuite/gdb.base/shlib-call.exp b/gdb/testsuite/gdb.base/shlib-call.exp index d3ff1c3..4a5cefd 100644 --- a/gdb/testsuite/gdb.base/shlib-call.exp +++ b/gdb/testsuite/gdb.base/shlib-call.exp @@ -79,7 +79,7 @@ gdb_test "next 2" "g = shr1\\(g\\);" "next to shr1" gdb_test "print g" "\[0-9\]* = 1" #step -over -if ![gdb_skip_stdio_test "next over shr1"] { +if {![gdb_skip_stdio_test "next over shr1"]} { gdb_test_stdio "next" \ "address of sgs is $hex" \ "g = shr2\\(g\\);" \ @@ -93,7 +93,7 @@ if ![gdb_skip_stdio_test "next over shr1"] { gdb_test "print g" "\[0-9\]* = 2" "print g two" #print shr1(1) -if ![gdb_skip_stdio_test "print shr1(1)"] { +if {![gdb_skip_stdio_test "print shr1(1)"]} { gdb_test_stdio "print shr1(1)" \ "address of sgs is $hex" \ "\[0-9\]* = 2" \ @@ -101,7 +101,7 @@ if ![gdb_skip_stdio_test "print shr1(1)"] { } #print shr1(g) -if ![gdb_skip_stdio_test "print shr1(g)"] { +if {![gdb_skip_stdio_test "print shr1(g)"]} { gdb_test_stdio "print shr1(g)" \ "address of sgs is $hex" \ "\[0-9\]* = 4" \ @@ -120,7 +120,7 @@ gdb_test "continue" \ #print shr1(1) -if ![gdb_skip_stdio_test "print shr1(1) 2nd time"] { +if {![gdb_skip_stdio_test "print shr1(1) 2nd time"]} { gdb_test_stdio "print shr1(1)" \ "address of sgs is $hex" \ "\[0-9\]* = 2" \ diff --git a/gdb/testsuite/gdb.base/shlib-unload.exp b/gdb/testsuite/gdb.base/shlib-unload.exp index 0e1369e..e38d04d 100644 --- a/gdb/testsuite/gdb.base/shlib-unload.exp +++ b/gdb/testsuite/gdb.base/shlib-unload.exp @@ -57,7 +57,7 @@ set bp_disabled_re "warning: Temporarily disabling breakpoints for unloaded shar # assuming that GDB has disabled some breakpoints. set stop_after_bp_re [multi_line \ "^$::bp_disabled_re" \ - "[expr $::bp_line + 1]\\s+assert \\(res == 0\\);"] + "[expr {$::bp_line + 1}]\\s+assert \\(res == 0\\);"] # Checking that a breakpoint with multiple locations in a shared # library only triggers a single breakpoint modified event from diff --git a/gdb/testsuite/gdb.base/shreloc.exp b/gdb/testsuite/gdb.base/shreloc.exp index 2bd79af..e960291 100644 --- a/gdb/testsuite/gdb.base/shreloc.exp +++ b/gdb/testsuite/gdb.base/shreloc.exp @@ -42,11 +42,11 @@ if {([istarget "*pc-cygwin"] || [istarget "*pc-mingw32"]) } { lappend lib_opts "ldflags=-Wl,--image-base,0x04000000" } -if [test_compiler_info "xlc-*"] { +if {[test_compiler_info "xlc-*"]} { - # IBM's xlc compiler does not add static variables to the ELF symbol - # table by default. We need this option to make the variables show - # up in "maint print msymbols". + # IBM's xlc compiler does not add static variables to the ELF symbol + # table by default. We need this option to make the variables show + # up in "maint print msymbols". lappend lib_opts "additional_flags=-qstatsym" @@ -194,13 +194,13 @@ proc check_different {var msymfile} { return 1 } -if [is_remote host] { +if {[is_remote host]} { set msymfile shreloc.txt } else { set msymfile [standard_output_file shreloc.txt] } -if [send_gdb_discard "maint print msymbols ${msymfile}"] { +if {[send_gdb_discard "maint print msymbols ${msymfile}"]} { if {[check_different "static_var_\[12\]" "${msymfile}"]} { pass "(msymbol) relocated static vars have different addresses" } else { diff --git a/gdb/testsuite/gdb.base/sigbpt.exp b/gdb/testsuite/gdb.base/sigbpt.exp index a9da0f5..c003baf 100644 --- a/gdb/testsuite/gdb.base/sigbpt.exp +++ b/gdb/testsuite/gdb.base/sigbpt.exp @@ -236,7 +236,7 @@ proc cont_out { name args } { # Now single step the faulted instrction at that breakpoint. gdb_test "stepi" \ "Program received signal ${signame}.*pc(\r\n| *)=> [at_segv] .*" \ - "${name}; stepi fault" + "${name}; stepi fault" # Clear any breakpoints for {set i 0} {$i < [llength $args]} {incr i} { diff --git a/gdb/testsuite/gdb.base/siginfo-infcall.exp b/gdb/testsuite/gdb.base/siginfo-infcall.exp index e60270c..46d67cc 100644 --- a/gdb/testsuite/gdb.base/siginfo-infcall.exp +++ b/gdb/testsuite/gdb.base/siginfo-infcall.exp @@ -21,7 +21,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/signals-state-child.exp b/gdb/testsuite/gdb.base/signals-state-child.exp index 00ad7f5..9bcf730 100644 --- a/gdb/testsuite/gdb.base/signals-state-child.exp +++ b/gdb/testsuite/gdb.base/signals-state-child.exp @@ -90,7 +90,7 @@ if { $res < 0 || $res == "" } { } set wait_status [remote_wait target 60] -set have_standalone [expr [lindex $wait_status 0] == 0] +set have_standalone [expr {[lindex $wait_status 0] == 0}] gdb_assert { $have_standalone } "collect standalone signals state" remote_close target diff --git a/gdb/testsuite/gdb.base/signals.exp b/gdb/testsuite/gdb.base/signals.exp index 5ff1e38..c0aaa0a 100644 --- a/gdb/testsuite/gdb.base/signals.exp +++ b/gdb/testsuite/gdb.base/signals.exp @@ -35,7 +35,7 @@ proc test_handle_all_print {} { # Increase timeout and expect input buffer for large output from gdb. # Allow blank or TAB as whitespace characters. set oldtimeout $timeout - set timeout [expr "$timeout + 60"] + set timeout [expr {$timeout + 60}] verbose "Timeout is now $timeout seconds" 2 if { ![istarget "*-*-linux*"] && ( [istarget "*-*-gnu*"] @@ -258,7 +258,7 @@ The program being debugged stopped while in a function called from GDB.*" \ gdb_test "signal" \ "Argument required .signal number..*" \ "signal without arguments disallowed" - + # Verify that we can successfully send a signal other than 0 to # the inferior. (This probably causes the inferior to run away. # Be prepared to rerun to main for further testing.) diff --git a/gdb/testsuite/gdb.base/signest.exp b/gdb/testsuite/gdb.base/signest.exp index 0e62f0b..c55db4a 100644 --- a/gdb/testsuite/gdb.base/signest.exp +++ b/gdb/testsuite/gdb.base/signest.exp @@ -19,7 +19,7 @@ standard_testfile require {!target_info exists gdb,nosignals} -if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug}] { +if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug}]} { return -1 } diff --git a/gdb/testsuite/gdb.base/sizeof.exp b/gdb/testsuite/gdb.base/sizeof.exp index 1152e13..3c81b77 100644 --- a/gdb/testsuite/gdb.base/sizeof.exp +++ b/gdb/testsuite/gdb.base/sizeof.exp @@ -127,7 +127,7 @@ while { $ok } { gdb_expect { -re ".*dump" { #pass "maint print arch $ok" - #set ok [expr $ok + 1] + #set ok [expr {$ok + 1}] } -re "$gdb_prompt $" { pass "maint print arch" diff --git a/gdb/testsuite/gdb.base/skip-inline.exp b/gdb/testsuite/gdb.base/skip-inline.exp index 33a3951..e3bc108 100644 --- a/gdb/testsuite/gdb.base/skip-inline.exp +++ b/gdb/testsuite/gdb.base/skip-inline.exp @@ -27,7 +27,7 @@ set srcfile skip-inline.c set srcfile1 skip1.c proc_with_prefix single_step { } { - if ![runto_main] { + if {![runto_main]} { return } @@ -43,7 +43,7 @@ proc_with_prefix single_step { } { } proc_with_prefix double_step { } { - if ![runto_main] { + if {![runto_main]} { return } @@ -61,7 +61,7 @@ proc_with_prefix double_step { } { } proc_with_prefix triple_step { } { - if ![runto_main] { + if {![runto_main]} { return } @@ -75,7 +75,7 @@ proc_with_prefix triple_step { } { } proc_with_prefix skip_current_frame { } { - if ![runto_main] { + if {![runto_main]} { return } diff --git a/gdb/testsuite/gdb.base/skip-solib.exp b/gdb/testsuite/gdb.base/skip-solib.exp index d96d1ac..e152023 100644 --- a/gdb/testsuite/gdb.base/skip-solib.exp +++ b/gdb/testsuite/gdb.base/skip-solib.exp @@ -72,7 +72,7 @@ with_test_prefix "ignoring solib file" { "Num\\s+Enb\\s+Glob\\s+File\\s+RE\\s+Function\\s*" \ "1\\s+y\\s+n\\s+${srcfile_lib}\\s+n\\s+<none>\\s*"] - if ![runto_main] { + if {![runto_main]} { return } @@ -94,7 +94,7 @@ with_test_prefix "ignoring solib function" { "Function multiply will be skipped when stepping\\." \ "skip function" - if ![runto_main] { + if {![runto_main]} { return } diff --git a/gdb/testsuite/gdb.base/skip.exp b/gdb/testsuite/gdb.base/skip.exp index 0c84cf9..3e2f162 100644 --- a/gdb/testsuite/gdb.base/skip.exp +++ b/gdb/testsuite/gdb.base/skip.exp @@ -49,7 +49,7 @@ gdb_test "skip -rfunction" "Missing value for -rfunction option." gdb_test "skip -x" "Invalid skip option: -x" gdb_test "skip -rfu foo.* xyzzy" "Invalid argument: xyzzy" -if ![runto_main] { +if {![runto_main]} { return } @@ -93,7 +93,7 @@ gdb_test "info skip" \ # files, so when we step into the first line in main(), we should step # right over it and go to the second line of main(). -if ![runto_main] { +if {![runto_main]} { return } @@ -121,7 +121,7 @@ with_test_prefix "step after deleting 1" { "4\\s+y\\s+n\\s+<none>\\s+n\\s+baz"] \ "info skip (delete 1)" - if ![runto_main] { + if {![runto_main]} { return } @@ -164,7 +164,7 @@ with_test_prefix "step after disabling 3" { "3\\s+n\\s+n\\s+$srcfile1\\s+n\\s+<none>\\s*" \ "info skip shows entry as disabled" - if ![runto_main] { + if {![runto_main]} { return } @@ -180,7 +180,7 @@ with_test_prefix "step after enable 3" { "3\\s+y\\s+n\\s+$srcfile1\\s+n\\s+<none>\\s*" \ "info skip shows entry as enabled" - if ![runto_main] { + if {![runto_main]} { return } @@ -247,7 +247,7 @@ gdb_test "skip -fu baz" "Function baz will be skipped when stepping\." gdb_test "skip -rfu ^b.z$" "Function\\(s\\) \\^b\\.z\\$ will be skipped when stepping." with_test_prefix "step using -fi" { - if ![runto_main] { + if {![runto_main]} { return } @@ -257,7 +257,7 @@ with_test_prefix "step using -fi" { } with_test_prefix "step using -gfi" { - if ![runto_main] { + if {![runto_main]} { return } @@ -267,7 +267,7 @@ with_test_prefix "step using -gfi" { } with_test_prefix "step using -fu for baz" { - if ![runto_main] { + if {![runto_main]} { return } @@ -278,7 +278,7 @@ with_test_prefix "step using -fu for baz" { } with_test_prefix "step using -rfu for baz" { - if ![runto_main] { + if {![runto_main]} { return } @@ -293,7 +293,7 @@ with_test_prefix "step using -rfu for baz" { with_test_prefix "step using -fi + -fu" { gdb_test_no_output "skip delete" - if ![runto test_skip_file_and_function] { + if {![runto test_skip_file_and_function]} { return } @@ -311,7 +311,7 @@ with_test_prefix "skip delete completion" { global binfile clean_restart gdb_load $binfile - if ![runto_main] { + if {![runto_main]} { return } diff --git a/gdb/testsuite/gdb.base/skipcxx.exp b/gdb/testsuite/gdb.base/skipcxx.exp index ec440ab..29f9254 100644 --- a/gdb/testsuite/gdb.base/skipcxx.exp +++ b/gdb/testsuite/gdb.base/skipcxx.exp @@ -23,7 +23,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} { return -1 } -if ![runto_main] { +if {![runto_main]} { return } diff --git a/gdb/testsuite/gdb.base/solib-corrupted.exp b/gdb/testsuite/gdb.base/solib-corrupted.exp index a9cc59d..9b5556d 100644 --- a/gdb/testsuite/gdb.base/solib-corrupted.exp +++ b/gdb/testsuite/gdb.base/solib-corrupted.exp @@ -30,7 +30,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { # corruption cannot be tested. Disable the probes interface. gdb_test "maint ignore-probes rtld" -if ![runto_main] { +if {![runto_main]} { return } diff --git a/gdb/testsuite/gdb.base/solib-nodir.exp b/gdb/testsuite/gdb.base/solib-nodir.exp index 510164c..249f494 100644 --- a/gdb/testsuite/gdb.base/solib-nodir.exp +++ b/gdb/testsuite/gdb.base/solib-nodir.exp @@ -53,7 +53,7 @@ gdb_test_no_output "set cwd ${binlibfiledir}" \ "set cwd OBJDIR/${subdir}" set test "library loaded" -if [runto_main] { +if {[runto_main]} { pass $test } else { fail $test diff --git a/gdb/testsuite/gdb.base/solib-overlap.exp b/gdb/testsuite/gdb.base/solib-overlap.exp index ce18607..893deb6 100644 --- a/gdb/testsuite/gdb.base/solib-overlap.exp +++ b/gdb/testsuite/gdb.base/solib-overlap.exp @@ -42,7 +42,7 @@ set srcfile ${srcdir}/${subdir}/${testfile}.c # Prelink first lib1 at 0x40000000 and lib2 at 0x41000000. # During second pass try lib1 at 0x50000000 and lib2 at 0x51000000. foreach prelink_lib1 {0x40000000 0x50000000} { with_test_prefix "$prelink_lib1" { - set prelink_lib2 [format "0x%x" [expr $prelink_lib1 + 0x01000000]] + set prelink_lib2 [format "0x%x" [expr {$prelink_lib1 + 0x01000000}]] # Library file. set binfile_lib1 [standard_output_file ${libname}1-${prelink_lib1}.so] @@ -64,8 +64,8 @@ foreach prelink_lib1 {0x40000000 0x50000000} { with_test_prefix "$prelink_lib1" return -1 } - if {[catch "exec prelink -N -r ${prelink_lib1} ${binfile_lib1}" output] != 0 - || [catch "exec prelink -N -r ${prelink_lib2} ${binfile_lib2}" output] != 0} { + if {[catch {exec prelink -N -r ${prelink_lib1} ${binfile_lib1}} output] != 0 + || [catch {exec prelink -N -r ${prelink_lib2} ${binfile_lib2}} output] != 0} { # Maybe we don't have prelink. verbose -log "prelink failed: $output" untested "could not prelink ${binfile_lib1_test_msg} or ${binfile_lib2_test_msg}." diff --git a/gdb/testsuite/gdb.base/solib-weak.exp b/gdb/testsuite/gdb.base/solib-weak.exp index 511ef37..f9b8856 100644 --- a/gdb/testsuite/gdb.base/solib-weak.exp +++ b/gdb/testsuite/gdb.base/solib-weak.exp @@ -69,7 +69,7 @@ proc do_test { lib1opts lib2opts lib1first } { set lib1 [standard_output_file ${libfile1}.sl] set lib2 [standard_output_file ${libfile2}.sl] - if $lib1first { + if {$lib1first} { set exec_opts [list debug shlib=${lib1} shlib=${lib2}] set expected_file ${libfile1} } else { diff --git a/gdb/testsuite/gdb.base/source-dir.exp b/gdb/testsuite/gdb.base/source-dir.exp index e07a117..96f5a7c 100644 --- a/gdb/testsuite/gdb.base/source-dir.exp +++ b/gdb/testsuite/gdb.base/source-dir.exp @@ -83,7 +83,7 @@ proc test_truncated_comp_dir {} { # All of these pathname and directory manipulations assume # host == build, so do not attempt this set of tests on remote host. - if [is_remote host] { + if {[is_remote host]} { return } diff --git a/gdb/testsuite/gdb.base/sss-bp-on-user-bp-2.exp b/gdb/testsuite/gdb.base/sss-bp-on-user-bp-2.exp index 15c0fda..0ded183 100644 --- a/gdb/testsuite/gdb.base/sss-bp-on-user-bp-2.exp +++ b/gdb/testsuite/gdb.base/sss-bp-on-user-bp-2.exp @@ -41,7 +41,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} { return -1 } -if ![runto_main] { +if {![runto_main]} { return 0 } @@ -140,7 +140,7 @@ gdb_test_multiple "" $test { set disasm_after [disassemble "after"] set test "before/after disassembly matches" -if ![string compare $disasm_before $disasm_after] { +if {![string compare $disasm_before $disasm_after]} { pass $test } else { fail $test diff --git a/gdb/testsuite/gdb.base/stale-infcall.exp b/gdb/testsuite/gdb.base/stale-infcall.exp index 158f3f7..1d2c655 100644 --- a/gdb/testsuite/gdb.base/stale-infcall.exp +++ b/gdb/testsuite/gdb.base/stale-infcall.exp @@ -19,7 +19,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/stap-probe.exp b/gdb/testsuite/gdb.base/stap-probe.exp index c487a9f..4d8efc1 100644 --- a/gdb/testsuite/gdb.base/stap-probe.exp +++ b/gdb/testsuite/gdb.base/stap-probe.exp @@ -60,8 +60,8 @@ proc gdb_count_probes { type provider name { object "" }} { } } - if { [expr $no_probes_line && $probe_count > 0] \ - || [expr !$no_probes_line && $probe_count == 0] } { + if { ($no_probes_line && $probe_count > 0) \ + || (!$no_probes_line && $probe_count == 0) } { perror "Mismatch between no probes found line, and probes count" return -1 } @@ -74,7 +74,7 @@ proc check_for_usable_xmm0_probe { binfile } { set binfile [standard_output_file $binfile] set command "exec $readelf_program -n $binfile" 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" @@ -89,7 +89,7 @@ proc check_for_usable_xmm0_probe { binfile } { # First, look for the xmmreg probe, and if we find it, grab the # argument string. - if ![regexp {\n\s+Provider: test\n\s+Name: xmmreg\n[^\n]+\n\s+Arguments: ([^\n]+)\n} $output ignore arguments] { + if {![regexp {\n\s+Provider: test\n\s+Name: xmmreg\n[^\n]+\n\s+Arguments: ([^\n]+)\n} $output ignore arguments]} { verbose -log "APB: Couldn't find probe at all" return false } @@ -98,7 +98,7 @@ proc check_for_usable_xmm0_probe { binfile } { verbose -log "APB: arguments: '$arguments'" # Check the the argument string mentions xmm0. - if ![regexp {@%?xmm0} $arguments] { + if {![regexp {@%?xmm0} $arguments]} { verbose -log "APB: Prove doesn't use xmm0 register" return false } @@ -133,7 +133,7 @@ proc stap_test {exec_name {args ""}} { "get original address of relocation_marker"] } - if ![runto_main] { + if {![runto_main]} { return -1 } @@ -159,7 +159,7 @@ proc stap_test {exec_name {args ""}} { [get_hexadecimal_valueof "&relocation_marker" \ "0" "get revised relocation_marker address"] set relocation_base \ - [expr $updated_semaphore_addr_var - $semaphore_addr_var] + [expr {$updated_semaphore_addr_var - $semaphore_addr_var}] if {$relocation_base != 0} { # Checks that GDB doesn't mistakenly relocate and write to null # semaphore addresses. If it were to relocate a zero-valued @@ -219,7 +219,7 @@ proc stap_test {exec_name {args ""}} { "print \$_probe_arg1 for probe ps" # Check the probe is using the xmm0 register. - if [check_for_usable_xmm0_probe $exec_name] { + if {[check_for_usable_xmm0_probe $exec_name]} { delete_breakpoints if {[runto "-pstap test:xmmreg"]} { diff --git a/gdb/testsuite/gdb.base/startup-with-shell.exp b/gdb/testsuite/gdb.base/startup-with-shell.exp index a6ebb57..6872369 100644 --- a/gdb/testsuite/gdb.base/startup-with-shell.exp +++ b/gdb/testsuite/gdb.base/startup-with-shell.exp @@ -22,7 +22,7 @@ require !use_gdb_stub # (via dejagnu) yet. require {!is_remote target} -require {expr [have_startup_shell] != -1} +require {expr {[have_startup_shell] != -1}} standard_testfile diff --git a/gdb/testsuite/gdb.base/step-into-other-file.exp b/gdb/testsuite/gdb.base/step-into-other-file.exp index 64403a1..80fc55e 100644 --- a/gdb/testsuite/gdb.base/step-into-other-file.exp +++ b/gdb/testsuite/gdb.base/step-into-other-file.exp @@ -26,7 +26,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile \ return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/step-over-exit.exp b/gdb/testsuite/gdb.base/step-over-exit.exp index 6dfa7bb..105157d 100644 --- a/gdb/testsuite/gdb.base/step-over-exit.exp +++ b/gdb/testsuite/gdb.base/step-over-exit.exp @@ -38,7 +38,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/step-over-no-symbols.exp b/gdb/testsuite/gdb.base/step-over-no-symbols.exp index 1a91986..24e3bf7 100644 --- a/gdb/testsuite/gdb.base/step-over-no-symbols.exp +++ b/gdb/testsuite/gdb.base/step-over-no-symbols.exp @@ -50,7 +50,7 @@ proc test_step_over { displaced } { clean_restart gdb_load $binfile - if ![runto_main] { + if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/step-over-syscall.exp b/gdb/testsuite/gdb.base/step-over-syscall.exp index 9df716d..e4425a1 100644 --- a/gdb/testsuite/gdb.base/step-over-syscall.exp +++ b/gdb/testsuite/gdb.base/step-over-syscall.exp @@ -227,7 +227,7 @@ proc step_over_syscall { syscall } { lappend options "pthreads" } - if [build_executable ${testfile}.exp ${testfile} ${testfile}.c $options] { + if {[build_executable ${testfile}.exp ${testfile} ${testfile}.c $options]} { untested "failed to compile" return -1 } diff --git a/gdb/testsuite/gdb.base/step-resume-infcall.exp b/gdb/testsuite/gdb.base/step-resume-infcall.exp index 4010c76..f1f8dc2 100644 --- a/gdb/testsuite/gdb.base/step-resume-infcall.exp +++ b/gdb/testsuite/gdb.base/step-resume-infcall.exp @@ -19,7 +19,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} $srcfile] } { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } @@ -27,7 +27,7 @@ gdb_test "step" " in-func .*" gdb_test "up" " call-func .*" gdb_test_no_output {set $b=$pc} -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/step-sw-breakpoint-adjust-pc.exp b/gdb/testsuite/gdb.base/step-sw-breakpoint-adjust-pc.exp index 2dde3bb..b10465f 100644 --- a/gdb/testsuite/gdb.base/step-sw-breakpoint-adjust-pc.exp +++ b/gdb/testsuite/gdb.base/step-sw-breakpoint-adjust-pc.exp @@ -21,7 +21,7 @@ standard_testfile -if [build_executable "failed to build" ${testfile} ${srcfile} {debug}] { +if {[build_executable "failed to build" ${testfile} ${srcfile} {debug}]} { return -1 } @@ -43,7 +43,7 @@ proc test {non_stop displaced always_inserted} { gdb_test_no_output "set displaced-stepping $displaced" gdb_test_no_output "set breakpoint always-inserted $always_inserted" - if ![runto_main] { + if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/step-symless.exp b/gdb/testsuite/gdb.base/step-symless.exp index 07df253..47e4682 100644 --- a/gdb/testsuite/gdb.base/step-symless.exp +++ b/gdb/testsuite/gdb.base/step-symless.exp @@ -21,7 +21,7 @@ if {[build_executable ${testfile}.exp ${testfile} ${srcfile} {nodebug}] == -1} { # We need those symbols global to access them from the .S file. set test "strip stub symbols" set objcopy_program [gdb_find_objcopy] -set result [catch "exec $objcopy_program -N symless ${binfile}" output] +set result [catch {exec $objcopy_program -N symless ${binfile}} output] verbose "result is $result" verbose "output is $output" if {$result != 0} { @@ -32,7 +32,7 @@ pass $test clean_restart $testfile -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/step-test.exp b/gdb/testsuite/gdb.base/step-test.exp index 39833a3..cfcf511 100644 --- a/gdb/testsuite/gdb.base/step-test.exp +++ b/gdb/testsuite/gdb.base/step-test.exp @@ -33,7 +33,7 @@ if {![runto_main]} { # Set a breakpoint at line 45, if stepi then finish fails, we would # run to the end of the program, which would mess up the rest of the tests. - + # Vanilla step/next # gdb_test "next" ".*${decimal}.*x = 1;.*" "next 1" @@ -92,10 +92,10 @@ if { [istarget "ia64-*-*"] || [istarget "mips*-*-*"]} { ### ### The exact regexps used are "$HERE.*$gdb_prompt $" ### and "$THERE.*$gdb_prompt $" -### +### proc test_i {name command here there} { global gdb_prompt - + set i 0 gdb_test_multiple "$command" "$name" { -re "$here.*$gdb_prompt $" { @@ -123,7 +123,7 @@ test_i "stepi to next line" "stepi" \ # if this passes through a (useless) PLT entry. test_i "stepi into function" "stepi" \ "(.*${decimal}.*callee.*STEPI|.* in callee@plt)" \ - ".*callee \\(\\) at .*step-test\\.c" + ".*callee \\(\\) at .*step-test\\.c" # Continue to step until we reach the function's body. This makes it # more likely that we've actually completed the prologue, so "finish" @@ -134,7 +134,7 @@ test_i "stepi into function's first source line" "stepi" \ "(${decimal}.*int callee|$pic_thunk_re)" \ ".*${decimal}.*myglob.*; return 0;" -# Have to be careful here, if the finish does not work, +# Have to be careful here, if the finish does not work, # then we may run to the end of the program, which # will cause erroneous failures in the rest of the tests set test "stepi: finish call" @@ -143,7 +143,7 @@ gdb_test_multiple "finish" "$test" { pass "$test" } -re ".*(Program received|$inferior_exited_re).*$gdb_prompt $" { - # Oops... We ran to the end of the program... Better reset + # Oops... We ran to the end of the program... Better reset if {![runto_main]} { return 0 } diff --git a/gdb/testsuite/gdb.base/structs.exp b/gdb/testsuite/gdb.base/structs.exp index fa7f786..4850a59 100644 --- a/gdb/testsuite/gdb.base/structs.exp +++ b/gdb/testsuite/gdb.base/structs.exp @@ -75,7 +75,7 @@ proc start_structs_test { types } { get_debug_format # Limit the slow $anychar_re{256} matching for better performance. - if $first { + if {$first} { set first 0 # Verify $anychar_re can match all the values of `char' type. @@ -215,7 +215,7 @@ proc test_struct_calls { n } { # Check that GDB can always extract a struct-return value from an # inferior function call. Since GDB always knows the location of an # inferior function call's return value these should never fail - + # Implemented by calling the parameterless function "fun$N" and then # examining the return value printed by GDB. @@ -364,7 +364,7 @@ proc test_struct_returns { n } { pass "${test}" } -re " = [any $n].*${gdb_prompt} $" { - if $return_value_known { + if {$return_value_known} { # This contradicts the above claim that GDB knew # the location of the return value. fail "${test}" @@ -375,7 +375,7 @@ proc test_struct_returns { n } { } } -re ".*${gdb_prompt} $" { - if $return_value_unimplemented { + if {$return_value_unimplemented} { # What a surprise. The architecture hasn't implemented # return_value, and hence has to fail. kfail "$test" gdb/1444 @@ -383,8 +383,8 @@ proc test_struct_returns { n } { fail "$test" } } - } - + } + # Check that a "finish" works. # This is almost but not quite the same as "call struct funcs". @@ -425,7 +425,7 @@ proc test_struct_returns { n } { set test "value foo<n> finished; ${tests}" gdb_test_multiple "p/c" "${test}" { -re "[foo ${n}]\[\r\n\]+${gdb_prompt} $" { - if $finish_value_known { + if {$finish_value_known} { pass "${test}" } else { # This contradicts the above claim that GDB didn't @@ -435,7 +435,7 @@ proc test_struct_returns { n } { } -re "[zed ${n}]\[\r\n\]+${gdb_prompt} $" { # The value didn't get found. This is "expected". - if $finish_value_known { + if {$finish_value_known} { # This contradicts the above claim that GDB did # know the location of the return-value. fail "${test}" diff --git a/gdb/testsuite/gdb.base/structs2.exp b/gdb/testsuite/gdb.base/structs2.exp index f377022..f0e8342 100644 --- a/gdb/testsuite/gdb.base/structs2.exp +++ b/gdb/testsuite/gdb.base/structs2.exp @@ -31,14 +31,14 @@ gdb_test "break param_reg" \ "Breakpoint .* at .*" \ "structs2 breakpoint set" -if [test_compiler_info gcc-3-*] { +if {[test_compiler_info gcc-3-*]} { setup_xfail hppa*-* gcc/15860 } gdb_test "continue" \ ".*pr_char=120.*pr_uchar=130.*pr_short=32000.*pr_ushort=33000.*bkpt = 1.*" \ "structs2 continue1" -if [test_compiler_info gcc-3-*] { +if {[test_compiler_info gcc-3-*]} { setup_xfail hppa*-* gcc/15860 } gdb_test "continue" \ diff --git a/gdb/testsuite/gdb.base/structs3.exp b/gdb/testsuite/gdb.base/structs3.exp index 6ac450f..22cda9d 100644 --- a/gdb/testsuite/gdb.base/structs3.exp +++ b/gdb/testsuite/gdb.base/structs3.exp @@ -21,7 +21,7 @@ if { [prepare_for_testing "failed to prepare" "structs3" "" {debug}] } { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/style.exp b/gdb/testsuite/gdb.base/style.exp index 92b5085..222f17e 100644 --- a/gdb/testsuite/gdb.base/style.exp +++ b/gdb/testsuite/gdb.base/style.exp @@ -163,7 +163,7 @@ proc run_style_tests { } { # - 4 leading spaces # - argv string # - closing parenthesis - set line_len [expr 4 + $argv_len + 1] + set line_len [expr {4 + $argv_len + 1}] if { $argv == "argv=0x0" && $width >= 27 } { # Embedded target with no argv support. @@ -847,14 +847,14 @@ proc previous_line_is_ok { str } { # Then compare string lengths to get a count of the '\033' # charactes present in STR. regsub -all "\033" $str {} stripped - set count [expr [string length $str] - [string length $stripped]] + set count [expr {[string length $str] - [string length $stripped]}] # If STR switched styles, then it _must_ switch back again, # otherwise the pagination prompt will be in the wrong style. # This means that there _must_ be an even number of '\033' # characters in STR. If there is not then we switched style, but # failed to switch back. - if { [expr $count % 2] != 0 } { + if {$count % 2 != 0} { return false } diff --git a/gdb/testsuite/gdb.base/symbol-alias.exp b/gdb/testsuite/gdb.base/symbol-alias.exp index c3deaf6..84ba82d 100644 --- a/gdb/testsuite/gdb.base/symbol-alias.exp +++ b/gdb/testsuite/gdb.base/symbol-alias.exp @@ -16,8 +16,8 @@ standard_testfile symbol-alias.c symbol-alias2.c # Clang versions prior to v15 do not emit debug info for aliases. -set old_clang [expr [test_compiler_info {clang-1[0-4]-*-*}] \ - || [test_compiler_info {clang-[1-9]-*}]] +set old_clang [expr {[test_compiler_info {clang-1[0-4]-*-*}] \ + || [test_compiler_info {clang-[1-9]-*}]}] if { [prepare_for_testing "failed to prepare" ${testfile} [list $srcfile $srcfile2]] } { return -1 diff --git a/gdb/testsuite/gdb.base/symtab-search-order.exp b/gdb/testsuite/gdb.base/symtab-search-order.exp index 34b1db0..aca9ca1 100644 --- a/gdb/testsuite/gdb.base/symtab-search-order.exp +++ b/gdb/testsuite/gdb.base/symtab-search-order.exp @@ -37,7 +37,7 @@ clean_restart gdb_load $binfile gdb_load_shlib $lib1 -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/testenv.exp b/gdb/testsuite/gdb.base/testenv.exp index 59cd33c..540a48f 100644 --- a/gdb/testsuite/gdb.base/testenv.exp +++ b/gdb/testsuite/gdb.base/testenv.exp @@ -75,7 +75,7 @@ proc find_env {varname} { } if {[string match "$varname=*" $var]} { - set from [expr [string first "=" $var] + 1] + set from [expr {[string first "=" $var] + 1}] set to [string length $var] return [string range $var $from $to] } @@ -95,7 +95,7 @@ proc_with_prefix test_set_unset_env {} { # First test with no TEST_GDB_VAR. with_test_prefix "test1" { - if ![run_and_count_vars] { + if {![run_and_count_vars]} { return } test_num_test_vars 0 "no TEST_GDB vars" @@ -106,7 +106,7 @@ proc_with_prefix test_set_unset_env {} { gdb_test_no_output "set env TEST_GDB_VAR1 test1" \ "set TEST_GDB_VAR1" - if ![run_and_count_vars] { + if {![run_and_count_vars]} { return } test_num_test_vars 1 "one TEST_GDB var" @@ -117,7 +117,7 @@ proc_with_prefix test_set_unset_env {} { gdb_test_no_output "set env TEST_GDB_VAR2 test2" \ "set TEST_GDB_VAR2" - if ![run_and_count_vars] { + if {![run_and_count_vars]} { return } @@ -130,7 +130,7 @@ proc_with_prefix test_set_unset_env {} { gdb_test_no_output "unset env TEST_GDB_VAR1" \ "unset TEST_GDB_VAR1" - if ![run_and_count_vars] { + if {![run_and_count_vars]} { return } @@ -145,7 +145,7 @@ proc_with_prefix test_inherit_env_var {} { # This test assumes that the build's environ (where dejagnu runs) # is the same as the host's (where gdb runs) environ. - if [is_remote host] { + if {[is_remote host]} { return } @@ -159,7 +159,7 @@ proc_with_prefix test_inherit_env_var {} { # First test with only inherited TEST_GDB_GLOBAL. with_test_prefix "test1" { - if ![run_and_count_vars] { + if {![run_and_count_vars]} { return } @@ -179,7 +179,7 @@ proc_with_prefix test_inherit_env_var {} { gdb_test_no_output "unset env TEST_GDB_GLOBAL" \ "unset TEST_GDB_GLOBAL" - if ![run_and_count_vars] { + if {![run_and_count_vars]} { return } diff --git a/gdb/testsuite/gdb.base/tls-common.exp.tcl b/gdb/testsuite/gdb.base/tls-common.exp.tcl index fc212a9..a17409f 100644 --- a/gdb/testsuite/gdb.base/tls-common.exp.tcl +++ b/gdb/testsuite/gdb.base/tls-common.exp.tcl @@ -33,7 +33,7 @@ set internal_tls_linux_targets {"x86_64-*-linux*" "aarch64-*-linux*" # use of internal TLS support for architectures which don't support # it. -if [is_any_target {*}$internal_tls_linux_targets] { +if {[is_any_target {*}$internal_tls_linux_targets]} { set internal_tls_iters { false true } } else { set internal_tls_iters { false } @@ -43,7 +43,7 @@ if [is_any_target {*}$internal_tls_linux_targets] { # issue gdb_test with command CMD and regular expression RE. proc gdb_test_with_kfail {cmd re kfail_cond kfail_msg} { - if [uplevel 1 [list expr $kfail_cond]] { + if {[uplevel 1 [list expr $kfail_cond]]} { setup_kfail $kfail_msg *-*-* } gdb_test $cmd $re diff --git a/gdb/testsuite/gdb.base/tls-dlobj.exp b/gdb/testsuite/gdb.base/tls-dlobj.exp index 1509ec8..9b70799 100644 --- a/gdb/testsuite/gdb.base/tls-dlobj.exp +++ b/gdb/testsuite/gdb.base/tls-dlobj.exp @@ -46,7 +46,7 @@ proc gdb_test_with_xfail { cmd re cond} { pass $gdb_test_name } -re -wrap "The inferior has not yet allocated storage for thread-local variables.*" { - if [ uplevel 1 [list expr $cond]] { + if {[ uplevel 1 [list expr $cond]]} { xfail $gdb_test_name } else { fail $gdb_test_name @@ -58,11 +58,11 @@ proc gdb_test_with_xfail { cmd re cond} { proc do_tests {force_internal_tls} { clean_restart gdb_load $::binfile - if ![runto_main] { + if {![runto_main]} { return } - if $force_internal_tls { + if {$force_internal_tls} { gdb_test_no_output "maint set force-internal-tls-address-lookup on" } @@ -285,7 +285,7 @@ proc do_tests {force_internal_tls} { } # Finish test early if no core file was made. - if !$core_supported { + if {!$core_supported} { return } @@ -298,7 +298,7 @@ proc do_tests {force_internal_tls} { } with_test_prefix "core file" { - if $force_internal_tls { + if {$force_internal_tls} { gdb_test_no_output "maint set force-internal-tls-address-lookup on" } diff --git a/gdb/testsuite/gdb.base/tls-multiobj.exp b/gdb/testsuite/gdb.base/tls-multiobj.exp index eb3721e..14bbfc9 100644 --- a/gdb/testsuite/gdb.base/tls-multiobj.exp +++ b/gdb/testsuite/gdb.base/tls-multiobj.exp @@ -28,11 +28,11 @@ set lib3obj [standard_output_file "${testfile}3-lib.so"] proc do_tests {force_internal_tls {do_kfail_tls_access 0}} { clean_restart gdb_load $::binfile - if ![runto_main] { + if {![runto_main]} { return } - if $force_internal_tls { + if {$force_internal_tls} { gdb_test_no_output "maint set force-internal-tls-address-lookup on" } @@ -52,7 +52,7 @@ proc do_tests {force_internal_tls {do_kfail_tls_access 0}} { # Also turn off do_kfail_tls_access when connected to a # gdbserver and we observe that accessing a TLS variable # works. - if [target_is_gdbserver] { + if {[target_is_gdbserver]} { gdb_test_multiple "print tls_main_tbss_1" \ "Check TLS accessibility when connected to a gdbserver" { -re -wrap "= 0" { @@ -125,7 +125,7 @@ proc do_tests {force_internal_tls {do_kfail_tls_access 0}} { } # Finish test early if no core file was made. - if !$core_supported { + if {!$core_supported} { return } @@ -138,7 +138,7 @@ proc do_tests {force_internal_tls {do_kfail_tls_access 0}} { } with_test_prefix "core file" { - if $force_internal_tls { + if {$force_internal_tls} { gdb_test_no_output "maint set force-internal-tls-address-lookup on" } diff --git a/gdb/testsuite/gdb.base/tls-nothreads.exp b/gdb/testsuite/gdb.base/tls-nothreads.exp index c7b1476..fe3ce80 100644 --- a/gdb/testsuite/gdb.base/tls-nothreads.exp +++ b/gdb/testsuite/gdb.base/tls-nothreads.exp @@ -20,11 +20,11 @@ standard_testfile proc do_tests {force_internal_tls {do_kfail_tls_access 0}} { clean_restart gdb_load $::binfile - if ![runto_main] { + if {![runto_main]} { return } - if $force_internal_tls { + if {$force_internal_tls} { gdb_test_no_output "maint set force-internal-tls-address-lookup on" } @@ -44,7 +44,7 @@ proc do_tests {force_internal_tls {do_kfail_tls_access 0}} { # Also turn off do_kfail_tls_access when connected to a # gdbserver and we observe that accessing a TLS variable # works. - if [target_is_gdbserver] { + if {[target_is_gdbserver]} { gdb_test_multiple "print tls_tbss_1" "Check TLS accessibility when connected to a gdbserver" { -re -wrap "= 0" { set do_kfail_tls_access 0 @@ -105,14 +105,14 @@ proc do_tests {force_internal_tls {do_kfail_tls_access 0}} { set binfile_stripped "${::binfile}.stripped" set objcopy [gdb_find_objcopy] set cmd "$objcopy --strip-debug ${::binfile} $binfile_stripped" - if ![catch "exec $cmd" cmd_output] { + if {![catch {exec {*}$cmd} cmd_output]} { clean_restart gdb_load $binfile_stripped - if ![runto_main] { + if {![runto_main]} { return } - if $force_internal_tls { + if {$force_internal_tls} { gdb_test_no_output "maint set force-internal-tls-address-lookup on" } @@ -153,7 +153,7 @@ proc do_tests {force_internal_tls {do_kfail_tls_access 0}} { } # Finish test early if no core file was made. - if !$core_supported { + if {!$core_supported} { return } @@ -166,7 +166,7 @@ proc do_tests {force_internal_tls {do_kfail_tls_access 0}} { } with_test_prefix "core file" { - if $force_internal_tls { + if {$force_internal_tls} { gdb_test_no_output "maint set force-internal-tls-address-lookup on" } diff --git a/gdb/testsuite/gdb.base/twice.exp b/gdb/testsuite/gdb.base/twice.exp index 995cd4d..83d271d 100644 --- a/gdb/testsuite/gdb.base/twice.exp +++ b/gdb/testsuite/gdb.base/twice.exp @@ -48,4 +48,4 @@ if {[runto_main]} { gdb_test "step" "nothing \\(\\) at.*" } -remote_exec build "rm -f twice.c" +remote_exec build "rm -f twice.c" diff --git a/gdb/testsuite/gdb.base/ui-redirect.exp b/gdb/testsuite/gdb.base/ui-redirect.exp index 24742b8..c758697 100644 --- a/gdb/testsuite/gdb.base/ui-redirect.exp +++ b/gdb/testsuite/gdb.base/ui-redirect.exp @@ -20,7 +20,7 @@ if { [prepare_for_testing "failed to prepare" ui-redirect start.c] } { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/until-nodebug.exp b/gdb/testsuite/gdb.base/until-nodebug.exp index 9d8d097..bd327a10 100644 --- a/gdb/testsuite/gdb.base/until-nodebug.exp +++ b/gdb/testsuite/gdb.base/until-nodebug.exp @@ -22,7 +22,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile nodebug]} { return -1 } -if ![runto_main] { +if {![runto_main]} { return 0 } diff --git a/gdb/testsuite/gdb.base/until-trailing-insns.exp b/gdb/testsuite/gdb.base/until-trailing-insns.exp index cc28adc..4456812 100644 --- a/gdb/testsuite/gdb.base/until-trailing-insns.exp +++ b/gdb/testsuite/gdb.base/until-trailing-insns.exp @@ -160,7 +160,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \ return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/unwind-on-each-insn-amd64-2.exp b/gdb/testsuite/gdb.base/unwind-on-each-insn-amd64-2.exp index 51601f9..0e307d3 100644 --- a/gdb/testsuite/gdb.base/unwind-on-each-insn-amd64-2.exp +++ b/gdb/testsuite/gdb.base/unwind-on-each-insn-amd64-2.exp @@ -27,7 +27,7 @@ lappend srcfile_flags nopie set ldflags $srcfile_flags -if [info exists COMPILE] { +if {[info exists COMPILE]} { # Make sure that we use .eh_frame info, by generating it # using -fasynchronous-unwind-tables. if { [gdb_can_simple_compile fasynchronous-unwind-tables \ diff --git a/gdb/testsuite/gdb.base/unwind-on-each-insn-amd64.exp b/gdb/testsuite/gdb.base/unwind-on-each-insn-amd64.exp index c874930..08944f9 100644 --- a/gdb/testsuite/gdb.base/unwind-on-each-insn-amd64.exp +++ b/gdb/testsuite/gdb.base/unwind-on-each-insn-amd64.exp @@ -24,7 +24,7 @@ lappend srcfile_flags nopie set srcfile2_flags $srcfile_flags set ldflags $srcfile_flags -if [info exists COMPILE] { +if {[info exists COMPILE]} { standard_testfile unwind-on-each-insn.c unwind-on-each-insn-foo.c # When updating the .s file, use these flags to generate the file: #lappend srcfile2_flags additional_flags=-save-temps diff --git a/gdb/testsuite/gdb.base/unwind-on-each-insn-i386.exp b/gdb/testsuite/gdb.base/unwind-on-each-insn-i386.exp index ad3b702..0285c54 100644 --- a/gdb/testsuite/gdb.base/unwind-on-each-insn-i386.exp +++ b/gdb/testsuite/gdb.base/unwind-on-each-insn-i386.exp @@ -24,7 +24,7 @@ lappend srcfile_flags nopie set srcfile2_flags $srcfile_flags set ldflags $srcfile_flags -if [info exists COMPILE] { +if {[info exists COMPILE]} { standard_testfile unwind-on-each-insn.c unwind-on-each-insn-foo.c # When updating the .s file, use these flags to generate the file: #lappend srcfile2_flags additional_flags=-save-temps diff --git a/gdb/testsuite/gdb.base/utf8-identifiers.exp b/gdb/testsuite/gdb.base/utf8-identifiers.exp index fe868e5..8d19dbc 100644 --- a/gdb/testsuite/gdb.base/utf8-identifiers.exp +++ b/gdb/testsuite/gdb.base/utf8-identifiers.exp @@ -23,7 +23,7 @@ load_lib completion-support.exp if { [is_c_compiler_gcc] } { # Gcc fully supports fextended-identifiers starting GCC 5. - require {expr [gcc_major_version] >= 5} + require {expr {[gcc_major_version] >= 5}} } require {have_host_locale C.UTF-8} @@ -36,7 +36,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} [list $srcfile]] } { return -1 } -if ![runto done] { +if {![runto done]} { return } diff --git a/gdb/testsuite/gdb.base/valgrind-infcall.exp b/gdb/testsuite/gdb.base/valgrind-infcall.exp index 11cd49d..3b06c1d 100644 --- a/gdb/testsuite/gdb.base/valgrind-infcall.exp +++ b/gdb/testsuite/gdb.base/valgrind-infcall.exp @@ -54,7 +54,7 @@ while {$loop && $continue_count < 100} { pass "$test (false warning)" } } - set continue_count [expr $continue_count + 1] + set continue_count [expr {$continue_count + 1}] } set test "p gdb_test_infcall ()" diff --git a/gdb/testsuite/gdb.base/value-double-free.exp b/gdb/testsuite/gdb.base/value-double-free.exp index c3fbbb6..8395b97 100644 --- a/gdb/testsuite/gdb.base/value-double-free.exp +++ b/gdb/testsuite/gdb.base/value-double-free.exp @@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/value-history-unavailable.exp b/gdb/testsuite/gdb.base/value-history-unavailable.exp index b17764e..6794953 100644 --- a/gdb/testsuite/gdb.base/value-history-unavailable.exp +++ b/gdb/testsuite/gdb.base/value-history-unavailable.exp @@ -27,11 +27,11 @@ if {![runto_main]} { set target_char_mask [get_valueof "/u" "a.x\[0]" "255" "get target char mask"] set target_char_bit 0 -for {set i $target_char_mask} {$i > 0} {set i [expr $i >> 1]} { +for {set i $target_char_mask} {$i > 0} {set i [expr {$i >> 1}]} { incr target_char_bit } set target_char_rank -1 -for {set i $target_char_bit} {$i > 0} {set i [expr $i >> 1]} { +for {set i $target_char_bit} {$i > 0} {set i [expr {$i >> 1}]} { incr target_char_rank } diff --git a/gdb/testsuite/gdb.base/varargs.exp b/gdb/testsuite/gdb.base/varargs.exp index 534971c..d25ae26 100644 --- a/gdb/testsuite/gdb.base/varargs.exp +++ b/gdb/testsuite/gdb.base/varargs.exp @@ -36,7 +36,7 @@ set allow_float_test [allow_float_test] set flags {} lappend flags debug lappend_include_file flags $srcdir/lib/unbuffer_output.c -if [support_complex_tests] { +if {[support_complex_tests]} { lappend flags "additional_flags=-DTEST_COMPLEX" } @@ -56,7 +56,7 @@ gdb_test_no_output "set print address off" gdb_test_no_output "set width 0" -if [gdb_skip_stdio_test "varargs.exp"] { +if {[gdb_skip_stdio_test "varargs.exp"]} { # Nothing in this module is testable without printf. return } @@ -93,7 +93,7 @@ if {$allow_float_test} { # Test _Complex type here if supported. -if [support_complex_tests] { +if {[support_complex_tests]} { global gdb_prompt set test "print find_max_float_real(4, fc1, fc2, fc3, fc4)" diff --git a/gdb/testsuite/gdb.base/vla-datatypes.exp b/gdb/testsuite/gdb.base/vla-datatypes.exp index 4a08de3..a116123 100644 --- a/gdb/testsuite/gdb.base/vla-datatypes.exp +++ b/gdb/testsuite/gdb.base/vla-datatypes.exp @@ -19,7 +19,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/vla-optimized-out.exp b/gdb/testsuite/gdb.base/vla-optimized-out.exp index 3119097..316043d 100644 --- a/gdb/testsuite/gdb.base/vla-optimized-out.exp +++ b/gdb/testsuite/gdb.base/vla-optimized-out.exp @@ -33,7 +33,7 @@ proc vla_optimized_out {exe_suffix options} { return -1 } - if ![runto f1] { + if {![runto f1]} { return } diff --git a/gdb/testsuite/gdb.base/vla-ptr.exp b/gdb/testsuite/gdb.base/vla-ptr.exp index 6db0b9a..22ac0a3 100644 --- a/gdb/testsuite/gdb.base/vla-ptr.exp +++ b/gdb/testsuite/gdb.base/vla-ptr.exp @@ -20,7 +20,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/vla-sideeffect.exp b/gdb/testsuite/gdb.base/vla-sideeffect.exp index 942d111..158ae35 100644 --- a/gdb/testsuite/gdb.base/vla-sideeffect.exp +++ b/gdb/testsuite/gdb.base/vla-sideeffect.exp @@ -22,7 +22,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } @@ -31,7 +31,8 @@ gdb_continue_to_breakpoint "vla-filled" # Check side effects for sizeof argument. set sizeof_int [get_sizeof "int" 4] -set sizeof_vla [ expr "10" * "$sizeof_int" ] + +set sizeof_vla [expr {10 * $sizeof_int}] gdb_test "print sizeof (vla1\[i++\])" " = ${sizeof_int}" gdb_test "print i" " = 0" \ diff --git a/gdb/testsuite/gdb.base/vla-struct-fields.exp b/gdb/testsuite/gdb.base/vla-struct-fields.exp index 68f9269..72af212 100644 --- a/gdb/testsuite/gdb.base/vla-struct-fields.exp +++ b/gdb/testsuite/gdb.base/vla-struct-fields.exp @@ -22,7 +22,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/volatile.exp b/gdb/testsuite/gdb.base/volatile.exp index 35aa1cf..e85d415 100644 --- a/gdb/testsuite/gdb.base/volatile.exp +++ b/gdb/testsuite/gdb.base/volatile.exp @@ -27,7 +27,7 @@ # const volatile pointers to const vars # const volatile pointers to volatile vars # ... etc. (you get the idea) -# Mostly with char and unsigned char. +# Mostly with char and unsigned char. # # test running programs @@ -54,7 +54,7 @@ proc local_compiler_xfail_check { } { if {[test_compiler_info gcc-2-*]} { if { ![test_debug_format "HP"] \ && ![test_debug_format "DWARF \[0-9\]"] } then { - setup_xfail "*-*-*" + setup_xfail "*-*-*" } } } diff --git a/gdb/testsuite/gdb.base/watchpoint-cond-gone.exp b/gdb/testsuite/gdb.base/watchpoint-cond-gone.exp index 21b60fc..c789c60 100644 --- a/gdb/testsuite/gdb.base/watchpoint-cond-gone.exp +++ b/gdb/testsuite/gdb.base/watchpoint-cond-gone.exp @@ -27,7 +27,7 @@ if {[prepare_for_testing_full "failed to prepare" \ # Problem does not occur otherwise. gdb_test_no_output "set can-use-hw-watchpoints 0" -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/watchpoint-delete.exp b/gdb/testsuite/gdb.base/watchpoint-delete.exp index 3013b70..cdf532f 100644 --- a/gdb/testsuite/gdb.base/watchpoint-delete.exp +++ b/gdb/testsuite/gdb.base/watchpoint-delete.exp @@ -22,7 +22,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { # It is more compatible this way. gdb_test_no_output "set can-use-hw-watchpoints 0" -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/watchpoint-hw-hit-once.exp b/gdb/testsuite/gdb.base/watchpoint-hw-hit-once.exp index ba60c90..906654e 100644 --- a/gdb/testsuite/gdb.base/watchpoint-hw-hit-once.exp +++ b/gdb/testsuite/gdb.base/watchpoint-hw-hit-once.exp @@ -21,7 +21,7 @@ if { [prepare_for_testing "failed to prepare" ${test} ${srcfile}] } { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp b/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp index 994228f..23ef746 100644 --- a/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp +++ b/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp @@ -158,7 +158,7 @@ proc valid_addr_p {cmd offset width} { # registers to represent the whole unaligned region. Breakpoint # addresses must still be aligned though. if {$cmd == "hbreak" } { - if { [expr ($offset) % 4] != 0 } { + if {$offset % 4 != 0} { return 0 } } @@ -170,20 +170,20 @@ proc valid_addr_p {cmd offset width} { } } else { # Watchpoints can be of length 1, 2, 4 or 8 bytes. - if { [expr $width % 2] != 0 } { + if { $width % 2 != 0 } { return 0 } } - if { [expr ($offset) % 8] == 0 && $width == 8 } { + if {$offset % 8 == 0 && $width == 8} { # If WIDTH is 8 byte, the address should be 8-byte aligned. return 1 - } elseif { [expr ($offset) % 4] == 0 } { + } elseif {$offset % 4 == 0} { return 1 - } elseif { [expr ($offset) % 4] == 2 && $width == 2 } { + } elseif {$offset % 4 == 2 && $width == 2} { # Halfword watchpoints and breakpoints. return 1 - } elseif { [expr ($offset) % 4] == 1 && $width == 1 && $cmd != "hbreak" } { + } elseif {$offset % 4 == 1 && $width == 1 && $cmd != "hbreak"} { # Single byte watchpoints. return 1 } else { @@ -249,7 +249,7 @@ proc run_watchpoints_tests {hw_wp_p} { for {set x 0} {$x < 4} {incr x} { if { ![valid_addr_p $cmd1 $x $width] - || ![valid_addr_p $cmd2 $x+1 $width] } { + || ![valid_addr_p $cmd2 [expr {$x+1}] $width] } { # Skip tests if requested address or length # of breakpoint or watchpoint don't meet # target or kernel requirements. diff --git a/gdb/testsuite/gdb.base/watchpoint-running.exp b/gdb/testsuite/gdb.base/watchpoint-running.exp index 04c4c52..61c1f8c 100644 --- a/gdb/testsuite/gdb.base/watchpoint-running.exp +++ b/gdb/testsuite/gdb.base/watchpoint-running.exp @@ -22,7 +22,7 @@ set allow_hw_watchpoint_tests_p [allow_hw_watchpoint_tests] standard_testfile -if [build_executable "failed to prepare" $testfile $srcfile {debug}] { +if {[build_executable "failed to prepare" $testfile $srcfile {debug}]} { return -1 } @@ -87,7 +87,7 @@ proc test {stop_mode hw} { # sufficient time to ever wrap around.) gdb_assert {$val1 != $val2} "values are different" - set wp_str [expr ($hw)?"Hardware watchpoint":"Watchpoint"] + set wp_str [expr {($hw)?"Hardware watchpoint":"Watchpoint"}] # Now set a watchpoint, while the inferior is running. Since # we're watching a global, and we can read global memory while the @@ -130,7 +130,7 @@ foreach hw {0 1} { continue } foreach stop_mode {all-stop non-stop} { - set wp_type [expr ($hw)?"hardware":"software"] + set wp_type [expr {($hw)?"hardware":"software"}] with_test_prefix "$stop_mode: $wp_type" { test $stop_mode $hw } diff --git a/gdb/testsuite/gdb.base/watchpoint-unaligned.exp b/gdb/testsuite/gdb.base/watchpoint-unaligned.exp index 85b1eb7..13dcfba 100644 --- a/gdb/testsuite/gdb.base/watchpoint-unaligned.exp +++ b/gdb/testsuite/gdb.base/watchpoint-unaligned.exp @@ -24,7 +24,7 @@ if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } @@ -43,14 +43,14 @@ if {[istarget "s390*-*-*"]} { foreach wpsize $sizes { for {set wpoffset 0} {$wpoffset < 8 / $wpsize} {incr wpoffset} { - set wpstart [expr $wpoffset * $wpsize] - set wpend [expr ($wpoffset + 1) * $wpsize] + set wpstart [expr {$wpoffset * $wpsize}] + set wpend [expr {($wpoffset + 1) * $wpsize}] set wpendaligned $alignedend($wpend) foreach rdsize $sizes { for {set rdoffset 0} {$rdoffset < 8 / $rdsize} {incr rdoffset} { - set rdstart [expr $rdoffset * $rdsize] - set rdend [expr ($rdoffset + 1) * $rdsize] - set expect_hit [expr max ($wpstart, $rdstart) < min ($wpend, $rdend)] + set rdstart [expr {$rdoffset * $rdsize}] + set rdend [expr {($rdoffset + 1) * $rdsize}] + set expect_hit [expr {max ($wpstart, $rdstart) < min ($wpend, $rdend)}] set test "$rwatch data.u.size$wpsize\[$wpoffset\]" set wpnum "" gdb_test_multiple $test $test { @@ -88,7 +88,7 @@ foreach wpsize $sizes { if {$expect_hit == 0 && $rdstart < $wpendaligned} { setup_xfail external/20207 "aarch64*-*-linux*" } - if {!$expect_hit && [expr max ($wpstart / 8, $rdstart / 8) < min (($wpend + 7) / 8, ($rdend + 7) / 8)]} { + if {!$expect_hit && max ($wpstart / 8, $rdstart / 8) < min (($wpend + 7) / 8, ($rdend + 7) / 8)} { setup_xfail breakpoints/23131 "powerpc*-*-*" } fail $test @@ -139,7 +139,7 @@ foreach_with_prefix wpcount {4 7} { } } set test "wpcount($wpcount)" - if {!$wpoffset_to_wpnum([expr $wpcount - 1])} { + if {!$wpoffset_to_wpnum([expr {$wpcount - 1}])} { untested $test continue } @@ -168,7 +168,7 @@ proc size8twice { function cmd offset index } { "Breakpoint $::decimal at $::hex" "$bp_src_string" # Set a hardware watchpoint. - set watch_index [expr $offset + $index] + set watch_index [expr {$offset + $index}] set test "$cmd data.u.size8twice\[$watch_index\]" set wpnum 0 gdb_test_multiple $test "" { diff --git a/gdb/testsuite/gdb.base/watchpoint.exp b/gdb/testsuite/gdb.base/watchpoint.exp index fba8ac6..7a5a96a 100644 --- a/gdb/testsuite/gdb.base/watchpoint.exp +++ b/gdb/testsuite/gdb.base/watchpoint.exp @@ -55,23 +55,23 @@ proc initialize {} { global decimal global srcfile - if [gdb_test "break marker1" "Breakpoint 1 at $hex: file .*$srcfile, line $decimal.*" "set breakpoint at marker1" ] { + if {[gdb_test "break marker1" "Breakpoint 1 at $hex: file .*$srcfile, line $decimal.*" "set breakpoint at marker1" ]} { return 0 } - if [gdb_test "break marker2" "Breakpoint 2 at $hex: file .*$srcfile, line $decimal.*" "set breakpoint at marker2" ] { + if {[gdb_test "break marker2" "Breakpoint 2 at $hex: file .*$srcfile, line $decimal.*" "set breakpoint at marker2" ]} { return 0 } - if [gdb_test "info break" "1\[ \]*breakpoint.*marker1.*\r\n2\[ \]*breakpoint.*marker2.*" "info break" ] { + if {[gdb_test "info break" "1\[ \]*breakpoint.*marker1.*\r\n2\[ \]*breakpoint.*marker2.*" "info break" ]} { return 0 } gdb_test "watch ival3" ".*\[Ww\]atchpoint 3: ival3.*" "set watchpoint on ival3" - if [gdb_test "info watch" "3\[ \]*.*watchpoint.*ival3" "watchpoint found in watchpoint/breakpoint table" ] { + if {[gdb_test "info watch" "3\[ \]*.*watchpoint.*ival3" "watchpoint found in watchpoint/breakpoint table" ]} { return 0 } @@ -80,7 +80,7 @@ proc initialize {} { # to use it. This allows the test program to run at full speed until # we get to the first marker function. - if [gdb_test_no_output "disable 3" "disable watchpoint" ] { + if {[gdb_test_no_output "disable 3" "disable watchpoint" ]} { return 0 } @@ -99,8 +99,8 @@ proc test_simple_watchpoint {} { # Ensure that the watchpoint is disabled when we startup. - if [gdb_test_no_output "disable 3" \ - "disable watchpoint in test_simple_watchpoint" ] { + if {[gdb_test_no_output "disable 3" \ + "disable watchpoint in test_simple_watchpoint" ]} { return 0 } @@ -121,7 +121,7 @@ proc test_simple_watchpoint {} { # After reaching the marker function, enable the watchpoint. - if [gdb_test_no_output "enable 3" "enable watchpoint" ] { + if {[gdb_test_no_output "enable 3" "enable watchpoint" ]} { return } @@ -165,7 +165,7 @@ Continuing.*\[Ww\]atchpoint.*ival3.*Old value = -1.*New value = 0.*ival3 = count # Check that the hit count is reported correctly gdb_test "info break" ".*watchpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+ival3\r\n\[ \t]+breakpoint already hit 3 times.*" "watchpoint hit count is 3" - + # Continue until the next change, from 2 to 3. gdb_test "cont" "Continuing.*\[Ww\]atchpoint.*ival3.*Old value = 2.*New value = 3.*ival3 = count; ival4 = count;.*" "watchpoint hit, fourth time" @@ -188,14 +188,14 @@ Continuing.*\[Ww\]atchpoint.*ival3.*Old value = -1.*New value = 0.*ival3 = count # Disable the watchpoint so we run at full speed until we exit. - if [gdb_test_no_output "disable 3" "watchpoint disabled" ] { + if {[gdb_test_no_output "disable 3" "watchpoint disabled" ]} { return } # Run until process exits. - if [target_info exists gdb,noresults] { return } + if {[target_info exists gdb,noresults]} { return } gdb_continue_to_end "continue to exit in test_simple_watchpoint" } @@ -213,8 +213,8 @@ proc test_disabling_watchpoints {} { # Ensure that the watchpoint is disabled when we startup. - if [gdb_test_no_output "disable 3" \ - "disable watchpoint in test_disabling_watchpoints" ] { + if {[gdb_test_no_output "disable 3" \ + "disable watchpoint in test_disabling_watchpoints" ]} { return 0 } @@ -236,7 +236,7 @@ proc test_disabling_watchpoints {} { # After reaching the marker function, enable the watchpoint. - if [gdb_test_no_output "enable 3" "watchpoint enabled" ] { + if {[gdb_test_no_output "enable 3" "watchpoint enabled" ]} { return } @@ -245,14 +245,14 @@ proc test_disabling_watchpoints {} { # Don't check the old value, because on VxWorks the variable value # will not have been reinitialized. gdb_test "cont" "Continuing.*\[Ww\]atchpoint.*ival3.*Old value = .*New value = 0.*ival3 = count; ival4 = count;.*" "watchpoint hit in test_disabling_watchpoints, first time" - + # Continue until the next change, from 0 to 1. gdb_test "cont" "Continuing.*\[Ww\]atchpoint.*ival3.*Old value = 0.*New value = 1.*ival3 = count; ival4 = count;.*" "watchpoint hit in test_disabling_watchpoints, second time" - + # Disable the watchpoint but leave breakpoints - if [gdb_test_no_output "disable 3" \ - "disable watchpoint #2 in test_disabling_watchpoints" ] { + if {[gdb_test_no_output "disable 3" \ + "disable watchpoint #2 in test_disabling_watchpoints" ]} { return 0 } @@ -265,8 +265,8 @@ proc test_disabling_watchpoints {} { # Make sure we hit no more watchpoints. gdb_test "cont" "Continuing.*Breakpoint.*marker2 \\(\\).*" \ "disabled watchpoint skipped" - - if [target_info exists gdb,noresults] { return } + + if {[target_info exists gdb,noresults]} { return } gdb_continue_to_end "continue to exit in test_disabling_watchpoints" } @@ -286,7 +286,7 @@ proc test_stepping {} { gdb_test "p func1 ()" "= 73" \ "calling function with watchpoint enabled" - # + # # "finish" brings us back to main. # On some targets (e.g. alpha) gdb will stop from the finish in midline # of the marker1 call. This is due to register restoring code on @@ -357,7 +357,7 @@ proc test_watchpoint_triggered_in_syscall {} { global gdb_prompt # These tests won't work without printf support. - if [gdb_skip_stdio_test "watchpoints triggered in syscall"] { + if {[gdb_skip_stdio_test "watchpoints triggered in syscall"]} { return } # Run until we get to the first marker function. @@ -391,10 +391,10 @@ proc test_watchpoint_triggered_in_syscall {} { set test "sent 123" gdb_test_multiple "123" $test { - -re ".*\[Ww\]atchpoint.*buf\\\[0\\\].*Old value = 0.*New value = 49\[^\n\]*\n" { set x [expr $x+1] ; exp_continue } - -re ".*\[Ww\]atchpoint.*buf\\\[1\\\].*Old value = 0.*New value = 50\[^\n\]*\n" { set x [expr $x+1] ; exp_continue } - -re ".*\[Ww\]atchpoint.*buf\\\[2\\\].*Old value = 0.*New value = 51\[^\n\]*\n" { set x [expr $x+1] ; exp_continue } - -re ".*\[Ww\]atchpoint.*buf\\\[3\\\].*Old value = 0.*New value = 10\[^\n\]*\n" { set x [expr $x+1] ; exp_continue } + -re ".*\[Ww\]atchpoint.*buf\\\[0\\\].*Old value = 0.*New value = 49\[^\n\]*\n" { set x [expr {$x+1}] ; exp_continue } + -re ".*\[Ww\]atchpoint.*buf\\\[1\\\].*Old value = 0.*New value = 50\[^\n\]*\n" { set x [expr {$x+1}] ; exp_continue } + -re ".*\[Ww\]atchpoint.*buf\\\[2\\\].*Old value = 0.*New value = 51\[^\n\]*\n" { set x [expr {$x+1}] ; exp_continue } + -re ".*\[Ww\]atchpoint.*buf\\\[3\\\].*Old value = 0.*New value = 10\[^\n\]*\n" { set x [expr {$x+1}] ; exp_continue } -re ".*$gdb_prompt $" { pass $test } } @@ -402,27 +402,27 @@ proc test_watchpoint_triggered_in_syscall {} { # should have printed. set test "print buf\[0\]" gdb_test_multiple $test $test { - -re ".*= 49.*$gdb_prompt $" { set y [expr $y+1]; pass $test } + -re ".*= 49.*$gdb_prompt $" { set y [expr {$y+1}]; pass $test } -re ".*= 0.*$gdb_prompt $" { $test } } set test "print buf\[1\]" gdb_test_multiple $test $test { - -re ".*= 50.*$gdb_prompt $" { set y [expr $y+1]; pass $test } + -re ".*= 50.*$gdb_prompt $" { set y [expr {$y+1}]; pass $test } -re ".*= 0.*$gdb_prompt $" { pass $test } } set test "print buf\[2\]" gdb_test_multiple $test $test { - -re ".*= 51.*$gdb_prompt $" { set y [expr $y+1]; pass $test } + -re ".*= 51.*$gdb_prompt $" { set y [expr {$y+1}]; pass $test } -re ".*= 0.*$gdb_prompt $" { pass $test } } set test "print buf\[3\]" gdb_test_multiple $test $test { - -re ".*= 10.*$gdb_prompt $" { set y [expr $y+1]; pass $test } + -re ".*= 10.*$gdb_prompt $" { set y [expr {$y+1}]; pass $test } -re ".*= 0.*$gdb_prompt $" { pass $test } } # Did we find what we were looking for? If not, flunk it. - if {[expr $x==$y]} { pass $testname } else { fail "$testname (only triggered $x watchpoints, expected $y)"} + if {$x==$y} { pass $testname } else { fail "$testname (only triggered $x watchpoints, expected $y)"} # Continue until we hit the finishing marker function. # Make sure we hit no more watchpoints. @@ -432,7 +432,7 @@ proc test_watchpoint_triggered_in_syscall {} { # Disable everything so we can finish the program at full speed gdb_test_no_output "disable" "disable in test_watchpoint_triggered_in_syscall" - if [target_info exists gdb,noresults] { return } + if {[target_info exists gdb,noresults]} { return } gdb_continue_to_end "continue to exit in test_watchpoint_triggered_in_syscall" } @@ -567,7 +567,7 @@ proc test_complex_watchpoint {} { # Disable everything so we can finish the program at full speed gdb_test_no_output "disable" "disable in test_complex_watchpoint, second time" - if [target_info exists gdb,noresults] { return } + if {[target_info exists gdb,noresults]} { return } gdb_continue_to_end "continue to exit in test_complex_watchpoint" } @@ -941,7 +941,7 @@ proc test_watch_register_location {} { # Start with a fresh gdb. set prev_timeout $timeout -set timeout 600 +set timeout 600 verbose "Timeout now 600 sec.\n" test_no_hw_watchpoints @@ -964,7 +964,7 @@ proc do_tests {} { test_disabling_watchpoints - if ![target_info exists gdb,cannot_call_functions] { + if {![target_info exists gdb,cannot_call_functions]} { test_stepping } } @@ -978,9 +978,9 @@ proc do_tests {} { "disable fast watches, 2" } - # Only enabled for some targets merely because it has not been tested + # Only enabled for some targets merely because it has not been tested # elsewhere. - # On sparc-sun-sunos4.1.3, GDB was running all the way to the marker4 + # On sparc-sun-sunos4.1.3, GDB was running all the way to the marker4 # breakpoint before stopping for the watchpoint. I don't know why. if {[istarget "hppa*-*-*"]} { test_watchpoint_triggered_in_syscall diff --git a/gdb/testsuite/gdb.base/watchpoints.exp b/gdb/testsuite/gdb.base/watchpoints.exp index d8e4d63..0d21315 100644 --- a/gdb/testsuite/gdb.base/watchpoints.exp +++ b/gdb/testsuite/gdb.base/watchpoints.exp @@ -94,13 +94,13 @@ with_test_prefix "before inferior start" { gdb_test "info break" ".*watchpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+ival1\r\n\[ \t]+breakpoint already hit 3 times.*" "watchpoint ival1 hit count is 3" # Disable ival1 watchpoint gdb_test_no_output "disable 2" "" - + # Continue until the next change, from 1 to 2. gdb_test "cont" "Continuing.*\[Ww\]atchpoint.*ival3.*Old value = 1.*New value = 2.*ival3 = count; ival4 = count;.*" "watchpoint hit, third time" # Check that the hit count is reported correctly gdb_test "info break" ".*watchpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+ival3\r\n\[ \t]+breakpoint already hit 3 times.*" "watchpoint hit count is 3" - + # Continue until the next change, from 2 to 3. gdb_test "cont" "Continuing.*\[Ww\]atchpoint.*ival3.*Old value = 2.*New value = 3.*ival3 = count; ival4 = count;.*" "watchpoint hit, fourth time" diff --git a/gdb/testsuite/gdb.base/whatis-exp.exp b/gdb/testsuite/gdb.base/whatis-exp.exp index 7b2ff0e..ffcfc44 100644 --- a/gdb/testsuite/gdb.base/whatis-exp.exp +++ b/gdb/testsuite/gdb.base/whatis-exp.exp @@ -23,7 +23,7 @@ # computing the value, but just the type # of the result. It goes through the evaluate_subexp_standard # with the EVAL_AVOID_SIDE_EFFECTS flag rather than EVAL_NORMAL -# +# # # test running programs diff --git a/gdb/testsuite/gdb.base/whatis-ptype-typedefs.exp b/gdb/testsuite/gdb.base/whatis-ptype-typedefs.exp index 3709cff..744c6ee 100644 --- a/gdb/testsuite/gdb.base/whatis-ptype-typedefs.exp +++ b/gdb/testsuite/gdb.base/whatis-ptype-typedefs.exp @@ -30,7 +30,7 @@ standard_testfile proc prepare {lang} { global srcfile testfile - if [target_info exists no_long_long] { + if {[target_info exists no_long_long]} { set options [list debug additional_flags=-DNO_LONG_LONG] } else { set options [list debug] diff --git a/gdb/testsuite/gdb.base/whatis.exp b/gdb/testsuite/gdb.base/whatis.exp index 10f5320..5fa29af 100644 --- a/gdb/testsuite/gdb.base/whatis.exp +++ b/gdb/testsuite/gdb.base/whatis.exp @@ -19,7 +19,7 @@ # test running programs # -if [target_info exists no_long_long] { +if {[target_info exists no_long_long]} { set exec_opts [list debug additional_flags=-DNO_LONG_LONG] } else { set exec_opts [list debug] @@ -122,7 +122,7 @@ proc do_test {dir options} { "whatis unsigned long" - if ![target_info exists no_long_long] { + if {![target_info exists no_long_long]} { gdb_test "whatis v_unsigned_long_long" \ "type = (unsigned long long|long long unsigned int)" \ "whatis unsigned long long" @@ -192,7 +192,7 @@ proc do_test {dir options} { "type = (unsigned (int|long|long int)|long unsigned int) \\\[2\\\]" \ "whatis unsigned long array" - if ![target_info exists no_long_long] { + if {![target_info exists no_long_long]} { gdb_test "whatis v_unsigned_long_long_array" \ "type = (unsigned long long|long long unsigned int) \\\[2\\\]" \ "whatis unsigned long long array" @@ -260,7 +260,7 @@ proc do_test {dir options} { "type = (unsigned (int|long|long int)|long unsigned int) \\*" \ "whatis unsigned long pointer" - if ![target_info exists no_long_long] { + if {![target_info exists no_long_long]} { gdb_test "whatis v_long_long_pointer" \ "type = long long(| int) \\*" \ "whatis long long pointer" @@ -464,7 +464,7 @@ proc do_test {dir options} { "type = (unsigned (int|long|long int)|long unsigned int) \\($void\\)" \ "whatis unsigned long function" - if ![target_info exists no_long_long] { + if {![target_info exists no_long_long]} { gdb_test "whatis v_long_long_func" \ "type = long long(| int) \\($void\\)" \ "whatis long long function" diff --git a/gdb/testsuite/gdb.base/with.exp b/gdb/testsuite/gdb.base/with.exp index d766e5d..eb1c85a 100644 --- a/gdb/testsuite/gdb.base/with.exp +++ b/gdb/testsuite/gdb.base/with.exp @@ -214,7 +214,7 @@ with_test_prefix "run control" { clean_restart gdb_load $binfile - if ![runto_main] { + if {![runto_main]} { return } diff --git a/gdb/testsuite/gdb.base/wrap-line.exp b/gdb/testsuite/gdb.base/wrap-line.exp index 2ba2123..f763588 100644 --- a/gdb/testsuite/gdb.base/wrap-line.exp +++ b/gdb/testsuite/gdb.base/wrap-line.exp @@ -30,11 +30,11 @@ proc fill_line { width } { # Take into account that the prompt also takes space. set prefix [string length "(gdb) "] - set start [expr $prefix + 1] + set start [expr {$prefix + 1}] # Print chars. for { set i $start } { $i <= $width } { incr i } { - set c [expr $i % 10] + set c [expr {$i % 10}] send_gdb $c append res $c } @@ -93,7 +93,7 @@ proc test_wrap { width_auto_detected } { if { $wrap_mode == $wrap_mode_terminal } { gdb_assert { $gdb_width == $readline_width } } elseif { $wrap_mode == $wrap_mode_readline } { - gdb_assert { $gdb_width == [expr $readline_width + 1] } + gdb_assert { $gdb_width == [expr {$readline_width + 1}] } } else { set have_wrap 0 } diff --git a/gdb/testsuite/gdb.base/wrong_frame_bt_full.exp b/gdb/testsuite/gdb.base/wrong_frame_bt_full.exp index fc4e9d5..56efd29 100644 --- a/gdb/testsuite/gdb.base/wrong_frame_bt_full.exp +++ b/gdb/testsuite/gdb.base/wrong_frame_bt_full.exp @@ -42,7 +42,7 @@ if {[gdb_compile \ clean_restart ${main_testfile} -if ![runto opaque_routine] { +if {![runto opaque_routine]} { untested "could not run to opaque_routine" return -1 } |