From: Tom de Vries Date: Tue, 30 Sep 2025 19:32:50 +0000 (+0200) Subject: [gdb/testsuite, tclint] Fix gdb.cp X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e3e4e0b5135fffe62d5bfc5bb56a863a0f73049b;p=thirdparty%2Fbinutils-gdb.git [gdb/testsuite, tclint] Fix gdb.cp Running tclint on the test-cases in gdb.cp shows a few problems. Fix these. --- diff --git a/gdb/tclint.toml b/gdb/tclint.toml index ba6fbd92ef2..e6283e49d63 100644 --- a/gdb/tclint.toml +++ b/gdb/tclint.toml @@ -36,7 +36,6 @@ exclude = [ "gdb/testsuite/lib", "gdb/testsuite/gdb.arch", "gdb/testsuite/gdb.base", -"gdb/testsuite/gdb.cp", "gdb/testsuite/gdb.dwarf2", "gdb/testsuite/gdb.mi", # IGNORE (document reason in trailing comment): diff --git a/gdb/testsuite/gdb.cp/abstract-origin.exp b/gdb/testsuite/gdb.cp/abstract-origin.exp index c9d4194ae68..f54cb9ad53d 100644 --- a/gdb/testsuite/gdb.cp/abstract-origin.exp +++ b/gdb/testsuite/gdb.cp/abstract-origin.exp @@ -19,7 +19,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.cp/annota2.exp b/gdb/testsuite/gdb.cp/annota2.exp index 14fe8ef4cfc..16344bd7474 100644 --- a/gdb/testsuite/gdb.cp/annota2.exp +++ b/gdb/testsuite/gdb.cp/annota2.exp @@ -42,7 +42,7 @@ set frames_invalid "\r\n\032\032frames-invalid\r\n" # set main_line 25 -# The commands we test here produce many lines of output; disable "press +# The commands we test here produce many lines of output; disable "press # to continue" prompts. gdb_test_no_output "set height 0" @@ -64,7 +64,7 @@ gdb_test "break 25" \ set old_gdb_prompt $gdb_prompt set gdb_prompt "\r\n\032\032pre-prompt\r\n$gdb_prompt \r\n\032\032prompt\r\n" -send_gdb "set annotate 2\n" +send_gdb "set annotate 2\n" gdb_expect { -re "set annotate 2\r\n$gdb_prompt$" { pass "annotation set at level 2" } -re ".*$gdb_prompt$" { fail "annotation set at level 2" } @@ -175,7 +175,7 @@ gdb_expect { } # -# break at first line of main. +# break at first line of main. # set pat [multi_line "" \ "\032\032post-prompt" \ @@ -205,7 +205,7 @@ gdb_test_multiple "run" "run until main breakpoint, second time" { } # -# set up a watch point on a.x +# set up a watch point on a.x # set pat [multi_line "" \ "\032\032post-prompt" \ @@ -266,12 +266,12 @@ gdb_test_multiple "next" "watch triggered on a.x" { # -# send ^C to gdb, so that the quit() function gets called +# send ^C to gdb, so that the quit() function gets called # and annotate-quit is tested # test: # annotate-quit # -if ![target_info exists gdb,nointerrupts] { +if {![target_info exists gdb,nointerrupts]} { send_gdb "\003" gdb_expect { -re "\r\n\032\032error-begin\r\nQuit\r\n\r\n\032\032quit\r\n$gdb_prompt$" \ @@ -282,9 +282,9 @@ if ![target_info exists gdb,nointerrupts] { } # -# FIXME: the testsuite does not currently have tests for +# FIXME: the testsuite does not currently have tests for # annotate_catchpoints and annotate_function_call -# and a few variants of the annotations that are +# and a few variants of the annotations that are # tested (marked by FIXME on the annot?.exp files) # diff --git a/gdb/testsuite/gdb.cp/annota3.exp b/gdb/testsuite/gdb.cp/annota3.exp index c1f96acf576..db3f69648a4 100644 --- a/gdb/testsuite/gdb.cp/annota3.exp +++ b/gdb/testsuite/gdb.cp/annota3.exp @@ -39,7 +39,7 @@ require target_can_use_run_cmd # set main_line 25 -# The commands we test here produce many lines of output; disable "press +# The commands we test here produce many lines of output; disable "press # to continue" prompts. gdb_test_no_output "set height 0" @@ -61,7 +61,7 @@ gdb_test "break 25" \ set old_gdb_prompt $gdb_prompt set gdb_prompt "\r\n\032\032pre-prompt\r\n$gdb_prompt \r\n\032\032prompt\r\n" -send_gdb "set annotate 3\n" +send_gdb "set annotate 3\n" gdb_expect_list "annotation set at level 3" "\r\n$gdb_prompt$" { "set annotate 3" } @@ -131,7 +131,7 @@ gdb_expect { } # -# break at first line of main. +# break at first line of main. # send_gdb "break 22\n" gdb_expect_list "break at main" "$gdb_prompt$" { @@ -158,7 +158,7 @@ gdb_expect_list "second run until main breakpoint" "$gdb_prompt$" { } # -# set up a watch point on a.x +# set up a watch point on a.x # send_gdb "watch a.x\n" gdb_expect_list "set watch on a.x" "$gdb_prompt$" { @@ -177,12 +177,12 @@ gdb_test_multiple "next" "watch triggered on a.x" { } # -# send ^C to gdb, so that the quit() function gets called +# send ^C to gdb, so that the quit() function gets called # and annotate-quit is tested # test: # annotate-quit # -if ![target_info exists gdb,nointerrupts] { +if {![target_info exists gdb,nointerrupts]} { send_gdb "\003" gdb_expect_list "annotate-quit" "$gdb_prompt$" { "\r\n\032\032error-begin\r\n" @@ -192,9 +192,9 @@ if ![target_info exists gdb,nointerrupts] { } # -# FIXME: the testsuite does not currently have tests for +# FIXME: the testsuite does not currently have tests for # annotate_catchpoints and annotate_function_call -# and a few variants of the annotations that are +# and a few variants of the annotations that are # tested (marked by FIXME on the annot?.exp files) # diff --git a/gdb/testsuite/gdb.cp/anon-union.exp b/gdb/testsuite/gdb.cp/anon-union.exp index ae19f3b8bfd..fb36b495a49 100644 --- a/gdb/testsuite/gdb.cp/anon-union.exp +++ b/gdb/testsuite/gdb.cp/anon-union.exp @@ -77,7 +77,7 @@ gdb_test "print foo" \ # Modify the member just set gdb_test_no_output "set var foo.cloth = 35" "set var foo.cloth" -# Now print out anon union again to see if the right member was set +# Now print out anon union again to see if the right member was set gdb_test "print foo" \ "\\$\[0-9\]* = \{num1 = \{zero = 0, one = 0\}, \{pebble = 0, x = \{rock = 0, rock2 = 0\}, \{qux = 0, mux = 0\}, boulder = 0\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}" \ "print foo 3" @@ -86,7 +86,7 @@ gdb_test "print foo" \ gdb_test "next" "42\[ \t\]*foo.mux = 55;" "next 3" -# Now print out anon union again +# Now print out anon union again gdb_test "print foo" \ "\\$\[0-9\]* = \{num1 = \{zero = 0, one = 0\}, \{pebble = 44, x = \{rock = 44, rock2 = 0\}, \{qux = 44, mux = 44\}, boulder = 44\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}" \ "print foo 4" @@ -94,7 +94,7 @@ gdb_test "print foo" \ # Modify the member just set gdb_test_no_output "set var foo.pebble = 45" "set var foo.pebble" -# Now print out anon union again to see if the right member was set +# Now print out anon union again to see if the right member was set gdb_test "print foo" \ "\\$\[0-9\]* = \{num1 = \{zero = 0, one = 0\}, \{pebble = 45, x = \{rock = 45, rock2 = 0\}, \{qux = 45, mux = 45\}, boulder = 45\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}" \ "print foo 5" @@ -102,7 +102,7 @@ gdb_test "print foo" \ # Modify another member at a different level gdb_test_no_output "set var foo.qux = 46" "set var foo.qux" -# Now print out anon union again to see if the right member was set +# Now print out anon union again to see if the right member was set gdb_test "print foo" \ "\\$\[0-9\]* = \{num1 = \{zero = 0, one = 0\}, \{pebble = 46, x = \{rock = 46, rock2 = 0\}, \{qux = 46, mux = 46\}, boulder = 46\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}" \ "print foo 6" @@ -150,7 +150,7 @@ gdb_test "print w" "\\$\[0-9\]* = 45" "print w 2" # See if z shows the same value gdb_test "print z" "\\$\[0-9\]* = 45" "print z 2" -# Set the anon union member +# Set the anon union member gdb_test_no_output "set var z = 27" "set var z" # See if the change in value is noticed diff --git a/gdb/testsuite/gdb.cp/call-method-register.exp b/gdb/testsuite/gdb.cp/call-method-register.exp index b736312a65e..522da0af7a2 100644 --- a/gdb/testsuite/gdb.cp/call-method-register.exp +++ b/gdb/testsuite/gdb.cp/call-method-register.exp @@ -108,7 +108,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.cp/casts.exp b/gdb/testsuite/gdb.cp/casts.exp index 42c5d1f68ca..c03a946d0c4 100644 --- a/gdb/testsuite/gdb.cp/casts.exp +++ b/gdb/testsuite/gdb.cp/casts.exp @@ -70,12 +70,12 @@ gdb_test "print * (B *) a" ".* = { = {a = 42}, b = 1729}" \ gdb_test "print * b" ".* = { = {a = 42}, b = 1729}" \ "let compiler cast base class pointer to derived class pointer" -# Check upcasting (it is trivial but still). +# Check upcasting (it is trivial but still). gdb_test "print * (A *) b" ".* = {a = 42}" \ "cast derived class pointer to base class pointer" # Casting References. -# Check upcasting. +# Check upcasting. gdb_test "print (A &) br" ".* = .A &.* {a = 42}" \ "cast derived class reference to base class reference" diff --git a/gdb/testsuite/gdb.cp/classes.exp b/gdb/testsuite/gdb.cp/classes.exp index cb6a862ff60..ad637496088 100644 --- a/gdb/testsuite/gdb.cp/classes.exp +++ b/gdb/testsuite/gdb.cp/classes.exp @@ -203,7 +203,7 @@ proc test_ptype_class_objects {} { # # gcc 2.X with stabs (stabs or stabs+?) used to have a problem with # static methods whose name is the same as their argument mangling. - + cp_test_ptype_class \ "class Static" "" "class" "Static" \ { @@ -413,7 +413,7 @@ proc test_ptype_class_objects {} { # Test simple access to class members. proc test_non_inherited_member_access {} { - + # Print non-inherited members of g_A. gdb_test "print g_A.a" ".* = 1" gdb_test "print g_A.x" ".* = 2" diff --git a/gdb/testsuite/gdb.cp/cmpd-minsyms.exp b/gdb/testsuite/gdb.cp/cmpd-minsyms.exp index 62952bd06a7..cb31baee67b 100644 --- a/gdb/testsuite/gdb.cp/cmpd-minsyms.exp +++ b/gdb/testsuite/gdb.cp/cmpd-minsyms.exp @@ -36,7 +36,7 @@ foreach sym $min_syms { set tst "setting breakpoint at '$sym'" if {[gdb_breakpoint "'$sym'"]} { pass $tst - } + } } diff --git a/gdb/testsuite/gdb.cp/cpexprs.exp.tcl b/gdb/testsuite/gdb.cp/cpexprs.exp.tcl index 5c3dfd63856..6766ccea19c 100644 --- a/gdb/testsuite/gdb.cp/cpexprs.exp.tcl +++ b/gdb/testsuite/gdb.cp/cpexprs.exp.tcl @@ -130,7 +130,7 @@ set ADDR "0x$HEX+"; # address # are (none need character escaping -- "add" will take care of that): # add name type print_name list -# NAME,type: value is type of function +# NAME,type: value is type of function # NAME,print: value is print name of function (careful w/inherited/virtual!) # NAME,list: value is comment in source code on first line of function # (without the leading "//") diff --git a/gdb/testsuite/gdb.cp/cplusfuncs.exp b/gdb/testsuite/gdb.cp/cplusfuncs.exp index e7859099064..d1b4ecb4de2 100644 --- a/gdb/testsuite/gdb.cp/cplusfuncs.exp +++ b/gdb/testsuite/gdb.cp/cplusfuncs.exp @@ -424,7 +424,7 @@ proc test_lookup_operator_functions {} { # operator[] needs double backslashes, so that a single backslash # will be sent to GDB, preventing the square brackets from being - # evaluated as a regular expression. + # evaluated as a regular expression. info_func "operator\\\[\\\](" "void foo::operator\[\]($dm_type_foo_ref);" # These are gnarly because they might end with 'static'. @@ -493,7 +493,7 @@ proc test_paddr_operator_functions {} { gdb_test "print &foo::operator new" \ " = .* $hex " gdb_test "print &foo::operator new\[\]" \ - " = .* $hex " + " = .* $hex " print_addr "foo::operator delete($dm_type_void_star)" print_addr "foo::operator delete\[\]($dm_type_void_star)" diff --git a/gdb/testsuite/gdb.cp/demangle.exp b/gdb/testsuite/gdb.cp/demangle.exp index 8da43773cc9..420d1df2b85 100644 --- a/gdb/testsuite/gdb.cp/demangle.exp +++ b/gdb/testsuite/gdb.cp/demangle.exp @@ -36,7 +36,7 @@ proc set_demangling_style {style} { fail "$style: set demangle-style" error "set_demangling_style: set style" } - timeout { + timeout { fail "$style: set demangle-style (timeout)" error "set_demangling_style: set style" } @@ -44,15 +44,15 @@ proc set_demangling_style {style} { gdb_test_multiple "show demangle-style" \ "$style: check demangling style" { - -re "The current C\[+\]+ demangling style is \"$style\".\r\n$gdb_prompt $" { + -re "The current C\[+\]+ demangling style is \"$style\".\r\n$gdb_prompt $" { pass "$style: check demangling style" } -re ".*$gdb_prompt $" { fail "$style: check demangling style" error "set_demangling_style: check style" } - timeout { - fail "$style: check demangling style (timeout)" + timeout { + fail "$style: check demangling style (timeout)" error "set_demangling_style: check style" } } @@ -89,13 +89,13 @@ proc test_demangling_core {tester test result} { ### Why don't we just pass the STYLE and NAME as two separate ### arguments, or let the style be a global variable? That would be ### cleaner. However, doing it this way means that: -### +### ### 1) the name of the test, as recorded in the summary and log, ### appears verbatim in the script, and -### +### ### 2) that test names are unique, even though we try to demangle the same ### identifiers using several different mangling styles. -### +### ### This makes it a lot easier for people tracking down failures to ### find the one they care about. @@ -157,14 +157,14 @@ proc test_gnuv3_style_demangling {} { } proc catch_demangling_errors {command} { - if {[catch $command result]} { + if {[catch {$command} result]} { puts "ERROR: demangle.exp: while running $command: $result" } } # Test support for different demangling styles. Note that this does # not depend upon running the test program and does not depend upon -# gdb being able to lookup any C++ symbols. It simply calls the +# gdb being able to lookup any C++ symbols. It simply calls the # internal demangler with synthesized strings and tests the results. proc do_tests {} { diff --git a/gdb/testsuite/gdb.cp/derivation.exp b/gdb/testsuite/gdb.cp/derivation.exp index f61e35c9c59..bb3dccea774 100644 --- a/gdb/testsuite/gdb.cp/derivation.exp +++ b/gdb/testsuite/gdb.cp/derivation.exp @@ -19,7 +19,7 @@ # This file is part of the gdb testsuite # tests for inheritance, with several derivations types combinations -# (private, public, protected) +# (private, public, protected) # classes have simple members and member functions. set ws "\[\r\n\t \]+" diff --git a/gdb/testsuite/gdb.cp/destrprint.exp b/gdb/testsuite/gdb.cp/destrprint.exp index 10f66b63d00..5ce7134631a 100644 --- a/gdb/testsuite/gdb.cp/destrprint.exp +++ b/gdb/testsuite/gdb.cp/destrprint.exp @@ -19,7 +19,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.cp/dispcxx.exp b/gdb/testsuite/gdb.cp/dispcxx.exp index 3d4703ffe81..107e967d2fa 100644 --- a/gdb/testsuite/gdb.cp/dispcxx.exp +++ b/gdb/testsuite/gdb.cp/dispcxx.exp @@ -23,7 +23,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} { if {![runto_main]} { return -} +} gdb_breakpoint [gdb_get_line_number "Break here"] gdb_continue_to_breakpoint here diff --git a/gdb/testsuite/gdb.cp/empty-enum.exp b/gdb/testsuite/gdb.cp/empty-enum.exp index f640e343015..487d5619e44 100644 --- a/gdb/testsuite/gdb.cp/empty-enum.exp +++ b/gdb/testsuite/gdb.cp/empty-enum.exp @@ -51,7 +51,7 @@ gdb_test "print arg2" " = 4" # Xfail for missing DW_AT_type in DW_TAG_enumeration_type, gcc PR debug/16063. -set have_xfail [expr [test_compiler_info gcc-*] && [gcc_major_version] < 5] +set have_xfail [expr {[test_compiler_info gcc-*] && [gcc_major_version] < 5}] gdb_test_multiple "ptype arg1" "" { -re -wrap "type = enum enum1 : unsigned int \\{\\}" { diff --git a/gdb/testsuite/gdb.cp/except-multi-location.exp b/gdb/testsuite/gdb.cp/except-multi-location.exp index 378044734ca..0c3222dbcbb 100644 --- a/gdb/testsuite/gdb.cp/except-multi-location.exp +++ b/gdb/testsuite/gdb.cp/except-multi-location.exp @@ -57,7 +57,7 @@ proc test_multi_libstdcpp {static_bin static_lib} { gdb_load ${binfile} gdb_load_shlib $binfile_lib - if ![runto_main] { + if {![runto_main]} { return 0 } diff --git a/gdb/testsuite/gdb.cp/exception.exp b/gdb/testsuite/gdb.cp/exception.exp index cb20f172a64..45fa299755e 100644 --- a/gdb/testsuite/gdb.cp/exception.exp +++ b/gdb/testsuite/gdb.cp/exception.exp @@ -33,7 +33,7 @@ set nl "\[\r\n\]+" require allow_stl_tests standard_testfile .cc - + if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} { return -1 } @@ -101,7 +101,7 @@ gdb_test_multiple "info breakpoints" $name { gdb_test "break catcher" "Breakpoint \[0-9\]+ at.*" # Get the first exception thrown - + gdb_test "continue" \ "Continuing.${ws}Catchpoint \[0-9\]+ \\(exception thrown\\).*" \ "continue to first throw" diff --git a/gdb/testsuite/gdb.cp/exceptprint.exp b/gdb/testsuite/gdb.cp/exceptprint.exp index 09e35fdb6ed..8f034e449b8 100644 --- a/gdb/testsuite/gdb.cp/exceptprint.exp +++ b/gdb/testsuite/gdb.cp/exceptprint.exp @@ -49,7 +49,7 @@ proc do_exceptprint_tests {prefix output} { do_continue_to_catchpoint "continue to catch" gdb_test "print \$_exception" " = $output" \ "print exception value at catch" - + do_continue_to_catchpoint "continue to rethrow" gdb_test "print \$_exception" " = $output" \ "print exception value at rethrow" diff --git a/gdb/testsuite/gdb.cp/expand-sals.exp b/gdb/testsuite/gdb.cp/expand-sals.exp index 8d542476b79..df6fb6aa963 100644 --- a/gdb/testsuite/gdb.cp/expand-sals.exp +++ b/gdb/testsuite/gdb.cp/expand-sals.exp @@ -19,7 +19,7 @@ set srcfile expand-sals.cc if { [prepare_for_testing "failed to prepare" expand-sals $srcfile {debug c++}] } { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.cp/formatted-ref.exp b/gdb/testsuite/gdb.cp/formatted-ref.exp index 0c974adf352..bf0aae3861b 100644 --- a/gdb/testsuite/gdb.cp/formatted-ref.exp +++ b/gdb/testsuite/gdb.cp/formatted-ref.exp @@ -15,9 +15,9 @@ # Author: P. N. Hilfinger, AdaCore, Inc. -# This test checks the behavior of formatted print when applied to a +# This test checks the behavior of formatted print when applied to a # reference value. The intended behavior is that a formatted print of -# such a value should display the same value as a plain print, +# such a value should display the same value as a plain print, # modulo format, of course. Older versions of GDB would instead print # the reference's address value itself when doing a formatted print, # rather than printing both that and the dereferenced value. We also @@ -44,7 +44,7 @@ proc get_address { var } { -re "\\$\[0-9\]+ = \\(.*\\) (0x\[0-9a-f\]+).*$gdb_prompt $" { return $expect_out(1,string) } - timeout { + timeout { perror "couldn't find address of $var" return "" } @@ -59,7 +59,7 @@ proc test_p_x { var type val addr } { gdb_test_multiple $test $test { -re "\\$\[0-9\]+ = \\([string_to_regexp $type]\\) @0x\[a-f0-9\]+: [string_to_regexp $val].*$gdb_prompt $" { pass $test - } + } -re "\\$\[0-9\]+ = $addr.*$gdb_prompt $" { fail "$test (prints just address)" } @@ -77,7 +77,7 @@ proc test_p_x_addr { var addr } { gdb_test_multiple $test $test { -re "\\$\[0-9\]+ = $addr.*$gdb_prompt $" { pass $test - } + } -re "\\$\[0-9\]+ = 0x\[a-f0-9+\]+.*$gdb_prompt $" { fail "$test (prints unexpected address)" } diff --git a/gdb/testsuite/gdb.cp/gdb1355.exp b/gdb/testsuite/gdb.cp/gdb1355.exp index 3120b1f8891..c54723d98eb 100644 --- a/gdb/testsuite/gdb.cp/gdb1355.exp +++ b/gdb/testsuite/gdb.cp/gdb1355.exp @@ -35,7 +35,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} { if {![runto_main]} { return -} +} # See http://sources.redhat.com/gdb/bugs/1355 # See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12066 diff --git a/gdb/testsuite/gdb.cp/incomplete-type-overload.exp b/gdb/testsuite/gdb.cp/incomplete-type-overload.exp index aa582e01406..efb1fd34f4c 100644 --- a/gdb/testsuite/gdb.cp/incomplete-type-overload.exp +++ b/gdb/testsuite/gdb.cp/incomplete-type-overload.exp @@ -33,11 +33,11 @@ set flags_nodebug {} lappend flags_nodebug nodebug lappend flags_nodebug c++ -if [prepare_for_testing "failed to prepare" $testfile $srcfile $flags_debug] { +if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags_debug]} { return } -if ![runto_main] { +if {![runto_main]} { return } @@ -171,12 +171,12 @@ Dwarf::assemble ${asm_file} { } } -if [prepare_for_testing "failed to prepare" $testfile \ - [list $asm_file $srcfile] $flags_nodebug] { +if {[prepare_for_testing "failed to prepare" $testfile \ + [list $asm_file $srcfile] $flags_nodebug]} { return } -if ![runto_main] { +if {![runto_main]} { return } diff --git a/gdb/testsuite/gdb.cp/infcall-nodebug.exp.tcl b/gdb/testsuite/gdb.cp/infcall-nodebug.exp.tcl index 764d31ddb56..b743498d71b 100644 --- a/gdb/testsuite/gdb.cp/infcall-nodebug.exp.tcl +++ b/gdb/testsuite/gdb.cp/infcall-nodebug.exp.tcl @@ -19,7 +19,7 @@ # the rest of the test can be complied with debug information. Whilst we # are at it, also test functions with debug information and C functions too. -if [target_info exists gdb,cannot_call_functions] { +if {[target_info exists gdb,cannot_call_functions]} { unsupported "this target can not call functions" continue } diff --git a/gdb/testsuite/gdb.cp/iostream.exp b/gdb/testsuite/gdb.cp/iostream.exp index 8d96a9fdcc1..621695fb3f1 100644 --- a/gdb/testsuite/gdb.cp/iostream.exp +++ b/gdb/testsuite/gdb.cp/iostream.exp @@ -24,7 +24,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} { return -1 } -if ![runto_main] { +if {![runto_main]} { return } diff --git a/gdb/testsuite/gdb.cp/local.exp b/gdb/testsuite/gdb.cp/local.exp index 621f2f6e56c..7c13de01243 100644 --- a/gdb/testsuite/gdb.cp/local.exp +++ b/gdb/testsuite/gdb.cp/local.exp @@ -174,7 +174,7 @@ gdb_test_multiple "ptype Local" "local out of scope" { kfail gdb/825 "Local out of scope" } } - + # DTS CLLbs14316 and CLLbs17058 # coulter - I added a clause for HP's aCC compiler. We print out the type @@ -182,7 +182,7 @@ gdb_test_multiple "ptype Local" "local out of scope" { # because of two reasons: # There is a number at the end of InnerLocal4 which should not be there, # DTS CLLbs14316 -# The line number for the class +# The line number for the class # setup_xfail "hppa*-*-*" CLLbs14316 # --- diff --git a/gdb/testsuite/gdb.cp/m-static.exp b/gdb/testsuite/gdb.cp/m-static.exp index 6b108040da5..1769ba74e1e 100644 --- a/gdb/testsuite/gdb.cp/m-static.exp +++ b/gdb/testsuite/gdb.cp/m-static.exp @@ -45,7 +45,7 @@ if {![runto_main]} { } get_debug_format -set non_dwarf [expr ! [test_debug_format "DWARF \[0-9\]"]] +set non_dwarf [expr {! [test_debug_format "DWARF \[0-9\]"]}] # First, run to after we've constructed all the objects: diff --git a/gdb/testsuite/gdb.cp/many-args.exp b/gdb/testsuite/gdb.cp/many-args.exp index b7e5a8e5cc4..fcb0a363d58 100644 --- a/gdb/testsuite/gdb.cp/many-args.exp +++ b/gdb/testsuite/gdb.cp/many-args.exp @@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} { return -1 } -if ![runto_main] { +if {![runto_main]} { return } diff --git a/gdb/testsuite/gdb.cp/mb-inline.exp b/gdb/testsuite/gdb.cp/mb-inline.exp index d6b30b8bb4d..579bcc64bf3 100644 --- a/gdb/testsuite/gdb.cp/mb-inline.exp +++ b/gdb/testsuite/gdb.cp/mb-inline.exp @@ -69,7 +69,7 @@ gdb_test_multiple "info break" "disabled breakpoint 1.2" { # will loose. The heuristic of GDB should be improved. setup_kfail gdb/12924 "*-*-uclinux*" fail "disabled breakpoint 1.2" - } + } } # Make sure we can set a breakpoint on a source statement that spans diff --git a/gdb/testsuite/gdb.cp/mb-templates.exp b/gdb/testsuite/gdb.cp/mb-templates.exp index 0354a5a9ddc..b067cb073c1 100644 --- a/gdb/testsuite/gdb.cp/mb-templates.exp +++ b/gdb/testsuite/gdb.cp/mb-templates.exp @@ -61,7 +61,7 @@ gdb_test "break $srcfile:$bp_location" \ gdb_test_no_output {condition $bpnum i==1} \ "separate condition: set condition" - + gdb_run_cmd gdb_test "" "Breakpoint $bkptno_num_re,.*foo \\(i=1\\).*" "separate condition: run to breakpoint" diff --git a/gdb/testsuite/gdb.cp/method-call-in-c.exp b/gdb/testsuite/gdb.cp/method-call-in-c.exp index 6cbdda055e7..b0201adb656 100644 --- a/gdb/testsuite/gdb.cp/method-call-in-c.exp +++ b/gdb/testsuite/gdb.cp/method-call-in-c.exp @@ -45,7 +45,7 @@ foreach_with_prefix lang { c++ c } { gdb_test "print foo.func (b, f)" " = ${result}" incr result - set result [expr $result + 3] + set result [expr {$result + 3}] gdb_test "print foo += b" \ " = \\((?:struct )?foo_type &\\) @${hex}: \\\{var = ${result}\\\}" diff --git a/gdb/testsuite/gdb.cp/method.exp b/gdb/testsuite/gdb.cp/method.exp index 2e0f4124d95..410647a6f41 100644 --- a/gdb/testsuite/gdb.cp/method.exp +++ b/gdb/testsuite/gdb.cp/method.exp @@ -60,7 +60,7 @@ gdb_test "print x" \ "\\$\[0-9\]* = 20" \ "print x in A::foo" -# Check access to this pointer +# Check access to this pointer gdb_test "print this" \ "\\$\[0-9\]* = \\((class |)A *\\* *(const|)\\) $hex" \ @@ -82,7 +82,7 @@ gdb_test "print x" \ "\\$\[0-9\]* = 33" \ "print x in A::bar" -# Check access to this pointer +# Check access to this pointer get_debug_format @@ -123,7 +123,7 @@ gdb_test "print data_" \ "\\$\[0-9\]* = 33" \ "print data_ in funk::getFunky" -# Check access to this pointer +# Check access to this pointer gdb_test "print this" \ "\\$\[0-9\]* = \\((class |)funk *\\* *(const|)\\) $hex" \ @@ -157,7 +157,7 @@ gdb_test_multiple "cont" "finish program" { pass "finish program" } -re "Continuing.* EXIT code 0.*$inferior_exited_re normally.*$gdb_prompt $" { - pass "finish program (exit wrapper)" + pass "finish program (exit wrapper)" } } diff --git a/gdb/testsuite/gdb.cp/misc.exp b/gdb/testsuite/gdb.cp/misc.exp index 6d3e000abd9..64003951fc4 100644 --- a/gdb/testsuite/gdb.cp/misc.exp +++ b/gdb/testsuite/gdb.cp/misc.exp @@ -49,12 +49,12 @@ 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_no_output [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]" } } @@ -72,7 +72,7 @@ test_expr "set language c++" \ "print as bool" # Test bool type printing, etc. -# Note: Language is already set to C++ above! +# Note: Language is already set to C++ above! gdb_test "print v_bool" "\\$\[0-9\]* = false" "print a bool var" # set a bool variable diff --git a/gdb/testsuite/gdb.cp/namespace.exp b/gdb/testsuite/gdb.cp/namespace.exp index 0ba8387b498..6569f792b40 100644 --- a/gdb/testsuite/gdb.cp/namespace.exp +++ b/gdb/testsuite/gdb.cp/namespace.exp @@ -89,10 +89,10 @@ setup_xfail hppa*-*-*11* CLLbs14869 gdb_test_multiple "info func xyzq" "info func xyzq" { -re "All functions.*File.*namespace.cc:\r\n.*\tint AAA::A_xyzq\\(int\\);\r\n.*\tint BBB::B_xyzq\\(int\\);\r\n.*\tchar AAA::xyzq\\(char\\);\r\n.*\tchar BBB::xyzq\\(char\\);\r\n.*\tchar BBB::CCC::xyzq\\(char\\);\r\n.*\tchar BBB::Class::xyzq\\(char\\);\r\n$gdb_prompt $" { pass "info func xyzq" - } + } -re "All functions.*File.*namespace.cc:\r\n.*\tint AAA::A_xyzq\\(int\\);\r\n.*\tchar AAA::xyzq\\(char\\);\r\n.*\tint BBB::B_xyzq\\(int\\);\r\n.*\tchar BBB::CCC::xyzq\\(char\\);\r\n.*\tchar BBB::Class::xyzq\\(char\\);\r\n.*\tchar BBB::xyzq\\(char\\);\r\n$gdb_prompt $" { pass "info func xyzq" - } + } } # Call a function in a namespace @@ -120,7 +120,7 @@ gdb_test "print 'BBB::CCC::xyzq'('x')" \ gdb_test "print BBB::CCC::xyzq('x')" \ "\\$\[0-9\]* = 122 'z'" - + # Break on a function in a nested namespace gdb_test "break BBB::CCC::xyzq" \ @@ -153,9 +153,9 @@ gdb_test "whatis ::C::cOtherFileVar" "type = const C::cOtherFileType" gdb_test "print C::cOtherFileVar" "\\$\[0-9\].* = 319" gdb_test "print ::C::cOtherFileVar" "\\$\[0-9\].* = 319" -if $xfail_class_types { setup_xfail *-*-* } +if {$xfail_class_types} { setup_xfail *-*-* } gdb_test "whatis C::OtherFileClass::cOtherFileClassType" "type = short" -if $xfail_class_types { setup_xfail *-*-* } +if {$xfail_class_types} { setup_xfail *-*-* } gdb_test "whatis ::C::OtherFileClass::cOtherFileClassType" "type = short" gdb_test "print C::OtherFileClass::cOtherFileClassVar" " = 318" @@ -171,8 +171,8 @@ gdb_test_multiple $test $test { } -re "\\$\[0-9\].* = 318\r\n$gdb_prompt $" { # Do not permit to XFAIL on recent GCCs. - if $xfail_class_types { - setup_xfail *-*-* + if {$xfail_class_types} { + setup_xfail *-*-* fail $test # Unresolved means human intervention is required to determine # whether the test passed or failed. Since the previous test @@ -226,9 +226,9 @@ gdb_test "ptype C::OtherFileClass" "No symbol \"OtherFileClass\" in namespace \" # Test class typedefs printing. set expect "type = class C::OtherFileClass \{\r\n.*\r\n *typedef short cOtherFileClassType;\r\n *typedef long cOtherFileClassType2;\r\n\}" -if $xfail_class_types { setup_xfail *-*-* } +if {$xfail_class_types} { setup_xfail *-*-* } gdb_test "ptype OtherFileClass" $expect "ptype OtherFileClass typedefs" -if $xfail_class_types { setup_xfail *-*-* } +if {$xfail_class_types} { setup_xfail *-*-* } gdb_test "ptype ::C::OtherFileClass" $expect "ptype ::C::OtherFileClass typedefs" # Some anonymous namespace tests. diff --git a/gdb/testsuite/gdb.cp/nested-types.exp b/gdb/testsuite/gdb.cp/nested-types.exp index 620b4f21a8b..28ce8e0c094 100644 --- a/gdb/testsuite/gdb.cp/nested-types.exp +++ b/gdb/testsuite/gdb.cp/nested-types.exp @@ -60,7 +60,7 @@ proc build_node {id} { # (the source only uses that at the root struct). # We also don't create nodes not in the source file # (id >= 60). - if {[expr {$n % 10}] != 0 && $n < 60} { + if {$n % 10 != 0 && $n < 60} { lappend nodes($id,children) $n } } @@ -96,7 +96,7 @@ proc make_source {} { send_log "int\nmain \(\)\n\{\n" set plist {} for {set i 10} {$i < 60} {incr i} { - if {$i > 10 && [expr {$i % 10}] == 0} { + if {$i > 10 && $i % 10 == 0} { incr i set plist {"S10"} send_log "\n" diff --git a/gdb/testsuite/gdb.cp/nextoverthrow.exp b/gdb/testsuite/gdb.cp/nextoverthrow.exp index 2548305df50..e3aae28b7c5 100644 --- a/gdb/testsuite/gdb.cp/nextoverthrow.exp +++ b/gdb/testsuite/gdb.cp/nextoverthrow.exp @@ -24,7 +24,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} { if {![runto_main]} { return -} +} if {![skip_unwinder_tests]} { unsupported "nextoverthrow.exp could not find _Unwind_DebugHook" diff --git a/gdb/testsuite/gdb.cp/nsusing.exp b/gdb/testsuite/gdb.cp/nsusing.exp index 988bf2f1493..90fd9fe29be 100644 --- a/gdb/testsuite/gdb.cp/nsusing.exp +++ b/gdb/testsuite/gdb.cp/nsusing.exp @@ -125,7 +125,7 @@ if { [test_compiler_info {gcc-[0-3]-*}] || # Xfail for incorrect decl_line on DW_TAG_imported_module, # gcc PR debug/108716. set have_gcc108716_xfail \ - [expr [test_compiler_info gcc-*] && [gcc_major_version] < 13] + [expr {[test_compiler_info gcc-*] && [gcc_major_version] < 13}] gdb_test_multiple "print x" "print x, before using statement" { -re -wrap "No symbol .x. in current context.*" { diff --git a/gdb/testsuite/gdb.cp/overload-const.exp b/gdb/testsuite/gdb.cp/overload-const.exp index 75176b98625..6b6056e5010 100644 --- a/gdb/testsuite/gdb.cp/overload-const.exp +++ b/gdb/testsuite/gdb.cp/overload-const.exp @@ -25,6 +25,6 @@ if {[prepare_for_testing "failed to prepare" $testfile $testfile.cc {c++ debug}] gdb_test_no_output "set language c++" -if [gdb_breakpoint "myclass::func"] { +if {[gdb_breakpoint "myclass::func"]} { pass "setting breakpoint at myclass::func" } diff --git a/gdb/testsuite/gdb.cp/overload.exp b/gdb/testsuite/gdb.cp/overload.exp index af5b23b725b..aa1daa496fb 100644 --- a/gdb/testsuite/gdb.cp/overload.exp +++ b/gdb/testsuite/gdb.cp/overload.exp @@ -346,8 +346,8 @@ with_test_prefix "list all overloads" { set line_bar_A [gdb_get_line_number "int bar (A)"] set line_bar_B [gdb_get_line_number "int bar (B)"] - set lines1 [line_range_pattern [expr $line_bar_A - 5] [expr $line_bar_A + 4]] - set lines2 [line_range_pattern [expr $line_bar_B - 5] [expr $line_bar_B + 4]] + set lines1 [line_range_pattern [expr {$line_bar_A - 5}] [expr {$line_bar_A + 4}]] + set lines2 [line_range_pattern [expr {$line_bar_B - 5}] [expr {$line_bar_B + 4}]] set any "\[^\r\n\]*" set h1_re "file: \"${any}overload.cc\", line number: $line_bar_A, symbol: \"bar\\(A\\)\"" diff --git a/gdb/testsuite/gdb.cp/ovldbreak.exp b/gdb/testsuite/gdb.cp/ovldbreak.exp index fd9fb949003..9b8c6d19fa8 100644 --- a/gdb/testsuite/gdb.cp/ovldbreak.exp +++ b/gdb/testsuite/gdb.cp/ovldbreak.exp @@ -253,7 +253,7 @@ gdb_test "info break" $bptable "breakpoint info, after setting one-by-one" # Test choice "cancel". # This is copy-and-paste from set_bp_overloaded. -send_gdb "break foo::overload1arg\n" +send_gdb "break foo::overload1arg\n" gdb_expect { -re "$menu_overload1arg" { pass "bp menu for foo::overload1arg choice cancel" @@ -333,7 +333,7 @@ gdb_test "info breakpoints" "No breakpoints, watchpoints, tracepoints, or catchp # This is copy-and-paste from set_bp_overloaded. incr bpnum -send_gdb "break foo::overload1arg\n" +send_gdb "break foo::overload1arg\n" gdb_expect { -re "$menu_overload1arg" { pass "bp menu for foo::overload1arg choice all" @@ -402,7 +402,7 @@ proc continue_to_bp_overloaded {bpnumber might_fail line argtype argument} { } -re "Continuing.\r\n\r\nBreakpoint $bkptno_num_re, foo::overload1arg \\(this=${hex}, arg=.*\\) at .*$srcfile:$line\r\n$decimal\[\t \]+{ $body }.*$gdb_prompt $" { - if $might_kfail { + if {$might_kfail} { kfail "c++/8130" "continue to bp overloaded : $argtype" } else { fail "continue to bp overloaded : $argtype" diff --git a/gdb/testsuite/gdb.cp/pass-by-ref.exp b/gdb/testsuite/gdb.cp/pass-by-ref.exp index 75b52578f7f..4c1266663fb 100644 --- a/gdb/testsuite/gdb.cp/pass-by-ref.exp +++ b/gdb/testsuite/gdb.cp/pass-by-ref.exp @@ -115,7 +115,7 @@ proc generate_member_function { classname signature length state } { set definition "$classname\:\:$signature { data\[0\] = $CUSTOM; - data\[[expr $length - 1]\] = $CUSTOM; + data\[[expr {$length - 1}]\] = $CUSTOM; tracer = $TRACE; }\n" } @@ -177,7 +177,7 @@ proc generate_class { classname length states } { $classname\:\:$classname (void) { data\[0\] = $ORIGINAL; - data\[[expr $length - 1]\] = $ORIGINAL; + data\[[expr {$length - 1}]\] = $ORIGINAL; } $definitions @@ -398,7 +398,7 @@ proc test_for_class { prefix states cbvfun data_field length} { gdb_test "print ${name}_var.${data_field}\[0\]" " = $ORIGINAL" \ "cbv argument should not change, item 0" if {$length > 1} { - set last_index [expr $length - 1] + set last_index [expr {$length - 1}] gdb_test "print ${name}_var.${data_field}\[$last_index\]" \ " = $ORIGINAL" \ "cbv argument should not change, item $last_index" diff --git a/gdb/testsuite/gdb.cp/psmang.exp b/gdb/testsuite/gdb.cp/psmang.exp index 67bc9cd935d..7f9ce69ee1a 100644 --- a/gdb/testsuite/gdb.cp/psmang.exp +++ b/gdb/testsuite/gdb.cp/psmang.exp @@ -25,7 +25,7 @@ # sure the test still fails: # # 2002-08-29 Jim Blandy -# +# # * symtab.c (lookup_symbol_aux): In the cases where we find a # minimal symbol of an appropriate name and use its address to # select a symtab to read and search, use `name' (as passed to us) @@ -35,14 +35,14 @@ # The original bug was that you'd try to set a breakpoint on a method # (e.g., `break s::method1'), and you'd get an error, but if you # repeated the command, it would work the second time: -# +# # (gdb) break s::method1 # the class s does not have any method named method1 # Hint: try 's::method1 or 's::method1 # (Note leading single quote.) # (gdb) break s::method1 # Breakpoint 1 at 0x804841b: file psmang1.cc, line 13. -# (gdb) +# (gdb) # # We observed this bug first using Stabs, and then using Dwarf 2. # diff --git a/gdb/testsuite/gdb.cp/rvalue-ref-params.exp b/gdb/testsuite/gdb.cp/rvalue-ref-params.exp index 267dbc71758..91f79eacaa3 100644 --- a/gdb/testsuite/gdb.cp/rvalue-ref-params.exp +++ b/gdb/testsuite/gdb.cp/rvalue-ref-params.exp @@ -49,7 +49,7 @@ gdb_test "print static_cast (global_int)" " = \\(int &&\\) @$hex: 7" gdb_test "print static_cast (global_float)" " = \\(float &\\) @$hex: 3\\.$decimal" gdb_test "print static_cast (global_float)" " = \\(float &&\\) @$hex: 3\\.$decimal" -set t "print value of f2 on (Child&&) in main" +set t "print value of f2 on (Child&&) in main" gdb_start_again "marker1 here" $t gdb_test "print f2(static_cast(Q))" ".* = 40.*" $t diff --git a/gdb/testsuite/gdb.cp/rvalue-ref-types.exp b/gdb/testsuite/gdb.cp/rvalue-ref-types.exp index 571ab81abdd..596abe71362 100644 --- a/gdb/testsuite/gdb.cp/rvalue-ref-types.exp +++ b/gdb/testsuite/gdb.cp/rvalue-ref-types.exp @@ -38,7 +38,7 @@ if {![runto 'marker1']} { gdb_test "up" ".*main.*" "up from marker1 1" -gdb_test "print rrt" " = \\(short( int)? &&\\) @$hex: -1" "print value of rrt" +gdb_test "print rrt" " = \\(short( int)? &&\\) @$hex: -1" "print value of rrt" gdb_test "ptype rrt" "type = short( int)? &&" diff --git a/gdb/testsuite/gdb.cp/save-bp-qualified.exp b/gdb/testsuite/gdb.cp/save-bp-qualified.exp index f59be3bc8d9..ae7a9d55460 100644 --- a/gdb/testsuite/gdb.cp/save-bp-qualified.exp +++ b/gdb/testsuite/gdb.cp/save-bp-qualified.exp @@ -26,7 +26,7 @@ proc restart {} { clean_restart $testfile - if ![runto_main] { + if {![runto_main]} { return 0 } # Delete all breakpoints, watchpoints, tracepoints, and catchpoints so that @@ -37,7 +37,7 @@ proc restart {} { } with_test_prefix "save" { - if ![restart] { + if {![restart]} { return -1 } @@ -55,7 +55,7 @@ with_test_prefix "save" { } with_test_prefix "restore" { - if ![restart] { + if {![restart]} { return -1 } diff --git a/gdb/testsuite/gdb.cp/static-typedef-print.exp b/gdb/testsuite/gdb.cp/static-typedef-print.exp index 1f0387f0927..1f06dee61b6 100644 --- a/gdb/testsuite/gdb.cp/static-typedef-print.exp +++ b/gdb/testsuite/gdb.cp/static-typedef-print.exp @@ -21,7 +21,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.cp/step-and-next-inline.exp b/gdb/testsuite/gdb.cp/step-and-next-inline.exp index 492a46fa166..92caed1c9fa 100644 --- a/gdb/testsuite/gdb.cp/step-and-next-inline.exp +++ b/gdb/testsuite/gdb.cp/step-and-next-inline.exp @@ -81,7 +81,7 @@ proc do_test { use_header } { clean_restart $executable - if ![runto $main_location qualified] { + if {![runto $main_location qualified]} { return } @@ -105,7 +105,7 @@ proc do_test { use_header } { # that some easier heuristic could be figured out). Still, it is # not certain that the first failure wouldn't also be fixed by # having location view support, so for now it is tagged as such. - set have_kfail [expr [test_compiler_info gcc*] && !$use_header] + set have_kfail [expr {[test_compiler_info gcc*] && !$use_header}] set ok 1 gdb_test_multiple "next" "next step 1" { @@ -206,7 +206,7 @@ proc do_test { use_header } { clean_restart ${executable} - if ![runto_main] { + if {![runto_main]} { return } diff --git a/gdb/testsuite/gdb.cp/subtypes.exp b/gdb/testsuite/gdb.cp/subtypes.exp index e3b8de09791..540086c17ce 100644 --- a/gdb/testsuite/gdb.cp/subtypes.exp +++ b/gdb/testsuite/gdb.cp/subtypes.exp @@ -31,7 +31,7 @@ if {[prepare_for_testing "failed to prepare" $testfile \ } # Xfail for superfluous DW_TAG_lexical_block, gcc PR debug/55541. -set have_xfail [expr [test_compiler_info gcc-*] && [gcc_major_version] < 5] +set have_xfail [expr {[test_compiler_info gcc-*] && [gcc_major_version] < 5}] gdb_test "ptype Outer::Inner::InnerInner" \ "type = struct Outer::Inner::InnerInner.*" diff --git a/gdb/testsuite/gdb.cp/temargs.exp b/gdb/testsuite/gdb.cp/temargs.exp index d2f70fa1941..750f739f733 100644 --- a/gdb/testsuite/gdb.cp/temargs.exp +++ b/gdb/testsuite/gdb.cp/temargs.exp @@ -76,13 +76,13 @@ gdb_test "break $srcfile:$line" "Breakpoint 7.*" \ gdb_continue_to_breakpoint "continue to first breakpoint for temargs" -if $have_older_template_gcc { setup_xfail "*-*-*" } +if {$have_older_template_gcc} { setup_xfail "*-*-*" } gdb_test "ptype T" "double" "test type of T in base_m" -if $have_older_template_gcc { setup_xfail "*-*-*" } +if {$have_older_template_gcc} { setup_xfail "*-*-*" } gdb_test "print I" " = 23" "test value of I in base_m" -if $have_older_template_gcc { setup_xfail "*-*-*" } +if {$have_older_template_gcc} { setup_xfail "*-*-*" } gdb_test "print P == &a_global" " = true" "test value of P in base_m" if {!$have_pr_41736_fixed} { setup_xfail *-*-* } @@ -101,7 +101,7 @@ gdb_test "ptype T" "long" "test type of T in inner_m" if {!$have_pr_45024_fixed} { setup_xfail *-*-* } gdb_test "print I" " = 47" "test value of I in inner_m" -if $have_older_template_gcc { setup_xfail "*-*-*" +if {$have_older_template_gcc} { setup_xfail "*-*-*" } elseif {[test_compiler_info {gcc-[0-3]-*}] || [test_compiler_info {gcc-4-[0-5]-*}]} { # gcc-4.5.x still does not emit inner DW_TAG_structure_type. @@ -112,7 +112,7 @@ gdb_test "print P == &a_global" " = true" "test value of P in inner_m" if {!$have_pr_41736_fixed} { setup_xfail *-*-* } gdb_test "print MP" "&S::f" "test value of MP in inner_m" -if $have_older_template_gcc { setup_xfail "*-*-*" +if {$have_older_template_gcc} { setup_xfail "*-*-*" } elseif {[test_compiler_info {gcc-[0-3]-*}] || [test_compiler_info {gcc-4-[0-5]-*}]} { # gcc-4.5.x still does not emit outer DW_TAG_structure_type. @@ -126,17 +126,17 @@ gdb_test "whatis Z" "float" "test type of Z in inner_m" gdb_continue_to_breakpoint "continue to third breakpoint for temargs" -if $have_older_template_gcc { setup_xfail "*-*-*" } +if {$have_older_template_gcc} { setup_xfail "*-*-*" } gdb_test "ptype T" "unsigned char" "test type of T in func" -if $have_older_template_gcc { setup_xfail "*-*-*" } +if {$have_older_template_gcc} { setup_xfail "*-*-*" } gdb_test "print I" " = 91" "test value of I in func" # PR symtab/16842 - gdb used to crash here. -if $have_older_template_gcc { setup_xfail "*-*-*" } +if {$have_older_template_gcc} { setup_xfail "*-*-*" } gdb_test "info addr I" "Symbol \"I\" is constant." "test address of I in func" -if $have_older_template_gcc { setup_xfail "*-*-*" } +if {$have_older_template_gcc} { setup_xfail "*-*-*" } gdb_test "print P == &a_global" " = true" "test value of P in func" if {!$have_pr_41736_fixed} { setup_xfail *-*-* } @@ -148,23 +148,23 @@ gdb_test "print MP" "&S::f" "test value of MP in func" gdb_continue_to_breakpoint "continue to fourth breakpoint for temargs" -if $have_older_template_gcc { setup_xfail "*-*-*" } +if {$have_older_template_gcc} { setup_xfail "*-*-*" } gdb_test "ptype T" "double" "test type of T in templ_m" -if $have_older_template_gcc { setup_xfail "*-*-*" } +if {$have_older_template_gcc} { setup_xfail "*-*-*" } gdb_test "print I" " = 23" "test value of I in templ_m" # PR symtab/16842 - gdb used to crash here. -if $have_older_template_gcc { setup_xfail "*-*-*" } +if {$have_older_template_gcc} { setup_xfail "*-*-*" } gdb_test "info addr I" "Symbol \"I\" is constant." "test address of I in templ_m" -if $have_older_template_gcc { setup_xfail "*-*-*" } +if {$have_older_template_gcc} { setup_xfail "*-*-*" } gdb_test "print P == &a_global" " = true" "test value of P in templ_m" if {!$have_pr_41736_fixed} { setup_xfail *-*-* } gdb_test "print MP" "&S::f" "test value of MP in templ_m" -if $have_older_template_gcc { setup_xfail "*-*-*" } +if {$have_older_template_gcc} { setup_xfail "*-*-*" } gdb_test "whatis Q" "short" "test type of Q in templ_m" # @@ -173,7 +173,7 @@ gdb_test "whatis Q" "short" "test type of Q in templ_m" gdb_continue_to_breakpoint "continue to fifth breakpoint for temargs" -if $have_older_template_gcc { setup_xfail "*-*-*" } +if {$have_older_template_gcc} { setup_xfail "*-*-*" } gdb_test "ptype F" "type = void \\\(S::\\\*\\\)\\\(S \\\* const\\\)" \ "test type of F in k2_m" @@ -189,11 +189,11 @@ gdb_test "print F" "&S::somefunc" "test value of F in k2_m" gdb_continue_to_breakpoint "continue to sixth breakpoint for temargs" -if $have_older_template_gcc { setup_xfail "*-*-*" +if {$have_older_template_gcc} { setup_xfail "*-*-*" } elseif { $using_gcc } { setup_xfail gcc/49546 "*-*-*" } gdb_test "ptype F" {type = void \(\*\)\(int\)} "test type of F in k3_m" -if $have_older_template_gcc { setup_xfail "*-*-*" +if {$have_older_template_gcc} { setup_xfail "*-*-*" } elseif { $using_gcc } { setup_xfail gcc/49546 "*-*-*" } gdb_test "print F" { = \(void \(\*\)\(int\)\) 0x[0-9a-f]+ } \ "test value of F in k3_m" diff --git a/gdb/testsuite/gdb.cp/templates.exp b/gdb/testsuite/gdb.cp/templates.exp index 52d0229ae03..6dd4e660434 100644 --- a/gdb/testsuite/gdb.cp/templates.exp +++ b/gdb/testsuite/gdb.cp/templates.exp @@ -143,7 +143,7 @@ proc test_template_breakpoints {} { "constructor breakpoint (bad menu choices)" } } - + gdb_test_multiple "break T5::~T5" "destructor_breakpoint" { -re "Breakpoint.*at.* file .*${testfile}.cc, line.*$gdb_prompt $" { @@ -154,7 +154,7 @@ proc test_template_breakpoints {} { kfail "gdb/8217" "destructor breakpoint" } } - + gdb_test "break T5::value" \ "Breakpoint.*at.* file .*${testfile}.cc, line.*" \ "value method breakpoint" @@ -191,7 +191,7 @@ proc test_template_breakpoints {} { proc test_template_calls {} { global gdb_prompt - if [target_info exists gdb,cannot_call_functions] { + if {[target_info exists gdb,cannot_call_functions]} { unsupported "this target can not call functions" return } @@ -264,7 +264,7 @@ proc do_tests {} { test_template_typedef test_template_args - if [ runto_main] { + if {[ runto_main]} { test_template_calls } } diff --git a/gdb/testsuite/gdb.cp/typedef-base.exp b/gdb/testsuite/gdb.cp/typedef-base.exp index 2421b5920f3..a6780da7e06 100644 --- a/gdb/testsuite/gdb.cp/typedef-base.exp +++ b/gdb/testsuite/gdb.cp/typedef-base.exp @@ -23,7 +23,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.cp/typedef-operator.exp b/gdb/testsuite/gdb.cp/typedef-operator.exp index 94232d70c9a..92143716435 100644 --- a/gdb/testsuite/gdb.cp/typedef-operator.exp +++ b/gdb/testsuite/gdb.cp/typedef-operator.exp @@ -27,7 +27,7 @@ gdb_test_no_output "set language c++" gdb_test "p *u" {You can't do that without a process to debug.} "test crash" -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.cp/typeid.exp b/gdb/testsuite/gdb.cp/typeid.exp index e45239aa654..bd97b26c6e4 100644 --- a/gdb/testsuite/gdb.cp/typeid.exp +++ b/gdb/testsuite/gdb.cp/typeid.exp @@ -63,7 +63,7 @@ with_test_prefix "before starting" { do_typeid_tests 0 } -if ![runto_main] { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.cp/userdef.exp b/gdb/testsuite/gdb.cp/userdef.exp index 27f981d26a4..05ff8b710a5 100644 --- a/gdb/testsuite/gdb.cp/userdef.exp +++ b/gdb/testsuite/gdb.cp/userdef.exp @@ -32,7 +32,7 @@ if {![runto_main]} { } gdb_test "break marker1" \ - "Breakpoint .*${srcfile}.*" + "Breakpoint .*${srcfile}.*" gdb_test "cont" \ "Break.* marker1(\\(\\)|) \\(\\) at .*:$decimal.*" \ @@ -58,7 +58,7 @@ gdb_test_multiple "frame" "re-selected 'main' frame after inferior call" { pass "re-selected 'main' frame after inferior call" } } - + gdb_test "print one - two" "\\\$\[0-9\]* = {x = -2, y = -2}" gdb_test "print one * two" "\\\$\[0-9\]* = {x = 8, y = 15}" diff --git a/gdb/testsuite/gdb.cp/virtfunc.exp b/gdb/testsuite/gdb.cp/virtfunc.exp index 391844d80d0..e63d64afbee 100644 --- a/gdb/testsuite/gdb.cp/virtfunc.exp +++ b/gdb/testsuite/gdb.cp/virtfunc.exp @@ -176,7 +176,7 @@ proc test_virtual_calls {} { global gdb_prompt global nl - if [target_info exists gdb,cannot_call_functions] { + if {[target_info exists gdb,cannot_call_functions]} { unsupported "this target can not call functions" return 0 } diff --git a/gdb/testsuite/gdb.cp/vla-cxx.exp b/gdb/testsuite/gdb.cp/vla-cxx.exp index 8f195527599..10f598d5323 100644 --- a/gdb/testsuite/gdb.cp/vla-cxx.exp +++ b/gdb/testsuite/gdb.cp/vla-cxx.exp @@ -23,7 +23,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $flags] } { return -1 } -if ![runto_main] { +if {![runto_main]} { return -1 }