]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite, tclint] Fix gdb.cp
authorTom de Vries <tdevries@suse.de>
Tue, 30 Sep 2025 19:32:50 +0000 (21:32 +0200)
committerTom de Vries <tdevries@suse.de>
Tue, 30 Sep 2025 19:32:50 +0000 (21:32 +0200)
Running tclint on the test-cases in gdb.cp shows a few problems.

Fix these.

56 files changed:
gdb/tclint.toml
gdb/testsuite/gdb.cp/abstract-origin.exp
gdb/testsuite/gdb.cp/annota2.exp
gdb/testsuite/gdb.cp/annota3.exp
gdb/testsuite/gdb.cp/anon-union.exp
gdb/testsuite/gdb.cp/call-method-register.exp
gdb/testsuite/gdb.cp/casts.exp
gdb/testsuite/gdb.cp/classes.exp
gdb/testsuite/gdb.cp/cmpd-minsyms.exp
gdb/testsuite/gdb.cp/cpexprs.exp.tcl
gdb/testsuite/gdb.cp/cplusfuncs.exp
gdb/testsuite/gdb.cp/demangle.exp
gdb/testsuite/gdb.cp/derivation.exp
gdb/testsuite/gdb.cp/destrprint.exp
gdb/testsuite/gdb.cp/dispcxx.exp
gdb/testsuite/gdb.cp/empty-enum.exp
gdb/testsuite/gdb.cp/except-multi-location.exp
gdb/testsuite/gdb.cp/exception.exp
gdb/testsuite/gdb.cp/exceptprint.exp
gdb/testsuite/gdb.cp/expand-sals.exp
gdb/testsuite/gdb.cp/formatted-ref.exp
gdb/testsuite/gdb.cp/gdb1355.exp
gdb/testsuite/gdb.cp/incomplete-type-overload.exp
gdb/testsuite/gdb.cp/infcall-nodebug.exp.tcl
gdb/testsuite/gdb.cp/iostream.exp
gdb/testsuite/gdb.cp/local.exp
gdb/testsuite/gdb.cp/m-static.exp
gdb/testsuite/gdb.cp/many-args.exp
gdb/testsuite/gdb.cp/mb-inline.exp
gdb/testsuite/gdb.cp/mb-templates.exp
gdb/testsuite/gdb.cp/method-call-in-c.exp
gdb/testsuite/gdb.cp/method.exp
gdb/testsuite/gdb.cp/misc.exp
gdb/testsuite/gdb.cp/namespace.exp
gdb/testsuite/gdb.cp/nested-types.exp
gdb/testsuite/gdb.cp/nextoverthrow.exp
gdb/testsuite/gdb.cp/nsusing.exp
gdb/testsuite/gdb.cp/overload-const.exp
gdb/testsuite/gdb.cp/overload.exp
gdb/testsuite/gdb.cp/ovldbreak.exp
gdb/testsuite/gdb.cp/pass-by-ref.exp
gdb/testsuite/gdb.cp/psmang.exp
gdb/testsuite/gdb.cp/rvalue-ref-params.exp
gdb/testsuite/gdb.cp/rvalue-ref-types.exp
gdb/testsuite/gdb.cp/save-bp-qualified.exp
gdb/testsuite/gdb.cp/static-typedef-print.exp
gdb/testsuite/gdb.cp/step-and-next-inline.exp
gdb/testsuite/gdb.cp/subtypes.exp
gdb/testsuite/gdb.cp/temargs.exp
gdb/testsuite/gdb.cp/templates.exp
gdb/testsuite/gdb.cp/typedef-base.exp
gdb/testsuite/gdb.cp/typedef-operator.exp
gdb/testsuite/gdb.cp/typeid.exp
gdb/testsuite/gdb.cp/userdef.exp
gdb/testsuite/gdb.cp/virtfunc.exp
gdb/testsuite/gdb.cp/vla-cxx.exp

index ba6fbd92ef2e48ef41c734a47c2eb8913827a558..e6283e49d63e1a3a3261ca6b2ec30fe45006bd01 100644 (file)
@@ -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):
index c9d4194ae68ce5111f8613addcad2b6a6de5a930..f54cb9ad53dc97ec7c79543353d59b28edc2449d 100644 (file)
@@ -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
 }
 
index 14fe8ef4cfc16786908b18ba4c5a514236170416..16344bd7474d6e33f6bd065fd4c79d4c74420f49 100644 (file)
@@ -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
 # <return> 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)
 #
 
index c1f96acf5761fe2f8c986d24892ab713914a32ce..db3f69648a46f5f48b4afa7fc31ba2d045b801f4 100644 (file)
@@ -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
 # <return> 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)
 #
 
index ae19f3b8bfd65a485879584442925540390f4d4c..fb36b495a49ab95985a218fb9e5f2b7084f3ca07 100644 (file)
@@ -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
index b736312a65e4a6aa0360ed19a1055b960a8e16c7..522da0af7a2259d9979509b61926b4ae40af56ff 100644 (file)
@@ -108,7 +108,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 42c5d1f68cab942392ec6eac821a1b2c670cabc3..c03a946d0c49d2f656296c32be84a63f53182123 100644 (file)
@@ -70,12 +70,12 @@ gdb_test "print * (B *) a" ".* = {<A> = {a = 42}, b = 1729}" \
 gdb_test "print * b" ".* = {<A> = {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"
 
index cb6a862ff60226acbdcbcbe3ea832d1013662332..ad637496088310a915814cc55182e33003f65df9 100644 (file)
@@ -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"
index 62952bd06a7cf1fb76ebfd72604cb29a74ced08d..cb31baee67b4df1bbb2fafcc18e6f879c009b892 100644 (file)
@@ -36,7 +36,7 @@ foreach sym $min_syms {
     set tst "setting breakpoint at '$sym'"
     if {[gdb_breakpoint "'$sym'"]} {
        pass $tst
-    }    
+    }
 }
 
 
index 5c3dfd638569f30b3db8c1665154637ff6d99c3b..6766ccea19cb7170ce1cb03b0a13169bfc923a4b 100644 (file)
@@ -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 "//")
index e785909906431320809388c08a083e20706b848c..d1b4ecb4de2cd6e2df0df68a8eb0e9c4c01c2a64 100644 (file)
@@ -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 <foo::operator new\\(.*\\)(| static)>"
     gdb_test "print &foo::operator new\[\]" \
-       " = .* $hex <foo::operator new\\\[\\\]\\(.*\\)(| static)>"    
+       " = .* $hex <foo::operator new\\\[\\\]\\(.*\\)(| static)>"
 
     print_addr "foo::operator delete($dm_type_void_star)"
     print_addr "foo::operator delete\[\]($dm_type_void_star)"
index 8da43773cc9ecd75f8f93f604b80383d55054e68..420d1df2b85f89962abeaf4ebc39a947f041c0ff 100644 (file)
@@ -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 {} {
index f61e35c9c5952adc9ecd1c6546ddb1f962b4bee5..bb3dccea774ac960e78ff8eb9d45d8b769068dc7 100644 (file)
@@ -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 \]+"
index 10f66b63d0080bee113778d10696bfa7440b78fb..5ce7134631a0c12e3d9dd17c143214b2005392f6 100644 (file)
@@ -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
 }
 
index 3d4703ffe81542564842e95790e2649b1e19c6f2..107e967d2fa145eeea795f862ed3808b5e3e3a9e 100644 (file)
@@ -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
index f640e34301576290f61240ccb93808265ea008b6..487d5619e44b4c22548205e9e60a77bcdfecb6c1 100644 (file)
@@ -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 \\{\\}" {
index 378044734ca8673c75adb26f2a09ba5744df7194..0c3222dbcbb884388101d6fd668b7bfefd01414e 100644 (file)
@@ -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
     }
 
index cb20f172a64aa0d530589899d52e737fd809c972..45fa299755ebe19141cf6b86fbe130355425a7a6 100644 (file)
@@ -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"
index 09e35fdb6ed3005f0b3065f8aaacf59e4d0eefab..8f034e449b85bde1f3d8ba9b123c8aa25f8b1aae 100644 (file)
@@ -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"
index 8d542476b793c20c82ce01567d1275af2d780127..df6fb6aa96300ff3895fc94cb3a712d6940ccc7a 100644 (file)
@@ -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
 }
 
index 0c974adf3529da2d225d630900d6bc227b928ccc..bf0aae3861be82cd8cf06d2030da6c2ed04fbefb 100644 (file)
@@ -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)"
         }
index 3120b1f8891b26f3af2c44c50a9af982f010c847..c54723d98eb7f7d4331a118d54dca437d1adfb28 100644 (file)
@@ -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
index aa582e01406008a1d9ab479519d30a66eaf5cf8c..efb1fd34f4c6fb632780767ab5d0944f06208800 100644 (file)
@@ -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
 }
 
index 764d31ddb56014e46a21e516de091e3c05d95912..b743498d71bb282dde9699a8fc9b5a8fcaa87493 100644 (file)
@@ -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
 }
index 8d96a9fdcc178af151deb7d91c01d7f26a8d85b0..621695fb3f1d172e2d46967f78ec1ddd63859293 100644 (file)
@@ -24,7 +24,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return
 }
 
index 621f2f6e56ccf4fa7e9040c8c3cb70c28740196c..7c13de01243237f30cd4856fe1951ecc152a58b8 100644 (file)
@@ -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
 
 # ---
index 6b108040da5d4503f7e1a59e35cb0a8b6684d3d0..1769ba74e1e529db1286b832b86d709ee18ab3a9 100644 (file)
@@ -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:
 
index b7e5a8e5cc4630ccabf8b22f3b08ce266799b4a4..fcb0a363d5885a9aecdc655b5d767fe13bf85c77 100644 (file)
@@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return
 }
 
index d6b30b8bb4d15e91c0c3bb99bb48a65c284e9c2a..579bcc64bf3317f44c50e107e11b65962c14c10c 100644 (file)
@@ -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
index 0354a5a9ddca537590f6a5c1fff194a606414679..b067cb073c11403cc249ed274b9b3e08e3a53f2a 100644 (file)
@@ -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<int> \\(i=1\\).*" "separate condition: run to breakpoint"
 
index 6cbdda055e7175a78548292bb3c14518fb4575e0..b0201adb656ffb0ebac5949230a9f3fe9a3df4c1 100644 (file)
@@ -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}\\\}"
 
index 2e0f4124d953bc381e5e3f898cb5f7849ead7031..410647a6f413ba764fa3b3816b605347ce893504 100644 (file)
@@ -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)"
     }
 }
 
index 6d3e000abd91ba807a203b709322f304b4279c77..64003951fc4d71d92687fc8e2ed9b5c48f1e8197 100644 (file)
@@ -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
index 0ba8387b4983b59ce346064155e294cc6c40a031..6569f792b40e9147dd5d8a857e925eb7f5e498f1 100644 (file)
@@ -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.
index 620b4f21a8bc873199bf17ce0f508561c2952aad..28ce8e0c094e00b5ad3d011e110c5c95d5418093 100644 (file)
@@ -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"
index 2548305df504298a94914375f1507d5661681156..e3aae28b7c5b52e2c39857377e6be2eb29933070 100644 (file)
@@ -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"
index 988bf2f14934edbd676aceeba64512cc0578eb8d..90fd9fe29bed51f367ce97e6366bf87219d82756 100644 (file)
@@ -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.*" {
index 75176b98625b507344c5a80e5423191778c0b3cf..6b6056e501063c626e8ad53a3a6993f6bf85199e 100644 (file)
@@ -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"
 }
index af5b23b725b9e7a08b369d60e85d6f071e1f1cd3..aa1daa496fbf811a0ada17c09e212707727d9ef3 100644 (file)
@@ -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\\)\""
index fd9fb949003560841d01247b39cdcde2e6b0193b..9b8c6d19fa820e0132e3e40870ba30c2b20e4df7 100644 (file)
@@ -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"
index 75b52578f7f27e6c53255e740b6ac2be41d60238..4c1266663fbf93f79fba6561f425cceac6992740 100644 (file)
@@ -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"
index 67bc9cd935d83c9671b32a94b871be72aca94927..7f9ce69ee1a48a083a0fda315134bd4f8b1f1f14 100644 (file)
@@ -25,7 +25,7 @@
 # sure the test still fails:
 #
 # 2002-08-29  Jim Blandy  <jimb@redhat.com>
-# 
+#
 #      * 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)
 # 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<TAB> or 's::method1<ESC-?>
 #   (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.
 #
index 267dbc71758789fa97c60e084b2b5bb183116633..91f79eacaa365a1afe676f4b410eac885f6c732a 100644 (file)
@@ -49,7 +49,7 @@ gdb_test "print static_cast<int&&> (global_int)" " = \\(int &&\\) @$hex: 7"
 gdb_test "print static_cast<float&> (global_float)" " = \\(float &\\) @$hex: 3\\.$decimal"
 gdb_test "print static_cast<float&&> (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<Child&&>(Q))" ".* = 40.*" $t
 
index 571ab81abddd9e3ca18d48985367330f3b263af1..596abe7136222f417041ee89280dcce887aa2d3f 100644 (file)
@@ -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)? &&"
 
index f59be3bc8d9592875f08fd9c93a955a3637c3d18..ae7a9d5546095530f7a3059b441f4b8a7a78bf4f 100644 (file)
@@ -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
     }
 
index 1f0387f092747442e3189ed9543317920c4cc304..1f06dee61b6a37b51803e9265534e36fe7076920 100644 (file)
@@ -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
 }
 
index 492a46fa16663477557e5708801c37cd75c84fba..92caed1c9fa709bd64da4490f7489cdc058eb7be 100644 (file)
@@ -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
     }
 
index e3b8de09791e4c6ff5d62778aba85556e9a7a4b6..540086c17ce51992d54138b25584ed0584f9fda3 100644 (file)
@@ -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.*"
index d2f70fa19415cc08910899680697f0930d5b0145..750f739f73356d3d908eeff23ed19ed3937f825b 100644 (file)
@@ -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]+ <S3::m\(int\)>} \
         "test value of F in k3_m"
index 52d0229ae03e4a156addb2cba8797a039d7712ec..6dd4e660434285df0dc9e8b7d5d67a629394b707 100644 (file)
@@ -143,7 +143,7 @@ proc test_template_breakpoints {} {
                    "constructor breakpoint (bad menu choices)"
        }
     }
-    
+
     gdb_test_multiple "break T5<int>::~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<int>::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
     }
 }
index 2421b5920f3ec2369df7dca51926b8b72074a306..a6780da7e06f62d236a92941385bd16c1db01fc2 100644 (file)
@@ -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
 }
 
index 94232d70c9ae0990ffe817d56d3a96bf8dc10cb8..921437164354a7d307b8668fe611d6d1b0f567ca 100644 (file)
@@ -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
 }
 
index e45239aa654a35fb5ca689750951f66e4e4be190..bd97b26c6e49988d15d94c2b6ad0daa3ea7acbf1 100644 (file)
@@ -63,7 +63,7 @@ with_test_prefix "before starting" {
     do_typeid_tests 0
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 27f981d26a43260b389efb27ea6d3bdcbc4d09cf..05ff8b710a5e8ffed14b35120175255ad0534689 100644 (file)
@@ -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}"
index 391844d80d0dbb5d340724821f6b18ea04a0e3f8..e63d64afbee5fb5e4eb670527f53948e2371ef7b 100644 (file)
@@ -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
     }
index 8f19552759961ee566270220f9a635620335db99..10f598d53239bda65791f63aca2ec57409e740e5 100644 (file)
@@ -23,7 +23,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $flags] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }