]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite, tclint] Fix gdb.dwarf2
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.dwarf2 shows a few problems.

Fix these.

134 files changed:
gdb/tclint.toml
gdb/testsuite/gdb.dwarf2/anon-ns-fn.exp
gdb/testsuite/gdb.dwarf2/bad-regnum.exp
gdb/testsuite/gdb.dwarf2/bitfield-parent-optimized-out.exp
gdb/testsuite/gdb.dwarf2/break-inline-psymtab.exp
gdb/testsuite/gdb.dwarf2/callframecfa.exp
gdb/testsuite/gdb.dwarf2/clztest.exp
gdb/testsuite/gdb.dwarf2/comp-unit-lang.exp
gdb/testsuite/gdb.dwarf2/count.exp
gdb/testsuite/gdb.dwarf2/data-loc.exp
gdb/testsuite/gdb.dwarf2/debug-names-duplicate-cu.exp
gdb/testsuite/gdb.dwarf2/debug-names-missing-cu.exp
gdb/testsuite/gdb.dwarf2/debug-names-tu.exp.tcl
gdb/testsuite/gdb.dwarf2/debug-names.exp
gdb/testsuite/gdb.dwarf2/dw2-align.exp
gdb/testsuite/gdb.dwarf2/dw2-bad-elf.exp
gdb/testsuite/gdb.dwarf2/dw2-bfloat16.exp
gdb/testsuite/gdb.dwarf2/dw2-canonicalize-type.exp
gdb/testsuite/gdb.dwarf2/dw2-case-insensitive.exp
gdb/testsuite/gdb.dwarf2/dw2-complex-parts.exp
gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.exp
gdb/testsuite/gdb.dwarf2/dw2-disasm-over-non-stmt.exp
gdb/testsuite/gdb.dwarf2/dw2-dos-drive.exp
gdb/testsuite/gdb.dwarf2/dw2-dup-frame.exp
gdb/testsuite/gdb.dwarf2/dw2-entry-pc.exp
gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp
gdb/testsuite/gdb.dwarf2/dw2-entry-value.exp
gdb/testsuite/gdb.dwarf2/dw2-epilogue-begin.exp.tcl
gdb/testsuite/gdb.dwarf2/dw2-fixed-point.exp
gdb/testsuite/gdb.dwarf2/dw2-gas-workaround.exp
gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter.exp
gdb/testsuite/gdb.dwarf2/dw2-inline-header-1.exp
gdb/testsuite/gdb.dwarf2/dw2-inline-header-2.exp
gdb/testsuite/gdb.dwarf2/dw2-inline-header-3.exp
gdb/testsuite/gdb.dwarf2/dw2-inline-many-frames.exp
gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp
gdb/testsuite/gdb.dwarf2/dw2-inline-small-func.exp
gdb/testsuite/gdb.dwarf2/dw2-inline-stepping.exp
gdb/testsuite/gdb.dwarf2/dw2-inter-cu-error-2.exp
gdb/testsuite/gdb.dwarf2/dw2-inter-cu-error.exp
gdb/testsuite/gdb.dwarf2/dw2-inter-cu-forth-and-back.exp
gdb/testsuite/gdb.dwarf2/dw2-inter-cu-symbol.exp
gdb/testsuite/gdb.dwarf2/dw2-is-stmt-2.exp
gdb/testsuite/gdb.dwarf2/dw2-is-stmt.exp
gdb/testsuite/gdb.dwarf2/dw2-line-number-zero.exp
gdb/testsuite/gdb.dwarf2/dw2-lines.exp
gdb/testsuite/gdb.dwarf2/dw2-main-no-line-number.exp
gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.exp
gdb/testsuite/gdb.dwarf2/dw2-no-code-cu.exp
gdb/testsuite/gdb.dwarf2/dw2-noloc.exp
gdb/testsuite/gdb.dwarf2/dw2-op-call.exp
gdb/testsuite/gdb.dwarf2/dw2-op-out-param.exp
gdb/testsuite/gdb.dwarf2/dw2-opt-structptr.exp
gdb/testsuite/gdb.dwarf2/dw2-out-of-range-end-of-seq.exp
gdb/testsuite/gdb.dwarf2/dw2-param-error.exp
gdb/testsuite/gdb.dwarf2/dw2-prologue-end.exp
gdb/testsuite/gdb.dwarf2/dw2-ranges-base.exp
gdb/testsuite/gdb.dwarf2/dw2-ranges-func.exp
gdb/testsuite/gdb.dwarf2/dw2-ranges-overlap.exp
gdb/testsuite/gdb.dwarf2/dw2-ranges-psym-warning.exp
gdb/testsuite/gdb.dwarf2/dw2-ranges-psym.exp
gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp
gdb/testsuite/gdb.dwarf2/dw2-reg-undefined.exp
gdb/testsuite/gdb.dwarf2/dw2-restore.exp
gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.exp
gdb/testsuite/gdb.dwarf2/dw2-step-between-different-inline-functions.exp
gdb/testsuite/gdb.dwarf2/dw2-step-between-inline-func-blocks.exp
gdb/testsuite/gdb.dwarf2/dw2-step-out-of-function-no-stmt.exp
gdb/testsuite/gdb.dwarf2/dw2-undefined-ret-addr.exp
gdb/testsuite/gdb.dwarf2/dw2-unexpected-entry-pc.exp
gdb/testsuite/gdb.dwarf2/dw2-unresolved.exp
gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.exp
gdb/testsuite/gdb.dwarf2/dw2-unusual-field-names.exp
gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp
gdb/testsuite/gdb.dwarf2/dw2-var-zero-addr.exp
gdb/testsuite/gdb.dwarf2/dw2-vendor-extended-opcode.exp
gdb/testsuite/gdb.dwarf2/dw2-weird-type-len.exp
gdb/testsuite/gdb.dwarf2/dw2-wrong-mangled-name.exp
gdb/testsuite/gdb.dwarf2/dw4-sig-types.exp
gdb/testsuite/gdb.dwarf2/dw4-toplevel-types.exp
gdb/testsuite/gdb.dwarf2/dw5-rnglist-test.exp
gdb/testsuite/gdb.dwarf2/dwp-sepdebug.exp
gdb/testsuite/gdb.dwarf2/dwp-symlink.exp
gdb/testsuite/gdb.dwarf2/dwz.exp
gdb/testsuite/gdb.dwarf2/dyn-type-unallocated.exp
gdb/testsuite/gdb.dwarf2/dynarr-ptr.exp
gdb/testsuite/gdb.dwarf2/fission-absolute-dwo.exp
gdb/testsuite/gdb.dwarf2/fission-base.exp
gdb/testsuite/gdb.dwarf2/fission-loclists-pie.exp
gdb/testsuite/gdb.dwarf2/fission-loclists.exp
gdb/testsuite/gdb.dwarf2/fission-multi-cu.exp
gdb/testsuite/gdb.dwarf2/fission-relative-dwo.exp
gdb/testsuite/gdb.dwarf2/fission-reread.exp
gdb/testsuite/gdb.dwarf2/formdata16.exp
gdb/testsuite/gdb.dwarf2/fortran-var-string.exp
gdb/testsuite/gdb.dwarf2/gdb-index.exp
gdb/testsuite/gdb.dwarf2/implptr-64bit.exp
gdb/testsuite/gdb.dwarf2/implptr-optimized-out.exp
gdb/testsuite/gdb.dwarf2/implptr.exp
gdb/testsuite/gdb.dwarf2/implptrconst.exp
gdb/testsuite/gdb.dwarf2/implptrpiece.exp
gdb/testsuite/gdb.dwarf2/implref-array.exp
gdb/testsuite/gdb.dwarf2/implref-const.exp
gdb/testsuite/gdb.dwarf2/implref-global.exp
gdb/testsuite/gdb.dwarf2/implref-struct.exp
gdb/testsuite/gdb.dwarf2/imported-unit-abstract-const-value.exp
gdb/testsuite/gdb.dwarf2/imported-unit-c.exp
gdb/testsuite/gdb.dwarf2/imported-unit-runto-main.exp
gdb/testsuite/gdb.dwarf2/imported-unit.exp
gdb/testsuite/gdb.dwarf2/info-locals-optimized-out.exp
gdb/testsuite/gdb.dwarf2/inline.exp
gdb/testsuite/gdb.dwarf2/intbits.exp
gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp
gdb/testsuite/gdb.dwarf2/macro-source-path.exp.tcl
gdb/testsuite/gdb.dwarf2/missing-type-name-for-templates.exp
gdb/testsuite/gdb.dwarf2/missing-type-name.exp
gdb/testsuite/gdb.dwarf2/nonvar-access.exp
gdb/testsuite/gdb.dwarf2/nullptr_t.exp
gdb/testsuite/gdb.dwarf2/opaque-type-lookup.exp
gdb/testsuite/gdb.dwarf2/per-bfd-sharing.exp
gdb/testsuite/gdb.dwarf2/pieces-optimized-out.exp
gdb/testsuite/gdb.dwarf2/pieces.exp
gdb/testsuite/gdb.dwarf2/pr11465.exp
gdb/testsuite/gdb.dwarf2/self-spec.exp
gdb/testsuite/gdb.dwarf2/struct-with-sig.exp
gdb/testsuite/gdb.dwarf2/symbol_needs_eval_fail.exp
gdb/testsuite/gdb.dwarf2/symbol_needs_eval_timeout.exp
gdb/testsuite/gdb.dwarf2/template-specification-full-name.exp
gdb/testsuite/gdb.dwarf2/typeddwarf.exp
gdb/testsuite/gdb.dwarf2/valop.exp
gdb/testsuite/gdb.dwarf2/var-access.exp
gdb/testsuite/gdb.dwarf2/variant.exp
gdb/testsuite/gdb.dwarf2/varval.exp
gdb/testsuite/gdb.dwarf2/void-type.exp

index e37c7d9f3a580888c292fae338d488e9e95709bb..f32d064882935142a4a983db9406ffbbf7938d32 100644 (file)
@@ -36,7 +36,6 @@ exclude = [
 "gdb/testsuite/lib",
 "gdb/testsuite/gdb.arch",
 "gdb/testsuite/gdb.base",
-"gdb/testsuite/gdb.dwarf2",
 # IGNORE (document reason in trailing comment):
 "gdb/testsuite/gdb.stabs", # To be removed.
 ]
index 4f6701f035e8dd5553d84f35912b5986dd23b530..40177449f33d201d015c0474d63b3f47ea22b69a 100644 (file)
@@ -17,7 +17,7 @@ require allow_cplus_tests
 
 standard_testfile .cc
 
-if [prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
index eea13af3aa4ed23982df2ed0172a790098ebb39e..f81826f69fef182cf3b52718c088084c1143533b 100644 (file)
@@ -65,7 +65,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 82eaed776cdb57ac92d852556e1dd1f043d5f187..59330ac6b499d38dcc729d81efaf5e7a67b428d4 100644 (file)
@@ -69,11 +69,11 @@ Dwarf::assemble $asm_file {
     }
 }
 
-if [prepare_for_testing "failed to prepare" $executable "${asm_file} ${srcfile}" {}] {
+if {[prepare_for_testing "failed to prepare" $executable "${asm_file} ${srcfile}" {}]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index a9eddc39b1b3b121b36d34fac5b5e140438c8be3..ff9f41f94f73a3e2a8ac13867e39e115f8e6e4ac 100644 (file)
@@ -20,7 +20,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} $sources] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 712e51e4e0e0529aa7d0c13c4ef31c6ba3c94618..2dd036fd00e2794d83f2d1efd5b4d1531103cd95 100644 (file)
@@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 93c2cedd94086ec26c33b1f5e4963d636f80cf79..554077ac77db83f89f2c4a63d8e76b7c649006cc 100644 (file)
@@ -29,7 +29,7 @@ if { [prepare_for_testing "failed to prepare" "${test}" ${test}.S \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index f4d91951551987819e7c6bef035e68e64a759ecd..b1e890ce44d82f36a1d5ad08a41ac3eba8783683 100644 (file)
@@ -59,7 +59,7 @@ proc do_test {cu_lang gdb_lang} {
        return -1
     }
 
-    if ![runto func] {
+    if {![runto func]} {
        return -1
     }
 
index 4d2ec311dc7cff4f6a9ea0d1a1d6231a630e5374..92b0ebf194f8df0b86c40eb8cbfad8b791338a57 100644 (file)
@@ -130,7 +130,7 @@ if { [prepare_for_testing "failed to prepare" $testfile \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 94b9e09e8d7c55ba8e6edea8f9582ecec0b33332..615d04bfaf585ae502b18b5e1aeb48e4b0231537 100644 (file)
@@ -124,7 +124,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 28f215711847ccccc67e8e49c738ed6546eb2ff6..583b230fd41bbc243ab21e3f9c5e3f127bb1d4d6 100644 (file)
@@ -59,8 +59,8 @@ Dwarf::assemble {
     }
 }
 
-if [prepare_for_testing "failed to prepare" $testfile "${asm_file} ${srcfile}" \
-       [list ldflags=-nostartfiles]] {
+if {[prepare_for_testing "failed to prepare" $testfile "${asm_file} ${srcfile}" \
+        [list ldflags=-nostartfiles]]} {
     return -1
 }
 
index 77db144275832db040928904241ea01ddf7be6ae..936cfe56eb69517fe3e31a134aabf09c6cb4ed8f 100644 (file)
@@ -66,8 +66,8 @@ Dwarf::assemble {
     }
 }
 
-if [prepare_for_testing "failed to prepare" $testfile "${asm_file} ${srcfile}" \
-       [list ldflags=-nostartfiles]] {
+if {[prepare_for_testing "failed to prepare" $testfile "${asm_file} ${srcfile}" \
+        [list ldflags=-nostartfiles]]} {
     return -1
 }
 
index 4de96ffe20e8833bd1780d50cb79b9bdd09c8fde..19d618f9860e491720070085b30cdc8a8482c8cb 100644 (file)
@@ -83,8 +83,8 @@ Dwarf::assemble {
     }
 }
 
-if [prepare_for_testing "failed to prepare" $testfile "${asm_file} ${srcfile}" \
-       [list ldflags=-nostartfiles]] {
+if {[prepare_for_testing "failed to prepare" $testfile "${asm_file} ${srcfile}" \
+        [list ldflags=-nostartfiles]]} {
     return -1
 }
 
index 7f63af29b4343d11dd125620dadacf83a1d1156f..d099aa9ed60da57a357195cfe06ca7cc6e32f4e2 100644 (file)
@@ -58,8 +58,8 @@ Dwarf::assemble {
     }
 }
 
-if [prepare_for_testing "failed to prepare" $testfile "${asm_file} ${srcfile}" \
-       [list ldflags=-nostartfiles]] {
+if {[prepare_for_testing "failed to prepare" $testfile "${asm_file} ${srcfile}" \
+        [list ldflags=-nostartfiles]]} {
     return -1
 }
 
index dfb11af8c1c38094232d990e00b8004d62e6471a..84f016bc3f717ff2d2ca3ed8befc36c6ba84edaf 100644 (file)
@@ -71,7 +71,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index a0ae49807a248585880da69573c5e8e25bae9916..429386f26d07a881f4b0b45c8aa12a33aeaa5038 100644 (file)
@@ -173,7 +173,7 @@ proc run_test { goto_main } {
     clean_restart ${::testfile}
 
     if { $goto_main } {
-       if ![runto_main] {
+       if {![runto_main]} {
            return -1
        }
     }
index b8f96a19ab06cb25cff63275ca417af56bd442ef..271b6ec65faf7e08d082f57c2a9362f8ee6fdd85 100644 (file)
@@ -71,7 +71,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 73567adf26276eb76e96773a82d60d3f6ab97ffb..b5ad32bdf8671bba09545c99ea2189dd8d8b6b69 100644 (file)
@@ -23,8 +23,8 @@ set additional_flags [gdb_target_symbol_prefix_flags_asm]
 standard_testfile .S
 set executable ${testfile}
 
-if [prepare_for_testing "failed to prepare" $testfile $srcfile \
-       [list nodebug $additional_flags]] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
+        [list nodebug $additional_flags]]} {
     return -1
 }
 
index afe23a636922ce50741695f579970575ab4eb162..13015a340f8fc5127b1ee31a69b24c1d33aff77d 100644 (file)
@@ -19,7 +19,7 @@ require dwarf2_support
 
 standard_testfile .c -debug.S
 
-if [is_ilp32_target] {
+if {[is_ilp32_target]} {
     set ptrbits 32
 } else {
     set ptrbits 64
index 509924ab5fe61fd008a062a585de2b2fa463ac70..2ad358fd64cc5c5299b7ee66045a5af65bd023d7 100644 (file)
@@ -31,8 +31,8 @@ require dwarf2_support
 
 standard_testfile main.c -debug.S
 
-if [prepare_for_testing "failed to prepare" $testfile \
-       "${srcfile}" {}] {
+if {[prepare_for_testing "failed to prepare" $testfile \
+        "${srcfile}" {}]} {
     return -1
 }
 
@@ -67,19 +67,19 @@ Dwarf::assemble $asm_file {
            declare_labels cf_type cd_type cld_type
 
            cf_type: DW_TAG_base_type {
-               DW_AT_byte_size [expr 2 * $::float_size] DW_FORM_sdata
+               DW_AT_byte_size [expr {2 * $::float_size}] DW_FORM_sdata
                DW_AT_encoding   @DW_ATE_complex_float
                DW_AT_name       "complex float"
            }
 
            cd_type: DW_TAG_base_type {
-               DW_AT_byte_size [expr 2 * $::double_size] DW_FORM_sdata
+               DW_AT_byte_size [expr {2 * $::double_size}] DW_FORM_sdata
                DW_AT_encoding   @DW_ATE_complex_float
                DW_AT_name       "complex double"
            }
 
            cld_type: DW_TAG_base_type {
-               DW_AT_byte_size [expr 2 * $::long_double_size] DW_FORM_sdata
+               DW_AT_byte_size [expr {2 * $::long_double_size}] DW_FORM_sdata
                DW_AT_encoding   @DW_ATE_complex_float
                DW_AT_name       "complex long double"
            }
@@ -105,7 +105,7 @@ Dwarf::assemble $asm_file {
            declare_labels ci_type
 
            ci_type: DW_TAG_base_type {
-               DW_AT_byte_size [expr 2 * $::int_size] DW_FORM_sdata
+               DW_AT_byte_size [expr {2 * $::int_size}] DW_FORM_sdata
                DW_AT_encoding   @DW_ATE_lo_user
                DW_AT_name       "complex int"
            }
@@ -122,7 +122,7 @@ Dwarf::assemble $asm_file {
            declare_labels clang_cf_type clang_cd_type clang_cld_type
 
            clang_cf_type: DW_TAG_base_type {
-               DW_AT_byte_size [expr 2 * $::float_size] DW_FORM_sdata
+               DW_AT_byte_size [expr {2 * $::float_size}] DW_FORM_sdata
                DW_AT_encoding   @DW_ATE_complex_float
                DW_AT_name       "complex"
            }
@@ -133,7 +133,7 @@ Dwarf::assemble $asm_file {
            }
 
            clang_cd_type: DW_TAG_base_type {
-               DW_AT_byte_size [expr 2 * $::double_size] DW_FORM_sdata
+               DW_AT_byte_size [expr {2 * $::double_size}] DW_FORM_sdata
                DW_AT_encoding   @DW_ATE_complex_float
                DW_AT_name       "complex"
            }
@@ -144,7 +144,7 @@ Dwarf::assemble $asm_file {
            }
 
            clang_cld_type: DW_TAG_base_type {
-               DW_AT_byte_size [expr 2 * $::long_double_size] DW_FORM_sdata
+               DW_AT_byte_size [expr {2 * $::long_double_size}] DW_FORM_sdata
                DW_AT_encoding   @DW_ATE_complex_float
                DW_AT_name       "complex"
            }
@@ -157,12 +157,12 @@ Dwarf::assemble $asm_file {
     }
 }
 
-if [prepare_for_testing "failed to prepare" $testfile \
-       "${asm_file} ${srcfile}" {}] {
+if {[prepare_for_testing "failed to prepare" $testfile \
+        "${asm_file} ${srcfile}" {}]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
@@ -191,7 +191,7 @@ proc do_test { type {clang 0}} {
            gdb_test "ptype '$ctype'" \
                "type = $ctype"
 
-           eval set type_size \$::${type_id}_size
+           set type_size [subst \$::${type_id}_size]
 
            gdb_test "p sizeof ('$type')" \
                " = $type_size"
@@ -200,7 +200,7 @@ proc do_test { type {clang 0}} {
                # With clang, the ctype name does not uniquely map to a type,
                # so the size is unpredictable.
                gdb_test "p sizeof ('$ctype')" \
-                   " = [expr 2 * $type_size]"
+                   " = [expr {2 * $type_size}]"
            }
 
            set re_kfail \
index 696ccfac925f8e993eea72e6184232ca91fb3eb5..8cf941da2de859c5454ac5c64c89e7b39835e949 100644 (file)
@@ -449,7 +449,7 @@ remote_exec host "sh -c \"for d in $dircreatelist; do cp ${srcdir}/${subdir}/${s
 
 clean_restart ${testfile}
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index ddbab26ddc9315aa8c0a21ab88b1b5d2b8ddae1d..eb7a6d8478d6a1668dc0cb42760fa43d4373ff5b 100644 (file)
@@ -97,7 +97,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 66368ca65056604ee18a3681e8bed88e6b7787e1..3bbd5b8bdf28cc289b0afa2f85251ad5682bd0ed 100644 (file)
@@ -29,8 +29,8 @@ gdb_test_no_output "set breakpoint pending off"
 
 gdb_test "break 'z:file.c':func" {Breakpoint [0-9]+ at .*}
 
-set dos [expr [istarget "*-*-cygwin*"] || [istarget "i?86-*-mingw*"] \
-             || [istarget "*-*-msdosdjgpp*"] || [istarget "*-*-go32*"] ]
+set dos [expr {[istarget "*-*-cygwin*"] || [istarget "i?86-*-mingw*"] \
+                  || [istarget "*-*-msdosdjgpp*"] || [istarget "*-*-go32*"]}]
 
 if { $dos } {
     gdb_test "break file.c:func" {Breakpoint [0-9]+ at .*}
index b1980e8d7eb3f0ce55a10b17dd19e38a72788b70..6274bbf617c95495435fc4317bcdfb2aaad8f04e 100644 (file)
@@ -26,7 +26,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile {nodebug nopie}
     return -1
 }
 
-if ![runto stop_frame] {
+if {![runto stop_frame]} {
     perror "Failed to stop in stop_frame"
     return -1
 }
index 1a0eebad452b833560d8764ae69c7fd6027412d3..1099edb95bbcc3f3cb0edfa3486604d626346262 100644 (file)
@@ -32,7 +32,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
@@ -60,7 +60,7 @@ foreach var { r1_s r1_e r2_s r2_e r3_s r3_e } {
 # Line on which 'foo' is declared.  Used in generated debug.
 set foo_decl_line [gdb_get_line_number "foo decl line"]
 
-if [is_ilp32_target] {
+if {[is_ilp32_target]} {
     set ptr_type "data4"
 } else {
     set ptr_type "data8"
@@ -87,7 +87,7 @@ proc build_and_runto_main { suffix asm_file } {
        return false
     }
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return false
     }
 
@@ -244,7 +244,7 @@ proc_with_prefix use_low_high_bounds_with_entry_offset { dwarf_version } {
 
        declare_labels lines_table
 
-       set foo_offset [expr $::foo_middle_addr - $::foo_start_addr]
+       set foo_offset [expr {$::foo_middle_addr - $::foo_start_addr}]
 
        cu { version $::dwarf_version } {
            compile_unit {
@@ -420,7 +420,7 @@ proc_with_prefix use_ranges_with_entry_offset { dwarf_version } {
 
        declare_labels lines_table ranges_label
 
-       set foo_offset [expr $::foo_middle_addr - $::r1_s]
+       set foo_offset [expr {$::foo_middle_addr - $::r1_s}]
 
        cu { version $::dwarf_version } {
            compile_unit {
index 97194d53339e10a7e0e6bb1824648adb5b4ed3d0..2dda0e5258c5c498408bb3bf32de605b25d690a7 100644 (file)
@@ -176,7 +176,7 @@ if {[prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
@@ -201,7 +201,7 @@ gdb_test "bt" [multi_line \
 
 clean_restart ${testfile}
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index e0f208c22730f7022efdf0fa7cf64d6608fb73b8..fed0d2e0ec3e8f8d770804f691cc3efb45dac486 100644 (file)
@@ -21,7 +21,7 @@ if { [prepare_for_testing "failed to prepare" "dw2-entry-value" {dw2-entry-value
     return -1
 }
 
-if ![runto f] {
+if {![runto f]} {
     return -1
 }
 
index 7e60b6e28bf3d42c3b0db91c2d9b6fd19cfc19ed..9c0622cc5922e6df9a6aa33ecc6cebbbb84fad9f 100644 (file)
@@ -169,7 +169,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 766608944fc1b1f8c518cc2c1ee8f775c8453124..e8a80830931d3669a7145e0948e87332aca99bdf 100644 (file)
@@ -117,7 +117,7 @@ if { [prepare_for_testing ${testfile}.exp ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 6611bf31828df779c85313442d1d078741c29476..8c09406aecd62170b80e9014f5e99b3253060cdd 100644 (file)
@@ -30,7 +30,7 @@ with_shared_gdb {
 proc line_for { l } {
     global srcfile
     set line [gdb_get_line_number "$l:" $srcfile]
-    return [expr $line + 1]
+    return [expr {$line + 1}]
 }
 
 # A helper proc to create the DWARF assembly for the test.
index ef48038e46514d0071df38b58600c38a57d7b691..0a1f5d8f7103f819d052d9da20317ea04d8ad7d4 100644 (file)
@@ -62,7 +62,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto func] {
+if {![runto func]} {
     return -1
 }
 
index ecf0614bae04029ee46505bb9929dbb4035d0ee4..99f008036bdb0d0c2f23e4c3877e995e6edc7d1e 100644 (file)
@@ -157,7 +157,7 @@ proc do_test { start_label func_name tag } {
        return -1
     }
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
index 3d08ac08f71969cf6413863e3b00b084d8eb252b..8d68aa14fd2ba2992b24c99a02e4be14bde58e75 100644 (file)
@@ -145,7 +145,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index ad914b9c915f5136c2f6915246303e886818b9b7..77a64a2370eaad9dcc153e70e5b3a65b282c5ad1 100644 (file)
@@ -134,7 +134,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index e8668e06ff2847fc8fc9e4386063ee53c323d43e..e97f325feff2d3e3cdcf641ff921bfde7e729748 100644 (file)
@@ -289,7 +289,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 938f16d1a1b8ac7a80eac6b483c6fff6a3ffb7b6..c4cc63c2c4fc666655a17686174bcd1e8affd5f9 100644 (file)
@@ -42,7 +42,7 @@ gdb_unload
 set objcopy_program [gdb_find_objcopy]
 set command "$objcopy_program -N block_start -N block_end -N break_at ${binfile} ${binfile_stripped}"
 verbose -log "Executing: $command"
-set result [catch "exec $command" output]
+set result [catch {exec {*}$command} output]
 verbose "result is $result"
 verbose "output is $output"
 if {$result != 0} {
@@ -51,7 +51,7 @@ if {$result != 0} {
 
 gdb_load ${binfile_stripped}
 
-if ![runto "*${break_at}"] {
+if {![runto "*${break_at}"]} {
     return -1
 }
 
index a4309d4bdd6b0a68d1b80c6dc13f48e0b461c8c6..0e9b0a2cf5555ae186feb94a44a5cbb87d3ec1bf 100644 (file)
@@ -123,7 +123,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index a544616a20083dfb150cd7657d1f16eb509b9e9a..e20e355960d91ff1bb4690558d90ade5ef7ee783 100644 (file)
@@ -126,7 +126,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 8e99cb43265340b514e88f3eac00bff62fcda61a..f517807e04f7d06fd7ae9ddae75c8146dd1cf59e 100644 (file)
@@ -43,8 +43,8 @@ Dwarf::assemble $asm_file {
     }
 }
 
-if [build_executable "failed to prepare" $testfile \
-       [list $asm_file $srcfile] {nodebug}] {
+if {[build_executable "failed to prepare" $testfile \
+        [list $asm_file $srcfile] {nodebug}]} {
     return -1
 }
 
index ded5f1078994d92618cf4be002e06645485aa5b5..6d3d86b292440fafec3071803294e02f5c7d483f 100644 (file)
@@ -45,8 +45,8 @@ Dwarf::assemble $asm_file {
     }
 }
 
-if [build_executable "failed to prepare" $testfile \
-       [list $asm_file $srcfile] {nodebug}] {
+if {[build_executable "failed to prepare" $testfile \
+        [list $asm_file $srcfile] {nodebug}]} {
     return -1
 }
 
index 0ae600454e137f4237927642d21e88031affe2e5..b15d13d51e7bfcac7f20cd41e25bb3b5f3d09617 100644 (file)
@@ -55,8 +55,8 @@ Dwarf::assemble $asm_file {
     }
 }
 
-if [prepare_for_testing "failed to prepare" $testfile \
-       [list $asm_file $srcfile] {nodebug}] {
+if {[prepare_for_testing "failed to prepare" $testfile \
+        [list $asm_file $srcfile] {nodebug}]} {
     return -1
 }
 
index fc72cf78ef3f91b433be94225b240b4904689d14..7fbe22ed3f444bfb9e04cbe830489557ab07b38d 100644 (file)
@@ -77,7 +77,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto main] {
+if {![runto main]} {
     return -1
 }
 
index 77bac5211dbc9f27e1ad8df8c9bc31657aff0cb2..4da14d873187c771feffbe95aa047704a91594b5 100644 (file)
@@ -148,7 +148,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 1b9ccaad5f92c4c7ef848d0371d1408c52321a47..ff92fbd92438154af26d0d1df76f3845afc4c8c3 100644 (file)
@@ -99,7 +99,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 144e62e8bfe3b43145e76d1320c6d3f1b5eab2ed..c51f710090bd5404234a6bbe466deb525b33d8b8 100644 (file)
@@ -113,7 +113,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
@@ -129,7 +129,7 @@ gdb_continue_to_breakpoint "bar2" "\[^\r\n\]*:41\r\n.*"
 gdb_test "n" "foo \\(2\\);" "bar2, 1st next"
 gdb_test "n" "foo \\(4\\);" "bar2, 2nd next"
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 6eacf0be80cdbeba9e847076277bedae2bfb2254..fbaa53e9e13d7c7e4538eb4043bcbbae6132dcd4 100644 (file)
@@ -33,7 +33,7 @@ with_shared_gdb {
 proc line_for { l } {
     global srcfile
     set line [gdb_get_line_number "$l:" $srcfile]
-    return [expr $line + 1]
+    return [expr {$line + 1}]
 }
 
 # Execute test.
@@ -119,7 +119,7 @@ proc test_1 { _cv _cdw64 _lv _ldw64 {_string_form ""}} {
        return -1
     }
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
@@ -135,9 +135,9 @@ proc test_1 { _cv _cdw64 _lv _ldw64 {_string_form ""}} {
 # Add unique test prefix.
 proc test { cv cdw64 lv ldw64 {string_form ""}} {
     with_test_prefix cv=$cv {
-       with_test_prefix cdw=[expr $cdw64 ? 64 : 32] {
+       with_test_prefix cdw=[expr {$cdw64 ? 64 : 32}] {
            with_test_prefix lv=$lv {
-               with_test_prefix ldw=[expr $ldw64 ? 64 : 32] {
+               with_test_prefix ldw=[expr {$ldw64 ? 64 : 32}] {
                    if { $string_form == "" } {
                        test_1 $cv $cdw64 $lv $ldw64
                    } else {
index e05e4c92562815b3bb0698599f453a5e631071d9..f23366db3ef6936fef0d0331b1b7b238681cbf65 100644 (file)
@@ -49,7 +49,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index cec3f1591d5c78924018a1bb254dfaae1b4744cf..05865f6995ab4e005c4ebda836703995bac25a33 100644 (file)
@@ -24,8 +24,8 @@ set additional_flags [gdb_target_symbol_prefix_flags_asm]
 
 standard_testfile .S
 
-if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
-       ${additional_flags}] {
+if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
+        ${additional_flags}]} {
     return -1
 }
 
index 6153def31c502f9a19cdc6a0f95991bb7791cf5b..7ff8a8a96c130126029cb269a2ecf48ae2579133 100644 (file)
@@ -15,7 +15,7 @@
 
 standard_testfile .c main.c
 
-if [prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2"] {
+if {[prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2"]} {
     return -1
 }
 
index 526f88af7accd971505e4c1496c0aa8e272e7816..00e2863cd165221ebc12dc2e6445811590c53a88 100644 (file)
@@ -272,7 +272,7 @@ proc file_symbols {type} {
 
 file_symbols no-run
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 5c412f49c76825e6dc6d854cd786218c9af5e538..26b2de22579ddab2e73746ef0c6bc0cf64f16a3f 100644 (file)
@@ -34,7 +34,7 @@ gdb_test "p array2" " = 2" "array2 using DW_OP_call2"
 gdb_test "p array3" " = 3" "array3 using DW_OP_call4"
 
 # Location lists need PC.
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 gdb_test "p arraynoloc" " = <optimized out>"
index 14d5ab1866747b041f7313f51a4573bcc4a23f7f..cc8985b6a34ccd38869789ef62cccfcc537119f6 100644 (file)
@@ -27,7 +27,7 @@ if { [prepare_for_testing "failed to prepare" "${test}" ${test}.S {nodebug}] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 866df3ac1050ff7902af1b66cbe56756b3cc07f9..76b959146ea876cc562c2ed6b9a35774abfc7549 100644 (file)
@@ -44,7 +44,7 @@ proc build_test_program {} {
        # Creating a CU with 4-byte addresses lets this test link on
        # both 32- and 64-bit machines.
        cu { addr_size 4 } {
-    
+
            DW_TAG_compile_unit {
                DW_AT_language @DW_LANG_C99
                DW_AT_name     $srcfile
@@ -58,7 +58,7 @@ proc build_test_program {} {
                    DW_AT_encoding  @DW_ATE_signed
                    DW_AT_name      integer
                }
-    
+
                array_label: DW_TAG_array_type {
                    DW_AT_name foo__array_type
                    DW_AT_type :$int_label
@@ -67,9 +67,9 @@ proc build_test_program {} {
                        DW_AT_type         :$int_label
                        DW_AT_lower_bound 0   DW_FORM_data1
                        DW_AT_upper_bound 127 DW_FORM_data1
-                   }   
+                   }
                }
-    
+
                struct_label: DW_TAG_structure_type {
                    DW_AT_name "foo"
                    DW_AT_byte_size 12 DW_FORM_sdata
@@ -90,12 +90,12 @@ proc build_test_program {} {
                        DW_AT_data_member_location 8 data1
                    }
                }
-    
+
                pointer_label: DW_TAG_pointer_type {
                    DW_AT_byte_size 4 DW_FORM_sdata
                    DW_AT_type  :$struct_label
                }
-    
+
                DW_TAG_subprogram {
                    DW_AT_name func01
                    DW_AT_type :$int_label
@@ -108,7 +108,7 @@ proc build_test_program {} {
                        DW_AT_location {} DW_FORM_block1
                    }
                }
-    
+
                DW_TAG_subprogram {
                    DW_AT_name main
                    DW_AT_type :$int_label
@@ -119,7 +119,7 @@ proc build_test_program {} {
            }
        }
     }
-    
+
     set sources "$srcfile $asm_file"
     if {[build_executable "failed to compile" $testfile $sources {nodebug}]} {
        return -1
@@ -146,17 +146,17 @@ proc do_console_test {} {
        if {![runto func01]} {
            return -1
        }
-       
+
        gdb_test "info addr ptr" "Symbol \"ptr\" is optimized out."
-       
+
        gdb_test "print ptr" "<optimized out>"
-       
+
        gdb_test "print *ptr" "value has been optimized out"
-       
+
        gdb_test "print ptr->a" "value has been optimized out"
-       
+
        gdb_test "print ptr->x" "value has been optimized out"
-       
+
        gdb_test "print ptr->y" "value has been optimized out"
     }
 }
@@ -171,19 +171,19 @@ proc do_mi_test {} {
 
     global mi_gdb_prompt
     global binfile
-    
+
     with_test_prefix "mi" {
        if {[mi_clean_restart $::testfile]} {
            return
        }
-       
+
        # This causes GDB to dereference a pointer-to-structure when doing
        # -var-create.
        mi_gdb_test "-gdb-set print object on" ".*" "set print object on"
-       
+
        mi_gdb_test "-break-insert main" ".*" "insert breakpoint main"
        mi_gdb_test "-break-insert func01" ".*" "insert breakpoint func01"
-       
+
        # Run to main.  Use an explicit expect here since the limited
        # debug info will result in output that isn't handled by the
        # MI test utilities.
@@ -197,7 +197,7 @@ proc do_mi_test {} {
                fail "$test (timeout)"
            }
        }
-       
+
        # Run to func01.  Use an explicit expect here as above.
        set test "continue to func01"
        mi_send_resuming_command "exec-continue" "$test"
@@ -209,14 +209,14 @@ proc do_mi_test {} {
                fail "$test (timeout)"
            }
        }
-       
+
        # Test that -var-create for 'ptr' is successful.
        mi_create_varobj "var1" "ptr" "create varobj for ptr"
 
        set struct_foo_ptr \
            [string cat \
                 [string_to_regexp "struct foo *"] "( $::re_address_class)?"]
-       
+
        # Test that -var-list-children of 'ptr' is successful.
        mi_list_varobj_children "var1" \
            [list \
index 70db4712f49b2b9816ec2e699b3f42f17b408358..76266edab5f2694404465205ee461ce148a99317 100644 (file)
@@ -79,7 +79,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 57ef6d00429ab86035468fae3ff1906f7802bf99..e142292d86e142405b40385ce719db05a798e3eb 100644 (file)
@@ -24,7 +24,7 @@ if { [prepare_for_testing "failed to prepare" "${testfile}" \
     return -1
 }
 
-if ![runto f] {
+if {![runto f]} {
     return -1
 }
 
index 8e66abea93c546768ec2027c3d41034690b4c9d5..740ec442ba01dd4589e8995e6d703991fa0dfdd5 100644 (file)
@@ -83,7 +83,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
@@ -94,7 +94,7 @@ with_test_prefix "ignore-prologue-end" {
     clean_restart $::testfile
     gdb_test_no_output "maintenance set ignore-prologue-end-flag on"
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
index 9e39f6bcc0cea6d09ea2494fa9211c8ee589707c..5e1f6cd46d27f4632ffd0c38d37f7cafd085a4ec 100644 (file)
@@ -121,7 +121,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
@@ -163,7 +163,7 @@ gdb_test_multiple "maint info line-table gdb.dwarf2/dw2-ranges-base.c" \
            exp_continue
        }
        -re "^$gdb_prompt $" {
-           gdb_assert [expr $end_seq_count == 3] $gdb_test_name
+           gdb_assert [expr {$end_seq_count == 3}] $gdb_test_name
        }
        -re ".*linetable: \\(\\(struct linetable \\*\\) 0x0\\):\r\nNo line table.\r\n" {
            exp_continue
index 56aab606e181e45d6a751f8fe84a064820f8f4a2..6fc5ba52fd02832b7b925a9a56cbfc7ac606e38a 100644 (file)
@@ -203,7 +203,7 @@ proc do_test {suffix} {
        return -1
     }
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
@@ -234,12 +234,12 @@ proc do_test {suffix} {
 
     with_test_prefix "step-test-2" {
        clean_restart ${testfile}
-       if ![runto_main] {
+       if {![runto_main]} {
            return -1
        }
 
        # Note that the RE used for the following test will fail when the
-       # breakpoint has been set on multiple locations. E.g. "(2 locations)". 
+       # breakpoint has been set on multiple locations. E.g. "(2 locations)".
        # This is intentional since that behavior is one of the bugs that
        # this test case tests for.
        gdb_test "break foo" \
@@ -271,7 +271,7 @@ proc do_test {suffix} {
     }
 
     clean_restart ${testfile}
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
@@ -363,7 +363,7 @@ proc do_test {suffix} {
 
     with_test_prefix "step-test-3" {
        clean_restart ${testfile}
-       if ![runto_main] {
+       if {![runto_main]} {
            return -1
        }
 
@@ -382,7 +382,7 @@ proc do_test {suffix} {
        # Tests in the "enable_foo_cold_stepping" section, below, did
        # not work prior to July, 2019.  They had been disabled via
        # use of the "enable_foo_cold_stepping" flag.
-       # 
+       #
        # As noted elsewhere, this test case causes foo_cold,
        # originally a separate function invoked via a subroutine
        # call, to be considered as part of foo via use of
index 75c874e0ffc7a466f473f828ca7d42ccb07b170f..85e7bb17ffbea8180d190decb98a377e169f80c4 100644 (file)
@@ -70,7 +70,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto foo] {
+if {![runto foo]} {
     return -1
 }
 
index fa1e03ba098845101236532a0b4d75748ff157b9..d33fc5cee0c3e286250bac58d70a103d7e48dac3 100644 (file)
@@ -109,7 +109,7 @@ clean_restart
 
 gdb_load_no_complaints $binfile
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
@@ -120,7 +120,7 @@ if ![runto_main] {
 # warning: (Internal error: pc 0x555555554619 in read in psymtab,
 #    but not in symtab.)
 # ...
-# (gdb) 
+# (gdb)
 
 gdb_test "break baz" \
     "Breakpoint.*at.*"
index 6440722699e0b9146c7668dc1d292c2ebc06c8ab..c9df12a46b0566525954e0a7a830fda338319021 100644 (file)
@@ -119,7 +119,7 @@ if { [build_executable "failed to prepare" ${testfile} \
 clean_restart
 gdb_load_no_complaints $binfile
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index ad35573e5f399048630a38c2915af7a36f26bf5b..154023e84499918da6c4924a12f38c146001a5e4 100644 (file)
@@ -48,7 +48,7 @@ if { [prepare_for_testing_full "failed to prepare" \
 }
 
 # First try referencing DW_AT_frame_base which is not defined.
-if [runto func_nofb] {
+if {[runto func_nofb]} {
     gdb_test "p func_nofb_var" {Could not find the frame base for "func_nofb".} "func_nofb print"
     gdb_test "bt full" " in main .* main_var = 1" "func_nofb backtrace"
 }
@@ -58,7 +58,7 @@ clean_restart $executable
 
 # And now try referencing DW_AT_frame_base defined using a self-reference
 # (DW_OP_fbreg).
-if [runto func_loopfb] {
+if {[runto func_loopfb]} {
     gdb_test "p func_loopfb_var" "DWARF-2 expression error: Loop detected .*" "func_loopfb print"
     gdb_test "bt full" " in main .* main_var = 1" "func_loopfb backtrace"
 }
index 87e27d65746afeef4127a72588d8a6014a714de3..2de7484c3486b958ce6c652d094aa41a6c19df96 100644 (file)
@@ -26,7 +26,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile {nodebug nopie}
     return -1
 }
 
-if ![runto stop_frame] {
+if {![runto stop_frame]} {
     perror "Failed to stop in stop_frame"
     return -1
 }
index d1243dd5f575b972c5553a0cf48bec84c64b778c..6c17b30522a6c2f90e23a1660014ebdbc82a1d76 100644 (file)
@@ -31,7 +31,7 @@ if {[prepare_for_testing "failed to prepare" $testfile [list $srcfile] \
     return -1
 }
 
-if ![runto foo] {
+if {![runto foo]} {
     return 0
 }
 gdb_test "continue" "$hex in foo \\(\\)"
index 2fe63c649b945755aff19c1871de6e05c1cead97..70c65be2eadea5a2e425b996e1da64e01d04ebfc 100644 (file)
@@ -17,7 +17,7 @@ load_lib dwarf.exp
 # Test multiple location breakpoints vs. prologue analysis on -O2 -g code.
 # when the first statement of a function is an inlined function GDB could
 # crash.  Map of this testcase:
-# 
+#
 # File name                            Line number    Starting address
 # main.c                                         5    func_start
 # other.c                                        1    func0
@@ -37,7 +37,7 @@ require dwarf2_support
 standard_testfile
 set executable ${testfile}
 
-if [is_ilp32_target] {
+if {[is_ilp32_target]} {
     set ptrbits 32
 } else {
     set ptrbits 64
@@ -53,10 +53,10 @@ if { [build_executable ${testfile}.exp ${executable} \
 # We need those symbols global to access them from the .S file.
 set test "strip stub symbols"
 set objcopy_program [gdb_find_objcopy]
-set result [catch "exec $objcopy_program                                                       \
+set result [catch {exec $objcopy_program                                                       \
                        -N func0 -N func1 -N func2 -N func3         -N func_start -N func_end   \
                        -N fund0 -N fund1 -N fund2 -N fund3 -N fund -N fund_start               \
-                       ${binfile}" output]
+                      ${binfile}} output]
 verbose "result is $result"
 verbose "output is $output"
 if {$result != 0} {
@@ -67,7 +67,7 @@ pass $test
 
 clean_restart $executable
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 1eb1e38cd98d425e12763bc9ddca2c902e043735..d2f3a0232e4769b0eabd709def455c307c43f7e6 100644 (file)
@@ -183,7 +183,7 @@ if {[prepare_for_testing "failed to prepare" "${::testfile}" \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 1a76c58953b0e025c957dac9a387c25b7c74fe6e..05326a28d8640ba917c776cfbd66692cbfc82ccf 100644 (file)
@@ -166,7 +166,7 @@ if {[prepare_for_testing "failed to prepare" "${::testfile}" \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 3eaaa526794d826cfe838d64ed7bc10805ec7b1a..e9c405ebf7d4d28aeb137f6c397c573d57d1208e 100644 (file)
@@ -102,7 +102,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index cad64efa3cda15fdb1b4072035aa2104b0b5cac9..5a6dc48b89c0c18b5a4401e2774bbad139477518 100644 (file)
@@ -26,7 +26,7 @@ if {[prepare_for_testing "failed to prepare" "$testfile" $srcfile {nodebug nopie
     return -1
 }
 
-if ![runto "stop_frame"] {
+if {![runto "stop_frame"]} {
     return -1
 }
 
index fb257f0ccc5b581ef69c0340086f826b24ce5eb1..3c85b9988109e549647d87bc675013286625f733 100644 (file)
@@ -46,7 +46,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return
 }
 
@@ -60,7 +60,7 @@ foreach foo {foo_1 foo_2 foo_3 foo_4 foo_5 foo_6} {
 set foo_decl_line [gdb_get_line_number "foo decl line"]
 set bar_call_line [gdb_get_line_number "bar call line"]
 
-if [is_ilp32_target] {
+if {[is_ilp32_target]} {
     set ptr_type "data4"
 } else {
     set ptr_type "data8"
@@ -142,11 +142,11 @@ proc run_test { entry_label dwarf_version with_line_table } {
            if {$with_line_table} {
                program {
                    DW_LNE_set_address foo_label
-                   line [expr $::bar_call_line - 2]
+                   line [expr {$::bar_call_line - 2}]
                    DW_LNS_copy
 
                    DW_LNE_set_address foo_0
-                   line [expr $::bar_call_line - 1]
+                   line [expr {$::bar_call_line - 1}]
                    DW_LNS_copy
 
                    DW_LNE_set_address foo_1
@@ -202,7 +202,7 @@ proc run_test { entry_label dwarf_version with_line_table } {
        return false
     }
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return false
     }
 
index 9eff15eed1bba7d01a4450493c292f41077e3dca..ae3c27a2da5a27d3b9e8a1b1a4b49938b7c02446 100644 (file)
@@ -26,7 +26,7 @@ if { [prepare_for_testing "failed to prepare" "dw2-unresolved" \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index fece76741190f519f496300766615e0c2311768b..a21641eaf12df0e966a9edaa3dedbb01a7fb3230 100644 (file)
@@ -91,12 +91,12 @@ Dwarf::assemble $asm_file {
     }
 }
 
-if [prepare_for_testing "failed to prepare" $testfile \
-       "${asm_file} ${srcfile} ${srcfile2}" {}] {
+if {[prepare_for_testing "failed to prepare" $testfile \
+        "${asm_file} ${srcfile} ${srcfile2}" {}]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 6632a86a7b8838229039dd22961187415df1951a..f5f22e61abbffa27dece33c64610a7892e210cff 100644 (file)
@@ -41,7 +41,7 @@ set asm_file [standard_output_file $srcfile2]
 # For that, we ask GDB by debugging our test program.  Any program
 # would do, but since we already have one specifically for this
 # testcase, might as well use that.
-if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] {
+if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile}]} {
     return -1
 }
 set int_size [get_sizeof "int" -1]
@@ -112,7 +112,7 @@ proc run_test { field_name } {
        return -1
     }
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
index 6d8d9b1737b7a4207cbf04f4012cba11c80f1749..122ee614ad0842568c7090682f339b8f7121d5bf 100644 (file)
@@ -89,7 +89,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index c6234d5620172cdb3ab7bad6942e90114b2f7a49..e4977ddbd47c89890d71b5750b96e1c50fe30ab9 100644 (file)
@@ -19,8 +19,8 @@ require dwarf2_support
 
 standard_testfile .S main.c
 
-if [prepare_for_testing "failed to prepare" ${testfile} \
-       [list $srcfile $srcfile2] {nodebug}] {
+if {[prepare_for_testing "failed to prepare" ${testfile} \
+        [list $srcfile $srcfile2] {nodebug}]} {
     return -1
 }
 
index 6432c9db01a449b06d27ba2e73263838ad3f9384..e0ccd21a72d372236f864db0b97c559245f90a03 100644 (file)
@@ -67,7 +67,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 35eaa16f274d5e4f316f53639c99eec77b7d4b0e..9109cc556ae086b40e45ccf0421502b509d0c354 100644 (file)
@@ -91,7 +91,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index f892d703ab5dbe29dc1331d7d24cbe4b14e60cb7..a986b199a848d34b01ed4394edff40cf79fd3771 100644 (file)
@@ -57,7 +57,7 @@ if {[prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 99bb4cc0848fa54349794d7857279a6e27e57d38..1d9aed692e34b15bab24cf148655af741f5b9ed0 100644 (file)
@@ -32,7 +32,7 @@ if { [prepare_for_testing "failed to prepare" "${testfile}" \
 # Stress test gdb's handling of cached comp units, disable the cache.
 gdb_test_no_output "maint set dwarf max-cache-age 0"
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 166ce6aafe35c91f7529d0d19e206ed4cb30a192..ef5834ebe88d7d02204fe3f000ce37df02295864 100644 (file)
@@ -27,7 +27,7 @@ if { [prepare_for_testing "failed to prepare" "${testfile}" \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index badb9c0b43c5127f03b18c3524173d86784c85ce..9a34157e649540be1bbaad8dd76d1245f67cd531 100644 (file)
@@ -28,7 +28,7 @@ if { [prepare_for_testing "failed to prepare" "${testfile}" \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 81b8354546ebd7f5bb5c08919d4dbeb150b77ff7..e39da5df4bd9067756bc10a63eff6a4d6cf6813b 100644 (file)
@@ -18,7 +18,7 @@ standard_testfile
 if { [build_executable ${testfile}.exp ${testfile} ${srcfile}] == -1 } {
     return -1
 }
-if ![remote_file host exists [standard_output_file ${testfile}.dwp]] {
+if {![remote_file host exists [standard_output_file ${testfile}.dwp]]} {
     unsupported "testsuite run does not produce dwp files"
     return 0
 }
@@ -29,7 +29,7 @@ if ![remote_file host exists [standard_output_file ${testfile}.dwp]] {
 # the name of a debuginfo only file. This file will be stored in the
 # gdb.base/ subdirectory.
 
-if [gdb_gnu_strip_debug $binfile$EXEEXT] {
+if {[gdb_gnu_strip_debug $binfile$EXEEXT]} {
     # check that you have a recent version of strip and objcopy installed
     unsupported "cannot produce separate debug info files"
     return -1
index 3846870ee68046605d019ebb23f3ee05fd3162b1..c2202cbc5ed7bb23861816a1002398562a6e8bf6 100644 (file)
 standard_testfile
 
 remote_file host delete [standard_output_file ${testfile}.dwp]
-if [remote_file host exists [standard_output_file ${testfile}.dwp]] {
+if {[remote_file host exists [standard_output_file ${testfile}.dwp]]} {
     unsupported "dwp file cannot be deleted"
     return 0
 }
 if { [build_executable ${testfile}.exp ${testfile} ${srcfile}] == -1 } {
     return -1
 }
-if ![remote_file host exists [standard_output_file ${testfile}.dwp]] {
+if {![remote_file host exists [standard_output_file ${testfile}.dwp]]} {
     unsupported "testsuite run does not produce dwp files"
     return 0
 }
@@ -34,11 +34,11 @@ remote_file host delete [standard_output_file ${thelink}]
 remote_file host delete [standard_output_file ${thelink}.dwp]
 # file link is only Tcl 8.4+.
 remote_exec host "ln -sf ${testfile} [standard_output_file $thelink]"
-if ![remote_file host exists [standard_output_file $thelink]] {
+if {![remote_file host exists [standard_output_file $thelink]]} {
     unsupported "host does not support symbolic links (binary symlink is missing)"
     return 0
 }
-if [remote_file host exists [standard_output_file $thelink.dwp]] {
+if {[remote_file host exists [standard_output_file $thelink.dwp]]} {
     unsupported "host does not support symbolic links (we tried to delete a file and it is still there)"
     return 0
 }
@@ -55,11 +55,11 @@ gdb_test "ptype main" $main_type_re "binary symlink, dwp default"
 
 gdb_exit
 remote_exec host "mv -f [standard_output_file ${testfile}.dwp] [standard_output_file ${thelink}.dwp]"
-if [remote_file host exists [standard_output_file ${testfile}.dwp]] {
+if {[remote_file host exists [standard_output_file ${testfile}.dwp]]} {
     unsupported "host does not support symbolic links (binary symlink exists)"
     return 0
 }
-if ![remote_file host exists [standard_output_file ${thelink}.dwp]] {
+if {![remote_file host exists [standard_output_file ${thelink}.dwp]]} {
     unsupported "host does not support symbolic links (dwp symlink is missing)"
     return 0
 }
@@ -125,7 +125,7 @@ remote_exec host "ln -sf ${dwp_dwp_dir}/${dwp_real_dwp} ${dwp_symlink_dir}/${dwp
 
 clean_restart "${dwp_symlink_dir}/${dwp_symlink_binary}"
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index ebccea63256c7cae2020ca3fcf4d782941f406ad..872e3a2fd8034fa34582dc93155c17cfa06c068a 100644 (file)
@@ -80,11 +80,11 @@ Dwarf::assemble $asm_file {
     }
 }
 
-if [prepare_for_testing "failed to prepare" $testfile "${asm_file} ${srcfile}" {}] {
+if {[prepare_for_testing "failed to prepare" $testfile "${asm_file} ${srcfile}" {}]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index e4248d0de10a6b44305fa581179380544622f30d..91beb791d2d8b5dee71ed8a1148b38b34df9a2b2 100644 (file)
@@ -129,7 +129,7 @@ if { [prepare_for_testing "failed to prepare" "${testfile}" \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 331cfc2c7e40fb49f553fb4a6aa8f1647fd13325..aeb0aa2ab6b5fed43bf700f466a04ce6416cc882 100644 (file)
@@ -124,7 +124,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 640d4d2283be6eb3cab0e196937b85eb70bc4562..e5ef01afd1c01c0167bc6ba21ab222a4fba7b22b 100644 (file)
@@ -116,7 +116,7 @@ if { [build_executable_and_dwo_files "${testfile}.exp" ${binfile} {nodebug} \
 # Now we can start GDB.
 clean_restart ${testfile}
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 9f70f305466abe55dc37d5efe0e7ea22dc15fb52..2f115d14a32beb2c34be8f52a0b1edee41cfe156 100644 (file)
@@ -28,16 +28,16 @@ standard_testfile .S
 
 set obj [standard_output_file "${testfile}.o"]
 set dwo [standard_output_file "${testfile}.dwo"]
-if [build_executable_and_dwo_files "$testfile.exp" "${binfile}" {nodebug} \
-       [list $srcfile \
-            [list nodebug split-dwo additional_flags=-DDWO=\"$dwo\"] \
-            $obj]] {
+if {[build_executable_and_dwo_files "$testfile.exp" "${binfile}" {nodebug} \
+        [list $srcfile \
+             [list nodebug split-dwo additional_flags=-DDWO=\"$dwo\"] \
+             $obj]]} {
     return -1
 }
 
 clean_restart $::testfile
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index aa5471821c5b797c0af7b6ad5d811dc8341d72f3..62f80a7846b60a2ef5f6c4a56a7857d6ecef7e27 100644 (file)
@@ -33,16 +33,17 @@ standard_testfile .S
 
 set obj [standard_output_file "${testfile}.o"]
 set dwo [standard_output_file "${testfile}.dwo"]
-if [build_executable_and_dwo_files "$testfile.exp" "${binfile}" \
-       {nodebug pie} \
-       [list $srcfile [list nodebug split-dwo additional_flags=-DDWO=\"$dwo\"] \
-            $obj]] {
+if {[build_executable_and_dwo_files "$testfile.exp" "${binfile}" \
+        {nodebug pie} \
+        [list $srcfile \
+             [list nodebug split-dwo additional_flags=-DDWO=\"$dwo\"] \
+             $obj]]} {
     return -1
 }
 
 clean_restart $::testfile
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 59cd10b5bf527b26518ecccc11bd8b651b7d780c..991725eb16d665cbb4a55976ddea8cb2aba1b2a7 100644 (file)
@@ -28,16 +28,16 @@ standard_testfile .S
 
 set obj [standard_output_file "${testfile}.o"]
 set dwo [standard_output_file "${testfile}.dwo"]
-if [build_executable_and_dwo_files "$testfile.exp" "${binfile}" {nodebug} \
-       [list $srcfile \
-            [list nodebug split-dwo additional_flags=-DDWO=\"$dwo\"] \
-            $obj]] {
+if {[build_executable_and_dwo_files "$testfile.exp" "${binfile}" {nodebug} \
+        [list $srcfile \
+             [list nodebug split-dwo additional_flags=-DDWO=\"$dwo\"] \
+             $obj]]} {
     return -1
 }
 
 clean_restart $::testfile
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index ff498c91b11dc56db08ce73fbab43a1e87373a2e..13fb3bf27d043909a204661c3b7c1f62f7d8b240 100644 (file)
@@ -196,16 +196,16 @@ Dwarf::assemble $asm_file_2 {
 # Compile all of the input files, split the DWARF into the .dwo files.
 set obj1 [standard_output_file "${testfile}-1-dw.o"]
 set obj2 [standard_output_file "${testfile}-2-dw.o"]
-if [build_executable_and_dwo_files "$testfile.exp" "${binfile}" {nodebug} \
-       [list $asm_file_1 [list nodebug split-dwo] $obj1] \
-       [list $asm_file_2 [list nodebug split-dwo] $obj2] \
-       [list $srcfile  [list nodebug]]] {
+if {[build_executable_and_dwo_files "$testfile.exp" "${binfile}" {nodebug} \
+        [list $asm_file_1 [list nodebug split-dwo] $obj1] \
+        [list $asm_file_2 [list nodebug split-dwo] $obj2] \
+        [list $srcfile  [list nodebug]]]} {
     return -1
 }
 
 clean_restart $::testfile
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index e605aef8b712c7fbd6c25f25a40930567e5c6324..b533f61d65fc0594e151f1b5a6b0adf294de4798 100644 (file)
@@ -113,7 +113,7 @@ if { [build_executable_and_dwo_files "${testfile}.exp" ${testfile} {nodebug} \
 # Now we can start GDB.
 clean_restart ${testfile}
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 238afb142ce00c0e035a35350f7a6e7ff15f136d..8a123770466126a60277fa3ebdecc02f2dc0012e 100644 (file)
@@ -38,8 +38,8 @@ set dwo_options $options
 lappend dwo_options split-dwo
 lappend dwo_options additional_flags=-DDWO=\"$dwo\"
 
-if [build_executable_and_dwo_files "$testfile.exp" "${binfile}" $options \
-       [list $srcfile $dwo_options $obj]] {
+if {[build_executable_and_dwo_files "$testfile.exp" "${binfile}" $options \
+        [list $srcfile $dwo_options $obj]]} {
     return -1
 }
 
index c08183ec385df6e54c173d99b1da931b2646a6c9..96d821163671d8d6fecdf8c6db2413f6bb82d6ff 100644 (file)
@@ -22,7 +22,7 @@ standard_testfile main.c -dw.S
 
 # We need to know the endianess in order
 # to write some of the debugging info we'd like to generate.
-if [prepare_for_testing "failed to prepare for endianness test" ${testfile} ${srcfile}] {
+if {[prepare_for_testing "failed to prepare for endianness test" ${testfile} ${srcfile}]} {
     return -1
 }
 
index b751900bf7bf9949493afbe19970ebb52382867f..5517375aaf2e8011ae3de78761c75c972af6c2a7 100644 (file)
@@ -141,7 +141,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index f7c3337897da9f2d92595543c1f67eac319e3729..41bd480e968faa8f74925e8b4312575cf9c5ef10 100644 (file)
@@ -144,7 +144,7 @@ if {[run_on_host "touch binary" touch $host_binfile_with_index]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 gdb_test "mt print objfiles ${testfile}" \
index be3a648c9366b175b89cd81886ab3b400378564f..e7894dd12b23ea33c38bf4c1b7e38dfccf6067d2 100644 (file)
@@ -125,11 +125,11 @@ proc test_1 { name dwarf_version offset_size addr_size ref_addr_size two_cu } {
     # 32-bit targets do not support any of the testcases; keep quiet there.
     set opts {quiet}
     set executable ${testfile}-${name}
-    if [prepare_for_testing "failed to prepare" $executable "${asm_file} ${srcfile}" $opts] {
+    if {[prepare_for_testing "failed to prepare" $executable "${asm_file} ${srcfile}" $opts]} {
        return -1
     }
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
index 7feb983908469e343aa1fb3bcdd513f204e2ce58..701c79db3dc7d3e7ddfdc06a29f7a86dd88dbb37 100644 (file)
@@ -76,12 +76,12 @@ Dwarf::assemble $asm_file {
     }
 }
 
-if [prepare_for_testing "failed to prepare" $executable "${asm_file} ${srcfile}" {}] {
+if {[prepare_for_testing "failed to prepare" $executable "${asm_file} ${srcfile}" {}]} {
     return -1
 }
 
 # DW_OP_GNU_implicit_pointer implementation requires a valid frame.
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 78d5f4fcb6a2872b806f0abc80fa4597f708c526..da7bc28453f300f2af9243525dfdd88e53bbbcc5 100644 (file)
@@ -28,7 +28,7 @@ set opts {}
 
 lappend opts nopie
 
-if [info exists COMPILE] {
+if {[info exists COMPILE]} {
     # make check RUNTESTFLAGS='gdb.dwarf2/implptr.exp COMPILE=1 CC_FOR_TARGET=gcc\ -m32'
     set srcfile ${csrcfile}
     lappend opts debug optimize=-O2
@@ -41,7 +41,7 @@ if {[prepare_for_testing "failed to prepare" ${testfile} $srcfile $opts]} {
 # Additional test to verify the referenced CU is not aged out.
 gdb_test_no_output "maintenance set dwarf max-cache-age 0"
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 8e735ca278459439e9c28fc29824c0c2d157ae7f..5078296cc2028a59986d711b9335cba9f5e144f4 100644 (file)
@@ -88,7 +88,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 58c5e6666964f278fb007901573579af3294f8fa..1b9dc5eb213206e281072899efde7731a1d48efe 100644 (file)
@@ -106,7 +106,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 1236537c73e4d66a82e01894c45e3034288071ce..9dec17319083bacb0ba6fb394a64a84092a3b06a 100644 (file)
@@ -113,12 +113,12 @@ Dwarf::assemble ${asm_file} {
     }
 }
 
-if [prepare_for_testing "failed to prepare" ${executable} [list ${asm_file} ${srcfile}] {}] {
+if {[prepare_for_testing "failed to prepare" ${executable} [list ${asm_file} ${srcfile}] {}]} {
     return -1
 }
 
 # DW_OP_GNU_implicit_pointer implementation requires a valid frame.
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index ec19eedd4436a902546176f22b0be06f61a18749..bf3892d837ce8d9026951d307320c6d22a363133 100644 (file)
@@ -36,7 +36,7 @@ set asm_file [standard_output_file ${srcfile2}]
 # For that, we ask GDB by debugging our implref-const program.
 # Any program would do, but since we already have implref-const
 # specifically for this testcase, might as well use that.
-if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] {
+if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile}]} {
     return -1
 }
 
@@ -92,12 +92,12 @@ Dwarf::assemble ${asm_file} {
     }
 }
 
-if [prepare_for_testing "failed to prepare" ${executable} [list ${asm_file} ${srcfile}] {}] {
+if {[prepare_for_testing "failed to prepare" ${executable} [list ${asm_file} ${srcfile}] {}]} {
     return -1
 }
 
 # DW_OP_GNU_implicit_pointer implementation requires a valid frame.
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index cb885ef6ad029a46374be7f18079669e7aed9361..a9397bd67bdaf3cc2d2f5ab247c4a428dc1b5aee 100644 (file)
@@ -36,7 +36,7 @@ set asm_file [standard_output_file ${srcfile2}]
 # For that, we ask GDB by debugging our implref-global program.
 # Any program would do, but since we already have implref-global
 # specifically for this testcase, might as well use that.
-if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] {
+if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile}]} {
     return -1
 }
 
@@ -92,12 +92,12 @@ Dwarf::assemble ${asm_file} {
     }
 }
 
-if [prepare_for_testing "failed to prepare" ${executable} [list ${asm_file} ${srcfile}] {}] {
+if {[prepare_for_testing "failed to prepare" ${executable} [list ${asm_file} ${srcfile}] {}]} {
     return -1
 }
 
 # DW_OP_GNU_implicit_pointer implementation requires a valid frame.
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 9dc3b1b0964679d7f211fec667df503ec238e3fc..450576e1eb13a602405fbef33a4347bc350c5c2f 100644 (file)
@@ -36,7 +36,7 @@ set asm_file [standard_output_file ${srcfile2}]
 # For that, we ask GDB by debugging our implref-struct program.
 # Any program would do, but since we already have implref-struct
 # specifically for this testcase, might as well use that.
-if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] {
+if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}]} {
     return -1
 }
 
@@ -129,12 +129,12 @@ Dwarf::assemble ${asm_file} {
     }
 }
 
-if [prepare_for_testing "failed to prepare" ${executable} [list ${asm_file} ${srcfile}] {}] {
+if {[prepare_for_testing "failed to prepare" ${executable} [list ${asm_file} ${srcfile}] {}]} {
     return -1
 }
 
 # DW_OP_GNU_implicit_pointer implementation requires a valid frame.
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 7141d6b7bd855ac5e4705e12d6b1f83ff93eeda2..2f81317b18e05307b660c4d4c4c4acde780b30cc 100644 (file)
@@ -28,7 +28,7 @@ set asm_file [standard_output_file ${srcfile2}]
 
 # We need to know the size of integer type in order
 # to write some of the debugging info we'd like to generate.
-if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] {
+if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile}]} {
     return -1
 }
 
index 4ccda52cc62f07e8619dcc7e11bfe93627eea70c..6bfc8c7ebd0e3a24a20b7fc9cc2c4740802bed2e 100644 (file)
@@ -10,7 +10,7 @@ set asm_file [standard_output_file ${srcfile2}]
 
 # We need to know the size of integer and address types in order
 # to write some of the debugging info we'd like to generate.
-if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug}] {
+if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug}]} {
     return -1
 }
 
@@ -96,7 +96,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 12dc69ee125705ad6b6be148a8849d4afde3ec54..432386a7d1444be8507d9ce3f1de4668093e0d50 100644 (file)
@@ -25,7 +25,7 @@ set asm_file [standard_output_file ${srcfile2}]
 
 # We need to know the size of integer types in order to write some of the
 # debugging info we'd like to generate.
-if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] {
+if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile}]} {
     return -1
 }
 
index 2c17f2d455e2d130689aea79ce3b6ba86a911d8a..b51c07aeb06dd275901af18e6e9bce87506ff987 100644 (file)
@@ -37,7 +37,7 @@ set asm_file [standard_output_file ${srcfile2}]
 
 # We need to know the size of integer and address types in order
 # to write some of the debugging info we'd like to generate.
-if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] {
+if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}]} {
     return -1
 }
 
index 59c96690004532beee5bd074ce085c5024346951..3f4dd07c74424a0286a50891f38f9369ac0fbfd5 100644 (file)
@@ -68,7 +68,7 @@ if { [prepare_for_testing ${testfile}.exp ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index a36110e8f40468b9045b792543001c34c7030ad5..1aed55f5c7edc8231d0b4c571cdaa82c312f2757 100644 (file)
@@ -15,8 +15,8 @@
 
 standard_testfile .c
 
-if [prepare_for_testing "failed to prepare" $testfile $srcfile \
-       {debug nowarnings}] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
+        {debug nowarnings}]} {
     return -1
 }
 
index ec77c2d244cab1d8582e14505703ca55ae9df2af..fc5a2ae2162dac4b711c004e72ad1623cf2b5116 100644 (file)
@@ -25,7 +25,7 @@ standard_testfile .c .S
 set executable ${testfile}
 set asm_file [standard_output_file ${srcfile2}]
 
-if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] {
+if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile}]} {
     return -1
 }
 
index 2a8b45737897fc5311ce8ddae6a56a7a57a01cb0..ba01137db5e53afd5437a3f739dc7ebdeb89bafb 100644 (file)
@@ -89,8 +89,8 @@ if {[gdb_compile_shlib $libsrc $lib_so \
 #   Value returned is $1 = (B *) $hex <g_>
 # Note that this compilation is used for all GDB sessions.
 set exec_options [list debug shlib=$lib_so]
-if [prepare_for_testing "failed to prepare" ${testfile} \
-                        ${::srcfile} $exec_options] {
+if {[prepare_for_testing "failed to prepare" ${testfile} \
+        ${::srcfile} $exec_options]} {
     return -1
 }
 
index b71d55d650534c3394d245ca4708889c9c0b3cd4..df7101db8d92e812b6b4b81cc65580dce183d710 100644 (file)
@@ -51,7 +51,7 @@ proc do_test { test_name lines_version DW_AT_name main_file_idx directories
            set ::directories $directories
            set ::file_names $file_names
            set ::is_64 $is_64
-           set 32_or_64 [expr $is_64 ? 64 : 32]
+           set 32_or_64 [expr {$is_64 ? 64 : 32}]
 
            set asm_file [standard_output_file ${::testfile}-${test_name}-${32_or_64}.S]
            Dwarf::assemble $asm_file {
@@ -149,7 +149,7 @@ proc do_test { test_name lines_version DW_AT_name main_file_idx directories
                }
            }
 
-           if ![runto_main] {
+           if {![runto_main]} {
                return
            }
 
index ee6992b397aaa4209f9d51b6e2646318cc90af0e..5d97ba49b4ee00bac783de5fdd299326e293922c 100644 (file)
@@ -157,7 +157,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 68a555267ea483cd4aaa33cbd58dcb2d07aeea2e..6478991bc5a51a0500963a609564114b6d63e9a9 100644 (file)
@@ -100,7 +100,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 93c3deac2b22ad204420fa15d1f11decb6708736..abf34add464c1bd8d2a2ed861ecd6a9d6f9c2383 100644 (file)
@@ -201,7 +201,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index ab73554d11224982b09a3966116f5f11cc7d7355..4af365549ee3fae4c3a5fa30f49536a0a331d605 100644 (file)
@@ -22,7 +22,7 @@ lappend opts debug
 lappend opts c++
 lappend opts additional_flags=-std=c++11
 
-if [prepare_for_testing "failed to prepare" $testfile $srcfile $opts] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile $opts]} {
     return -1
 }
 
index b4d275c9a368324ca3dd979cb61f091eb9c66c03..2564daee96ab14b15debb67dc35cda21d0372fb4 100644 (file)
@@ -183,11 +183,11 @@ Dwarf::assemble $asm_file {
     }
 }
 
-if [prepare_for_testing "failed to prepare" $testfile "${asm_file} ${srcfile} ${srcfile3}" {nodebug}] {
+if {[prepare_for_testing "failed to prepare" $testfile "${asm_file} ${srcfile} ${srcfile3}" {nodebug}]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 85f19c7e50e0b0a6bf5faa0594e905b67797d20f..0ae36128a709c71462aef0d33fa8885af0fe6c45 100644 (file)
@@ -25,8 +25,8 @@ if { [build_executable "failed to prepare" $testfile $srcfile \
 set host_binfile [gdb_remote_download host $binfile]
 
 set has_index_section [exec_has_index_section $binfile]
-set uses_readnow [expr [string first "-readnow" $GDBFLAGS] != -1]
-set expecting_index_cache_use [expr !$has_index_section && !$uses_readnow]
+set uses_readnow [expr {[string first "-readnow" $GDBFLAGS] != -1}]
+set expecting_index_cache_use [expr {!$has_index_section && !$uses_readnow}]
 
 lassign [remote_exec host mktemp -d] ret cache_dir
 
index 65f5fad174087032ef66e32235af53963d9c7429..259e7e9e2e856c12191907d444e836efa25cf8f6 100644 (file)
@@ -30,7 +30,7 @@ if {[prepare_for_testing "failed to prepare" ${testfile} $srcfile $opts]} {
     return -1
 }
 
-if ![runto foo] {
+if {![runto foo]} {
     return -1
 }
 
index 5641d1647fbc4d242a7ac2977b6b44847b61d9b6..a08cd828c1d4b4d9658ea13f7500fafd83f32665 100644 (file)
@@ -26,7 +26,7 @@ if {[prepare_for_testing "failed to prepare" ${testfile} $srcfile]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index cf99fa098ceb5866443c30cd003c9504bccb1335..c5b57147c3d21f8055c41db5d1286b84f4a82f9a 100644 (file)
@@ -19,7 +19,7 @@ require dwarf2_support
 
 standard_testfile .S
 
-if [is_ilp32_target] {
+if {[is_ilp32_target]} {
     set ptrbits 32
 } else {
     set ptrbits 64
index 3d6c8531635f72617a023897b9573815f14225e8..c5818b8619e60866b52578967c159e4647f91a5a 100644 (file)
@@ -52,7 +52,7 @@ Dwarf::assemble $asm_file {
     }
 }
 
-if [prepare_for_testing "failed to prepare" $testfile "${asm_file} ${srcfile}" {}] {
+if {[prepare_for_testing "failed to prepare" $testfile "${asm_file} ${srcfile}" {}]} {
     return -1
 }
 
index 7e159998f0c69995114a48270ed1fb0c2a34a4e8..f2165ff572c6e02c34e0f8a969a8d980fe70b24f 100644 (file)
@@ -113,7 +113,7 @@ set struct_s_j_re \
         "    int j;" \
         "}"]
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 6efd4589930815b15a65232f2a46afd06c3aa9fd..87ef2b2243e82ea6607f59fe825b1e3a36fbf0c6 100644 (file)
@@ -47,7 +47,7 @@ if { [is_aarch64_target] } {
 
 standard_testfile symbol_needs_eval.c ${gdb_test_file_name}-dw.S
 
-if [prepare_for_testing "failed to prepare" $testfile $srcfile {debug}] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug}]} {
     return
 }
 
@@ -107,7 +107,7 @@ if { [prepare_for_testing ${testfile}.exp ${testfile} \
 # so an error should be reported.
 gdb_test "print/d a" "No frame selected." "variable a can't be printed"
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 61a40eb56b90b52a61f50cb540b7a627e3928e6d..9f797a5843c305e82f9d81fec881b7485e364edb 100644 (file)
@@ -47,7 +47,7 @@ if { [is_aarch64_target] } {
 
 standard_testfile symbol_needs_eval.c ${gdb_test_file_name}-dw.S
 
-if [prepare_for_testing "failed to prepare" $testfile $srcfile {debug}] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug}]} {
     return
 }
 
@@ -125,7 +125,7 @@ if { [prepare_for_testing ${testfile}.exp ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 52d9b32a593e2f990745c62f56c1b5c5892a7605..507c344aeabbe18b276d7311c0fcb665642c7bfc 100644 (file)
@@ -76,7 +76,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index b80ce973dd718eb70c8703b57cdea7b08e4bc191..0fa812ae2b5fffc1cc77f868b211c8093ab4083f 100644 (file)
@@ -37,7 +37,7 @@ if { [prepare_for_testing "failed to prepare" "${test}" ${sfile} $opts] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 5de7f4e8a30edd546d7228b60233e21de3dcf77f..d8c19e72a7a767e327bcee8bab8c291441402fe3 100644 (file)
@@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 6889cc203e0f82baa923ee4c8713bece0f027905..3276b28a81f16f387959a27438069a0a0565ac3b 100644 (file)
@@ -253,7 +253,7 @@ if { [prepare_for_testing ${testfile}.exp ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 93abcbd7fa32cfda1edef09bb50d103b2388efba..9c9716b8dcd5b639fb2a871d96e51035b32b287c 100644 (file)
@@ -205,7 +205,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto func] {
+if {![runto func]} {
     return -1
 }
 
index 8f132bbf0ba6c68f277adbd3ebfbdecdbdabfa99..97c4ef879072f41968f0720c695cb70217fde98d 100644 (file)
@@ -13,7 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Test support for DW_OP_GNU_variable_value. 
+# Test support for DW_OP_GNU_variable_value.
 
 load_lib dwarf.exp
 
@@ -33,7 +33,7 @@ set asm_file [standard_output_file ${srcfile2}]
 # For that, we ask GDB by debugging our varval program.
 # Any program would do, but since we already have varval
 # specifically for this testcase, might as well use that.
-if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] {
+if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile}]} {
     return -1
 }
 set int_size [get_sizeof "int" -1]
@@ -44,7 +44,7 @@ proc setup_exec { arg_bad } {
     global asm_file executable srcfile bad
     set bad ${arg_bad}
 
-    # Create the DWARF.  
+    # Create the DWARF.
     Dwarf::assemble ${asm_file} {
        global bad int_size addr_size
 
@@ -314,7 +314,7 @@ proc setup_exec { arg_bad } {
        }
     }
 
-    if [prepare_for_testing "failed to prepare" ${executable} [list ${asm_file} ${srcfile}] {}] {
+    if {[prepare_for_testing "failed to prepare" ${executable} [list ${asm_file} ${srcfile}] {}]} {
        return -1
     }
 }
@@ -328,7 +328,7 @@ with_test_prefix "pre-main" {
 }
 
 # DW_OP_GNU_variable_value implementation requires a valid frame.
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
@@ -357,7 +357,7 @@ if { [setup_exec 1] == -1 } {
 }
 
 # DW_OP_GNU_variable_value implementation requires a valid frame.
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 gdb_test "print badval" "value has been optimized out"
index 10f5738c5dd5dabd609caeb5eb824aa6066454fa..963410f93e654c1c851b13f8cd79cb97120a3799 100644 (file)
@@ -96,7 +96,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }