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

Fix these.

292 files changed:
gdb/tclint.toml
gdb/testsuite/gdb.base/a2-run.exp
gdb/testsuite/gdb.base/access-mem-running.exp
gdb/testsuite/gdb.base/advance-until-multiple-locations.exp
gdb/testsuite/gdb.base/advance.exp
gdb/testsuite/gdb.base/all-architectures.exp.tcl
gdb/testsuite/gdb.base/all-bin.exp
gdb/testsuite/gdb.base/annota1.exp
gdb/testsuite/gdb.base/annota3.exp
gdb/testsuite/gdb.base/args.exp
gdb/testsuite/gdb.base/argv0-symlink.exp
gdb/testsuite/gdb.base/arithmet.exp
gdb/testsuite/gdb.base/asmlabel.exp
gdb/testsuite/gdb.base/assign.exp
gdb/testsuite/gdb.base/async.exp
gdb/testsuite/gdb.base/attach-pie-misread.exp
gdb/testsuite/gdb.base/attach-pie-noexec.exp
gdb/testsuite/gdb.base/attach.exp
gdb/testsuite/gdb.base/auxv.exp
gdb/testsuite/gdb.base/basic-edit-cmd.exp
gdb/testsuite/gdb.base/batch-exit-status.exp
gdb/testsuite/gdb.base/batch-preserve-term-settings.exp
gdb/testsuite/gdb.base/bfd-errors.exp
gdb/testsuite/gdb.base/bfp-test.exp
gdb/testsuite/gdb.base/bg-execution-repeat.exp
gdb/testsuite/gdb.base/bigcore.exp
gdb/testsuite/gdb.base/bitfields.exp
gdb/testsuite/gdb.base/bitfields2.exp
gdb/testsuite/gdb.base/bitops.exp
gdb/testsuite/gdb.base/bitshift.exp
gdb/testsuite/gdb.base/bp-permanent.exp
gdb/testsuite/gdb.base/branch-to-self.exp
gdb/testsuite/gdb.base/break-caller-line.exp
gdb/testsuite/gdb.base/break-entry.exp
gdb/testsuite/gdb.base/break-idempotent.exp
gdb/testsuite/gdb.base/break-interp.exp
gdb/testsuite/gdb.base/break-main-file-remove-fail.exp
gdb/testsuite/gdb.base/break.exp
gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp
gdb/testsuite/gdb.base/breakpoint-shadow.exp
gdb/testsuite/gdb.base/bt-on-fatal-signal.exp
gdb/testsuite/gdb.base/call-ar-st.exp
gdb/testsuite/gdb.base/call-rt-st.exp
gdb/testsuite/gdb.base/call-sc.exp
gdb/testsuite/gdb.base/call-strs.exp
gdb/testsuite/gdb.base/callfuncs.exp
gdb/testsuite/gdb.base/cast-indirection.exp
gdb/testsuite/gdb.base/catch-fork-kill.exp
gdb/testsuite/gdb.base/catch-gdb-caused-signals.exp
gdb/testsuite/gdb.base/catch-syscall.exp
gdb/testsuite/gdb.base/charset.exp
gdb/testsuite/gdb.base/chng-syms.exp
gdb/testsuite/gdb.base/code-expr.exp
gdb/testsuite/gdb.base/commands.exp
gdb/testsuite/gdb.base/compare-sections.exp
gdb/testsuite/gdb.base/completion.exp
gdb/testsuite/gdb.base/comprdebug.exp
gdb/testsuite/gdb.base/cond-eval-mode.exp
gdb/testsuite/gdb.base/cond-expr.exp
gdb/testsuite/gdb.base/condbreak-bad.exp
gdb/testsuite/gdb.base/condbreak.exp
gdb/testsuite/gdb.base/consecutive-step-over.exp
gdb/testsuite/gdb.base/constvars.exp
gdb/testsuite/gdb.base/continue-after-aborted-step-over.exp
gdb/testsuite/gdb.base/continue-all-already-running.exp
gdb/testsuite/gdb.base/coredump-filter-build-id.exp
gdb/testsuite/gdb.base/corefile-buildid.exp
gdb/testsuite/gdb.base/corefile-exec-context.exp
gdb/testsuite/gdb.base/corefile.exp
gdb/testsuite/gdb.base/ctf-ptype.exp
gdb/testsuite/gdb.base/ctxobj.exp
gdb/testsuite/gdb.base/dcache-flush.exp
gdb/testsuite/gdb.base/dcache-line-read-error.exp
gdb/testsuite/gdb.base/debug-expr.exp
gdb/testsuite/gdb.base/debug-frame.exp
gdb/testsuite/gdb.base/default.exp
gdb/testsuite/gdb.base/detach-sysroot-target.exp
gdb/testsuite/gdb.base/disasm-end-cu.exp
gdb/testsuite/gdb.base/disasm-optim.exp
gdb/testsuite/gdb.base/displaced-step-closure.exp
gdb/testsuite/gdb.base/display.exp
gdb/testsuite/gdb.base/dlmopen.exp
gdb/testsuite/gdb.base/dprintf-bp-same-addr.exp
gdb/testsuite/gdb.base/dprintf-detach.exp
gdb/testsuite/gdb.base/dprintf-next.exp
gdb/testsuite/gdb.base/dprintf-non-stop.exp
gdb/testsuite/gdb.base/dprintf.exp
gdb/testsuite/gdb.base/dtrace-probe.exp
gdb/testsuite/gdb.base/dump.exp
gdb/testsuite/gdb.base/dup-sect.exp
gdb/testsuite/gdb.base/ena-dis-br.exp
gdb/testsuite/gdb.base/endianity.exp
gdb/testsuite/gdb.base/ending-run.exp
gdb/testsuite/gdb.base/errno.exp
gdb/testsuite/gdb.base/eu-strip-infcall.exp
gdb/testsuite/gdb.base/eval-avoid-side-effects.exp
gdb/testsuite/gdb.base/eval-skip.exp
gdb/testsuite/gdb.base/examine-backward.exp
gdb/testsuite/gdb.base/execution-termios.exp
gdb/testsuite/gdb.base/expand-psymtabs.exp
gdb/testsuite/gdb.base/exprs.exp
gdb/testsuite/gdb.base/fileio.exp
gdb/testsuite/gdb.base/filename-completion.exp
gdb/testsuite/gdb.base/find-unmapped.exp
gdb/testsuite/gdb.base/find.exp
gdb/testsuite/gdb.base/finish-pretty.exp
gdb/testsuite/gdb.base/foll-fork.exp
gdb/testsuite/gdb.base/foll-vfork.exp
gdb/testsuite/gdb.base/fork-print-inferior-events.exp
gdb/testsuite/gdb.base/fortran-sym-case.exp
gdb/testsuite/gdb.base/frame-selection.exp
gdb/testsuite/gdb.base/fullname.exp
gdb/testsuite/gdb.base/fullpath-expand.exp
gdb/testsuite/gdb.base/func-ptr.exp
gdb/testsuite/gdb.base/funcargs.exp
gdb/testsuite/gdb.base/gcore-memory-usage.exp
gdb/testsuite/gdb.base/gcore-relro-pie.exp
gdb/testsuite/gdb.base/gcore-relro.exp
gdb/testsuite/gdb.base/gcore-tls-pie.exp
gdb/testsuite/gdb.base/gcore.exp
gdb/testsuite/gdb.base/gdb-sigterm.exp
gdb/testsuite/gdb.base/gdb1555.exp
gdb/testsuite/gdb.base/gdb1821.exp
gdb/testsuite/gdb.base/gnu-debugdata.exp
gdb/testsuite/gdb.base/hbreak-unmapped.exp
gdb/testsuite/gdb.base/hbreak.exp
gdb/testsuite/gdb.base/hbreak2.exp
gdb/testsuite/gdb.base/huge.exp
gdb/testsuite/gdb.base/hw-sw-break-same-address.exp
gdb/testsuite/gdb.base/included.exp
gdb/testsuite/gdb.base/index-cache.exp
gdb/testsuite/gdb.base/infcall-nested-structs.exp.tcl
gdb/testsuite/gdb.base/inferior-args.exp
gdb/testsuite/gdb.base/inferior-died.exp
gdb/testsuite/gdb.base/info-macros.exp
gdb/testsuite/gdb.base/info-os.exp
gdb/testsuite/gdb.base/info-shared.exp
gdb/testsuite/gdb.base/info_sources.exp
gdb/testsuite/gdb.base/info_sources_2.exp
gdb/testsuite/gdb.base/infoline-reloc-main-from-zero.exp
gdb/testsuite/gdb.base/interrupt-daemon.exp
gdb/testsuite/gdb.base/interrupt-noterm.exp
gdb/testsuite/gdb.base/jit-bfd-name.exp
gdb/testsuite/gdb.base/jit-elf-so.exp
gdb/testsuite/gdb.base/jit-elf.exp
gdb/testsuite/gdb.base/jit-reader-simple.exp
gdb/testsuite/gdb.base/kill-after-signal.exp
gdb/testsuite/gdb.base/kill-detach-inferiors-cmd.exp
gdb/testsuite/gdb.base/killed-outside.exp
gdb/testsuite/gdb.base/langs.exp
gdb/testsuite/gdb.base/ldbl_e308.exp
gdb/testsuite/gdb.base/limited-length.exp
gdb/testsuite/gdb.base/line-symtabs.exp
gdb/testsuite/gdb.base/lineinc.exp
gdb/testsuite/gdb.base/list-ambiguous.exp
gdb/testsuite/gdb.base/list.exp
gdb/testsuite/gdb.base/load-command.exp
gdb/testsuite/gdb.base/logical.exp
gdb/testsuite/gdb.base/long-inferior-output.exp
gdb/testsuite/gdb.base/long_long.exp
gdb/testsuite/gdb.base/macscp.exp
gdb/testsuite/gdb.base/maint.exp
gdb/testsuite/gdb.base/memops-watchpoint.exp
gdb/testsuite/gdb.base/memtag.exp
gdb/testsuite/gdb.base/miscexprs.exp
gdb/testsuite/gdb.base/morestack.exp
gdb/testsuite/gdb.base/moribund-step.exp
gdb/testsuite/gdb.base/msym-bp-shl.exp
gdb/testsuite/gdb.base/msym-bp.exp
gdb/testsuite/gdb.base/multi-forks.exp
gdb/testsuite/gdb.base/nested-addr.exp
gdb/testsuite/gdb.base/nested-subp1.exp
gdb/testsuite/gdb.base/nested-subp2.exp
gdb/testsuite/gdb.base/nested-subp3.exp
gdb/testsuite/gdb.base/new-ui.exp
gdb/testsuite/gdb.base/nodebug.exp
gdb/testsuite/gdb.base/noreturn-finish.exp
gdb/testsuite/gdb.base/noreturn-return.exp
gdb/testsuite/gdb.base/nostdlib.exp
gdb/testsuite/gdb.base/offsets.exp
gdb/testsuite/gdb.base/opaque.exp
gdb/testsuite/gdb.base/options.exp
gdb/testsuite/gdb.base/overlays.exp
gdb/testsuite/gdb.base/paginate-execution-startup.exp
gdb/testsuite/gdb.base/parse_number.exp
gdb/testsuite/gdb.base/pending.exp
gdb/testsuite/gdb.base/pie-execl.exp
gdb/testsuite/gdb.base/pie-fork.exp
gdb/testsuite/gdb.base/pointers.exp
gdb/testsuite/gdb.base/pr10179.exp
gdb/testsuite/gdb.base/prelink.exp
gdb/testsuite/gdb.base/pretty-array.exp
gdb/testsuite/gdb.base/pretty-print.exp
gdb/testsuite/gdb.base/print-file-var.exp
gdb/testsuite/gdb.base/print-internal-string.exp
gdb/testsuite/gdb.base/print-symbol-loading.exp
gdb/testsuite/gdb.base/printcmds.exp
gdb/testsuite/gdb.base/ptr-typedef.exp
gdb/testsuite/gdb.base/ptype.exp
gdb/testsuite/gdb.base/radix.exp
gdb/testsuite/gdb.base/randomize.exp
gdb/testsuite/gdb.base/range-stepping.exp
gdb/testsuite/gdb.base/recpar.exp
gdb/testsuite/gdb.base/recurse.exp
gdb/testsuite/gdb.base/reggroups.exp
gdb/testsuite/gdb.base/relational.exp
gdb/testsuite/gdb.base/relocate.exp
gdb/testsuite/gdb.base/remote.exp
gdb/testsuite/gdb.base/reread.exp
gdb/testsuite/gdb.base/restore.exp
gdb/testsuite/gdb.base/return.exp
gdb/testsuite/gdb.base/rtld-step.exp
gdb/testsuite/gdb.base/run-after-attach.exp
gdb/testsuite/gdb.base/save-bp.exp
gdb/testsuite/gdb.base/savedregs.exp
gdb/testsuite/gdb.base/scope.exp
gdb/testsuite/gdb.base/sepdebug.exp
gdb/testsuite/gdb.base/sepsymtab.exp
gdb/testsuite/gdb.base/setshow.exp
gdb/testsuite/gdb.base/setvar.exp
gdb/testsuite/gdb.base/shlib-call.exp
gdb/testsuite/gdb.base/shlib-unload.exp
gdb/testsuite/gdb.base/shreloc.exp
gdb/testsuite/gdb.base/sigbpt.exp
gdb/testsuite/gdb.base/siginfo-infcall.exp
gdb/testsuite/gdb.base/signals-state-child.exp
gdb/testsuite/gdb.base/signals.exp
gdb/testsuite/gdb.base/signest.exp
gdb/testsuite/gdb.base/sizeof.exp
gdb/testsuite/gdb.base/skip-inline.exp
gdb/testsuite/gdb.base/skip-solib.exp
gdb/testsuite/gdb.base/skip.exp
gdb/testsuite/gdb.base/skipcxx.exp
gdb/testsuite/gdb.base/solib-corrupted.exp
gdb/testsuite/gdb.base/solib-nodir.exp
gdb/testsuite/gdb.base/solib-overlap.exp
gdb/testsuite/gdb.base/solib-weak.exp
gdb/testsuite/gdb.base/source-dir.exp
gdb/testsuite/gdb.base/sss-bp-on-user-bp-2.exp
gdb/testsuite/gdb.base/stale-infcall.exp
gdb/testsuite/gdb.base/stap-probe.exp
gdb/testsuite/gdb.base/step-into-other-file.exp
gdb/testsuite/gdb.base/step-over-exit.exp
gdb/testsuite/gdb.base/step-over-no-symbols.exp
gdb/testsuite/gdb.base/step-over-syscall.exp
gdb/testsuite/gdb.base/step-resume-infcall.exp
gdb/testsuite/gdb.base/step-sw-breakpoint-adjust-pc.exp
gdb/testsuite/gdb.base/step-symless.exp
gdb/testsuite/gdb.base/step-test.exp
gdb/testsuite/gdb.base/structs.exp
gdb/testsuite/gdb.base/structs2.exp
gdb/testsuite/gdb.base/structs3.exp
gdb/testsuite/gdb.base/style.exp
gdb/testsuite/gdb.base/symbol-alias.exp
gdb/testsuite/gdb.base/symtab-search-order.exp
gdb/testsuite/gdb.base/testenv.exp
gdb/testsuite/gdb.base/tls-common.exp.tcl
gdb/testsuite/gdb.base/tls-dlobj.exp
gdb/testsuite/gdb.base/tls-multiobj.exp
gdb/testsuite/gdb.base/tls-nothreads.exp
gdb/testsuite/gdb.base/twice.exp
gdb/testsuite/gdb.base/ui-redirect.exp
gdb/testsuite/gdb.base/until-nodebug.exp
gdb/testsuite/gdb.base/until-trailing-insns.exp
gdb/testsuite/gdb.base/unwind-on-each-insn-amd64-2.exp
gdb/testsuite/gdb.base/unwind-on-each-insn-amd64.exp
gdb/testsuite/gdb.base/unwind-on-each-insn-i386.exp
gdb/testsuite/gdb.base/utf8-identifiers.exp
gdb/testsuite/gdb.base/valgrind-infcall.exp
gdb/testsuite/gdb.base/value-double-free.exp
gdb/testsuite/gdb.base/value-history-unavailable.exp
gdb/testsuite/gdb.base/varargs.exp
gdb/testsuite/gdb.base/vla-datatypes.exp
gdb/testsuite/gdb.base/vla-optimized-out.exp
gdb/testsuite/gdb.base/vla-ptr.exp
gdb/testsuite/gdb.base/vla-sideeffect.exp
gdb/testsuite/gdb.base/vla-struct-fields.exp
gdb/testsuite/gdb.base/volatile.exp
gdb/testsuite/gdb.base/watchpoint-cond-gone.exp
gdb/testsuite/gdb.base/watchpoint-delete.exp
gdb/testsuite/gdb.base/watchpoint-hw-hit-once.exp
gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp
gdb/testsuite/gdb.base/watchpoint-running.exp
gdb/testsuite/gdb.base/watchpoint-unaligned.exp
gdb/testsuite/gdb.base/watchpoint.exp
gdb/testsuite/gdb.base/watchpoints.exp
gdb/testsuite/gdb.base/whatis-exp.exp
gdb/testsuite/gdb.base/whatis-ptype-typedefs.exp
gdb/testsuite/gdb.base/whatis.exp
gdb/testsuite/gdb.base/with.exp
gdb/testsuite/gdb.base/wrap-line.exp
gdb/testsuite/gdb.base/wrong_frame_bt_full.exp

index f063e3d207817bd587dc682bd605949e141331c7..2db6b42eb4f28bdf79e2302af68712ac650c7a2d 100644 (file)
@@ -34,7 +34,6 @@ exclude = [
 "gdb/testsuite/boards",
 "gdb/testsuite/config",
 "gdb/testsuite/lib",
-"gdb/testsuite/gdb.base",
 # IGNORE (document reason in trailing comment):
 "gdb/testsuite/gdb.stabs", # To be removed.
 ]
index 966e12a6f0583744f43d661579ad3aedb90b0a93..0df755883c90cae291afb5689919aadc5d6712b3 100644 (file)
@@ -155,7 +155,7 @@ gdb_test_stdio "" "usage:  factorial <number>" "" "run after setting args to nil
 # work with stub targets, where GDB connects to debug an already started
 # process.
 
-if [use_gdb_stub] {
+if {[use_gdb_stub]} {
     verbose "Skipping rest of a2-run.exp because target is a stub."
     return
 }
index 280e89b3a44afddaf180b80312cdc0418712f948..ca30ec28d470900cbce79a121f04331d525bdbf7 100644 (file)
@@ -36,7 +36,7 @@ proc test { non_stop } {
       gdb_load $binfile
     }
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
@@ -114,7 +114,7 @@ proc test { non_stop } {
 }
 
 foreach non_stop { "off" "on" } {
-    set stop_mode [expr ($non_stop=="off")?"all-stop":"non-stop"]
+    set stop_mode [expr {($non_stop=="off")?"all-stop":"non-stop"}]
     with_test_prefix "$stop_mode" {
        test $non_stop
     }
index 768500cca96201ca71a862c1c73f92fd96941575..86b8e0d1d93b470d7d1d51edba3c8e25880abbb3 100644 (file)
@@ -33,14 +33,14 @@ set lineno [gdb_get_line_number "multiple locations here"]
 proc_with_prefix until_advance_lineno_from_inlined {cmd} {
     global lineno
 
-    if ![runto test] {
+    if {![runto test]} {
        return
     }
 
     gdb_breakpoint $lineno
     gdb_continue_to_breakpoint "break here"
 
-    set lineno2 [expr $lineno + 1]
+    set lineno2 [expr {$lineno + 1}]
 
     gdb_test "$cmd $lineno2" \
        "inline_func .* at .*:$lineno2.*return i.*" \
@@ -53,7 +53,7 @@ proc_with_prefix until_advance_lineno_from_inlined {cmd} {
 proc_with_prefix until_advance_lineno_from_non_inlined {cmd} {
     global lineno
 
-    if ![runto test] {
+    if {![runto test]} {
        return
     }
 
@@ -68,7 +68,7 @@ proc_with_prefix until_advance_lineno_from_non_inlined {cmd} {
 proc_with_prefix until_advance_inline_func {cmd} {
     global lineno
 
-    if ![runto test] {
+    if {![runto test]} {
        return
     }
 
@@ -83,7 +83,7 @@ proc_with_prefix until_advance_inline_func {cmd} {
 proc_with_prefix advance_overload {} {
     global lineno
 
-    if ![runto test] {
+    if {![runto test]} {
        return
     }
 
@@ -117,7 +117,7 @@ proc_with_prefix advance_overload {} {
 proc_with_prefix until_overload {} {
     global lineno
 
-    if ![runto test] {
+    if {![runto test]} {
        return
     }
 
index d4e23ee94c96dc6f1df304b99c2cc778ba50ba1c..2051e9fb55c747ed39de523b01fbd8358f91d9e0 100644 (file)
@@ -63,7 +63,7 @@ gdb_test "continue" \
        ".*Breakpoint ${decimal}, main.*func3.*break here.*" \
        "continue to call to func3 in main"
 
-# Verify that "advance <funcname>" when funcname is called as parameter to 
+# Verify that "advance <funcname>" when funcname is called as parameter to
 # another function works.
 #
 gdb_test "advance foo" \
index 767b02daac3f4821d70263e53a6713ad4caf33ec..5892ab7e1da52df3267ade1719eb6197b3788100 100644 (file)
@@ -187,7 +187,7 @@ proc gdb_test_no_output_osabi {cmd test} {
 
 set num_slices 8
 set num_archs [llength $supported_archs]
-set archs_per_slice [expr (($num_archs + $num_slices - 1) / $num_slices)]
+set archs_per_slice [expr {(($num_archs + $num_slices - 1) / $num_slices)}]
 
 with_test_prefix "tests" {
     foreach_with_prefix osabi $supported_osabis {
@@ -201,10 +201,10 @@ with_test_prefix "tests" {
            incr arch_count
 
            # Skip architectures outside our slice.
-           if {$arch_count < [expr $test_slice * $archs_per_slice]} {
+           if {$arch_count < $test_slice * $archs_per_slice} {
                continue
            }
-           if {$arch_count >= [expr ($test_slice + 1) * $archs_per_slice]} {
+           if {$arch_count >= ($test_slice + 1) * $archs_per_slice} {
                continue
            }
 
@@ -312,7 +312,7 @@ with_test_prefix "tests" {
                    foreach v $options {
                        with_test_prefix "$var=$v" {
                            gdb_test_no_output_osabi "$cmd $v" "$cmd"
-                           run_axis $all_axes [expr $cur_axis + 1] $arch
+                           run_axis $all_axes [expr {$cur_axis + 1}] $arch
                        }
                    }
                }
index 847bcb93c0bc15b48fdf6ec4b65b78708c87037c..d910965f7e90cd593ef8f8528b2afda4230a5fe8 100644 (file)
@@ -19,7 +19,7 @@
 #
 # tests for arithmetic, logical and relational operators
 # with mixed types
-# 
+#
 
 
 
index 744d8252b4b1fbf52a94989dfd16c3bd57913d57..0da5a09930a6497bc71e9ee6ec959ebb762125a8 100644 (file)
@@ -60,7 +60,7 @@ set old_gdb_prompt $gdb_prompt
 set gdb_prompt "\r\n\032\032pre-prompt\r\n$gdb_prompt \r\n\032\032prompt\r\n"
 
 #
-# Escape all the characters in the path that need it. For instance 
+# Escape all the characters in the path that need it. For instance
 # the directory name could contain '+'.
 #
 set escapedsrcfile [string_to_regexp ${srcdir}/${subdir}/${srcfile}]
@@ -244,7 +244,7 @@ gdb_test_multiple "break handle_USR1" "break handle_USR1" {
 }
 
 #
-# break at printf. When we are stopped at printf, we can test 
+# break at printf. When we are stopped at printf, we can test
 #
 gdb_test_multiple "break printf" "break printf" {
     -re  "\r\n\032\032post-prompt\r\nBreakpoint.*at $hex.*\032\032breakpoints-invalid\r\n.*$gdb_prompt$" {
@@ -336,14 +336,14 @@ gdb_test_multiple "backtrace" "backtrace from shlibrary" {
 
 
 #
-# test printing a frame with some arguments: 
+# test printing a frame with some arguments:
 # annotate-arg-begin
 # annotate-arg-name-end
 # annotate-arg-value
 # annotate-arg-end
 #
 
-if [target_info exists gdb,nosignals] {
+if {[target_info exists gdb,nosignals]} {
     unsupported "send SIGUSR1"
     unsupported "backtrace @ signal handler"
 } else {
@@ -507,10 +507,10 @@ gdb_test_multiple "info inferior 1" "get inferior pid" {
 # annotate-signal-name-end
 # annotate-signal-string
 # annotate-signal-string-end
-# FIXME: annotate-signal not tested (requires that the inferior be 
+# FIXME: annotate-signal not tested (requires that the inferior be
 #                        stopped by a "random" signal)
 
-if [target_info exists gdb,nosignals] {
+if {[target_info exists gdb,nosignals]} {
     unsupported "signal sent"
 } else {
     gdb_test_multiple "signal SIGTRAP" "signal sent" {
index e8ac30533701bb8962fd780a501c3fb1c6a67278..9d94be90affffdfd27ef93220f8855307586ebb3 100644 (file)
@@ -85,7 +85,7 @@ gdb_test_multiple "end" "end if construct" {
 #
 # info break:
 #
-send_gdb "info break\n" 
+send_gdb "info break\n"
 gdb_expect_list "breakpoint info" "$gdb_prompt$" [concat {
     "\r\n\032\032post-prompt\r\n"
     "Num     Type           Disp Enb Address    +What\r\n" } [list \
@@ -114,7 +114,7 @@ gdb_expect_list "run until main breakpoint" "$gdb_prompt$" [concat {
 # We don't care about the annotated output for this operation, it is the same as
 # the one produced by run above
 #
-send_gdb "next\n" 
+send_gdb "next\n"
 gdb_expect_list "go after array init line" "$gdb_prompt$" {
     "\r\n\032\032post-prompt\r\n"
     "\r\n\032\032starting\r\n"
@@ -183,10 +183,10 @@ gdb_expect_list "backtrace from shlibrary" "$gdb_prompt$" {
 
 
 #
-# test printing a frame with some arguments: 
+# test printing a frame with some arguments:
 #
 
-if [target_info exists gdb,nosignals] {
+if {[target_info exists gdb,nosignals]} {
     unsupported "send SIGUSR1"
     unsupported "backtrace @ signal handler"
 } else {
@@ -345,7 +345,7 @@ gdb_test_multiple "info inferior 1" "$test" {
 
 # Send a signal that is not handled
 
-if [target_info exists gdb,nosignals] {
+if {[target_info exists gdb,nosignals]} {
     unsupported "signal sent"
 } else {
     send_gdb "signal SIGTRAP\n"
index 39300594773895f688174b3e1b52eff3ad59fabb..990f3a110575ca3d65177e1cec2e65962f5ae8be 100644 (file)
@@ -115,7 +115,7 @@ proc args_test { name arglist {re_esc_list {}} {re_no_esc_list {}} } {
                    set re_list $re_no_esc_list
                }
 
-               set expected_len [expr 1 + [llength $re_list]]
+               set expected_len [expr {1 + [llength $re_list]}]
                gdb_test "print argc" \
                    "\\\$$::decimal = $expected_len" "argc for $name"
 
@@ -144,7 +144,7 @@ proc args_test { name arglist {re_esc_list {}} {re_no_esc_list {}} } {
                    gdb_test "print argv\[$i\]" \
                        "\\\$$::decimal = $::hex \"$arg\"" \
                        "argv\[$i\] for $name"
-                   set i [expr $i + 1]
+                   set i [expr {$i + 1}]
                }
            }
        }
index daabe740f1deb409822015ffb3190fc1b6ccb9bb..6edaea86112157b4448b181e23378df897268034 100644 (file)
@@ -17,7 +17,7 @@
 # command expanding symlinks in the name of the program being run.
 # This test uses pathnames on build to create symbolic links on host and
 # expects the test program running on target to see those symbolic links.
-# Therefore, it can't work reliably on anything other than configurations 
+# Therefore, it can't work reliably on anything other than configurations
 # where build/host/target are all the same.
 
 require isnative
@@ -47,7 +47,7 @@ with_test_prefix "file symlink" {
 
     clean_restart "$filelink"
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
@@ -87,7 +87,7 @@ with_test_prefix "dir symlink" {
 
     clean_restart "$dirlink/$filelink"
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
index 9f9234bf4c2b171164b6bd648083cd278dc9ba9b..4e0ea1238580728d2be45cf6e2f5d436a7b46a00 100644 (file)
@@ -20,7 +20,7 @@
 #
 # tests for correctness of arithmetic operators, associativity and precedence
 # with integer type variables
-# 
+#
 
 #
 # test running programs
@@ -54,7 +54,7 @@ gdb_test "print x" "14"
 gdb_test "print y"  "2"
 gdb_test "print z"  "2"
 gdb_test "print w"  "3"
+
 gdb_test "print x+y" "16"
 gdb_test "print x-y" "12"
 gdb_test "print x*y" "28"
index c4a3f0c080455a95351542e3983ac4afab9eea65..6a4d2a2ca53e9ac0f93192e6d45b1df306ca7fc0 100644 (file)
@@ -37,7 +37,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return 0
 }
 
index aaee79623806e16a94918b4fbcf545aaf80af710..b96588c99de1d426d5fd92741b1411bf33b1d091 100644 (file)
@@ -19,7 +19,7 @@
 #
 # tests for all the assignemnt operators
 # with mixed types and with int type variables
-# 
+#
 
 #
 # test running programs
index cae10f79a759c39aa8f24eaf70cf722b9433869e..2f3ee9f809e816224c4ca842cf73116f9601645e 100644 (file)
@@ -109,7 +109,7 @@ gdb_test_multiple {x/2i $pc} "$test" {
     }
 }
 set next_insn_is_stmt \
-    [expr [lsearch -regexp $is_stmt 0x0*$next_insn_addr] != -1]
+    [expr {[lsearch -regexp $is_stmt 0x0*$next_insn_addr] != -1}]
 
 if { $next_insn_is_stmt } {
     set prefix ""
index 04fe95178714d3916cfabf5d8639f5cd2c8d5212..5f85d00549ffd2a2e847628886f2181792af3483 100644 (file)
@@ -39,18 +39,18 @@ proc read_phdr {binfile test} {
     set readelf_program [gdb_find_readelf]
     set command "exec $readelf_program -Wl $binfile"
     verbose -log "command is $command"
-    set result [catch $command output]
+    set result [catch {{*}$command} output]
     verbose -log "result is $result"
     verbose -log "output is $output"
     if {$result != 0} {
        fail $test
        return
     }
-    if ![regexp {\nProgram Headers:\n *Type [^\n]* Align\n(.*?)\n\n} $output trash phdr] {
+    if {![regexp {\nProgram Headers:\n *Type [^\n]* Align\n(.*?)\n\n} $output trash phdr]} {
        fail "$test (no Program Headers)"
        return
     }
-    if ![regexp -line {^ *DYNAMIC +0x[0-9a-f]+ +(0x[0-9a-f]+) } $phdr trash dynamic_vaddr] {
+    if {![regexp -line {^ *DYNAMIC +0x[0-9a-f]+ +(0x[0-9a-f]+) } $phdr trash dynamic_vaddr]} {
        fail "$test (no DYNAMIC found)"
        return
     }
@@ -74,7 +74,7 @@ set phdr [read_phdr $binfile "readelf initial scan"]
 set dynamic_vaddr [lindex $phdr 0]
 set align_max [lindex $phdr 1]
 
-set stub_size [format 0x%x [expr "2 * $align_max - ($dynamic_vaddr & ($align_max - 1))"]]
+set stub_size [format 0x%x [expr {2 * $align_max - ($dynamic_vaddr & ($align_max - 1))}]]
 verbose -log "stub_size is $stub_size"
 
 # On x86_64 it is commonly about 4MB.
@@ -86,7 +86,7 @@ if {$stub_size > 25000000} {
 set test "generate stub"
 set command "exec $binfile $stub_size >$genfile"
 verbose -log "command is $command"
-set result [catch $command output]
+set result [catch {{*}$command} output]
 verbose -log "result is $result"
 verbose -log "output is $output"
 if {$result == 0} {
@@ -109,14 +109,14 @@ file delete -- $genfile
 set phdr [read_phdr $binfile "readelf rebuilt with stub_size"]
 set dynamic_vaddr_prelinkno [lindex $phdr 0]
 
-if ![prelink_yes $prelink_args] {
+if {![prelink_yes $prelink_args]} {
     return -1
 }
 
 set phdr [read_phdr $binfile "readelf with prelink -R"]
 set dynamic_vaddr_prelinkyes [lindex $phdr 0]
 
-set first_offset [format 0x%x [expr $dynamic_vaddr_prelinkyes - $dynamic_vaddr_prelinkno]]
+set first_offset [format 0x%x [expr {$dynamic_vaddr_prelinkyes - $dynamic_vaddr_prelinkno}]]
 verbose -log "first_offset is $first_offset"
 
 set test "first offset is non-zero"
@@ -156,7 +156,7 @@ gdb_expect {
 foreach align_mult {1 2} { with_test_prefix "shift-by-$align_mult" {
 
     # FIXME: We believe there is enough room under FIRST_OFFSET.
-    set shifted_offset [format 0x%x [expr "$first_offset - $align_mult * $align_max"]]
+    set shifted_offset [format 0x%x [expr {$first_offset - $align_mult * $align_max}]]
     verbose -log "shifted_offset is $shifted_offset"
 
     # For normal prelink (prelink_yes call), we need to supply $prelink_args.
@@ -165,7 +165,7 @@ foreach align_mult {1 2} { with_test_prefix "shift-by-$align_mult" {
     # as the libraries would also get relocated.
     set command "exec /usr/sbin/prelink -q -N --no-exec-shield -r $shifted_offset $binfile"
     verbose -log "command is $command"
-    set result [catch $command output]
+    set result [catch {{*}$command} output]
     verbose -log "result is $result"
     verbose -log "output is $output"
 
index 877cb4a6c77110803dbe5a98250f2f2b99f0ae39..58f1890e1bb0294f09f83cba26c079c31687b8d7 100644 (file)
@@ -30,7 +30,7 @@ gdb_test_multiple $test $test {
        pass $test
     }
 }
-if ![runto_main] {
+if {![runto_main]} {
     return 0
 }
 set test "sanity check info shared"
index d0a29f2954d110724c8113c607f8b72e858f9045..c4e27a10f17fe708bc1f0982c7d8d4f2958fcd22 100644 (file)
@@ -84,7 +84,7 @@ proc_with_prefix do_attach_failure_tests {} {
        }
        -re "Attaching to.*, process .*couldn't open /proc file.*$gdb_prompt $" {
            # Response expected from /proc-based systems.
-           pass "$test" 
+           pass "$test"
        }
        -re "Can't attach to process..*$gdb_prompt $" {
            # Response expected on Cygwin
@@ -105,7 +105,7 @@ proc_with_prefix do_attach_failure_tests {} {
        }
        -re "Attaching to.*, process .*couldn't open /proc file.*$gdb_prompt $" {
            # Response expected from /proc-based systems.
-           pass "$test" 
+           pass "$test"
        }
        -re "Can't attach to process..*$gdb_prompt $" {
            # Response expected on Cygwin
@@ -157,7 +157,7 @@ proc_with_prefix do_attach_failure_tests {} {
            pass "$test"
        }
     }
-    
+
     # Verify that we can't double attach to the process.
 
     set test "first attach"
@@ -242,7 +242,7 @@ proc_with_prefix do_attach_tests {} {
     # (Actually, the test system appears to do this automatically for
     # us.  So, we must also be prepared to be asked if we want to
     # discard an existing set of symbols.)
-    
+
     set test "set file, before attach1"
     gdb_test_multiple "file $binfile" "$test" {
        -re "Load new symbol table from.*y or n. $" {
@@ -267,25 +267,25 @@ proc_with_prefix do_attach_tests {} {
 
     # Verify that we can "see" the variable "should_exit" in the
     # program, and that it is zero.
-   
+
     gdb_test "print should_exit" " = 0" "after attach1, print should_exit"
 
     # Detach the process.
-   
+
     gdb_test "detach" \
        "Detaching from program: .*$escapedbinfile, process $testpid\r\n\\\[Inferior $decimal \\(.*\\) detached\\\]" \
        "attach1 detach"
 
     # Wait a bit for gdb to finish detaching
-    
+
     exec sleep 5
 
     # Purge the symbols from gdb's brain.  (We want to be certain the
     # next attach, which won't be preceded by a "file" command, is
     # really getting the executable file without our help.)
-    
+
     set old_timeout $timeout
-    set timeout 15 
+    set timeout 15
     set test "attach1, purging symbols after detach"
     gdb_test_multiple "file" "$test" {
        -re "No executable file now.*Discard symbol table.*y or n. $" {
@@ -296,7 +296,7 @@ proc_with_prefix do_attach_tests {} {
 
     # Verify that we can attach to the process just by giving the
     # process ID.
-   
+
     set test "attach2, with no file"
     set found_exec_file 0
     gdb_test_multiple "attach $testpid" "$test" {
@@ -356,7 +356,7 @@ proc_with_prefix do_attach_tests {} {
     # Verify that we can attach to the process, and find its a.out
     # when we're cd'd to some directory that doesn't contain the
     # a.out.  (We use the source path set by the "dir" command.)
-    
+
     gdb_test "dir [standard_output_file {}]" "Source directories searched: .*" \
        "set source path"
 
@@ -389,7 +389,7 @@ proc_with_prefix do_attach_tests {} {
        "$test" \
        "Kill the program being debugged.*y or n. $" \
        "y"
-    
+
     # Another "don't leave a process around"
     kill_wait_spawned_process $test_spawn_id
 }
@@ -406,7 +406,7 @@ proc_with_prefix do_call_attach_tests {} {
     set testpid [spawn_id_get_pid $test_spawn_id]
 
     # Attach
-   
+
     gdb_test "file $binfile2" ".*" "load file"
     set test "attach call"
     gdb_test_multiple "attach $testpid" "$test" {
@@ -422,7 +422,7 @@ proc_with_prefix do_call_attach_tests {} {
     }
 
     # See if other registers are problems
-    
+
     set test "info other register"
     gdb_test_multiple "i r r3" "$test" {
        -re "warning: reading register.*$gdb_prompt $" {
@@ -434,12 +434,12 @@ proc_with_prefix do_call_attach_tests {} {
     }
 
     # Get rid of the process
-    
+
     gdb_test "p should_exit = 1"
     gdb_continue_to_end
-   
+
     # Be paranoid
-   
+
     kill_wait_spawned_process $test_spawn_id
 }
 
@@ -591,7 +591,7 @@ proc_with_prefix do_attach_exec_mismatch_handling_tests {} {
            gdb_test "y" "Reading symbols from .*attach.*" $gdb_test_name
        }
     }
-    
+
 
     gdb_test "detach" "Detaching from program: .* detached\\\]" "$test detach attach initial exec-file"
 
index 38efa457cbfdd717cafecd24c2af38bf71df9a8f..0bb4c36abbf63589c380079cca8dcb16bea55424 100644 (file)
@@ -37,7 +37,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \
 # Make it the working directory for the inferior.
 set coredir [standard_output_file coredir.[getpid]]
 file mkdir $coredir
-set core_works [expr [isnative] && ! [is_remote target]]
+set core_works [expr {[isnative] && ! [is_remote target]}]
 
 # Run GDB on the test program up to where it will dump core.
 
index 7ad8ab926cd9767bbb9a88d7e2f3992dc55da6f5..ad5c9a5626a0335c4fd6c53b5aa076b1bc4b8af2 100644 (file)
@@ -42,7 +42,7 @@ if {![runto_main]} {
 
 # Are we using DWARF debug format?
 get_debug_format
-set non_dwarf [expr ! [test_debug_format "DWARF \[0-9\]"]]
+set non_dwarf [expr {! [test_debug_format "DWARF \[0-9\]"]}]
 
 # Find line numbers for use in tests.
 set line_0 [gdb_get_line_number "prologue location"]
index a2c3dea91c6cee11904170418c6001644a6cec90..86e5fdd7fa08ed4f0f60c2afe193e4c2849af6fb 100644 (file)
@@ -29,7 +29,7 @@ proc _test_exit_status {expect_status cmdline_opts {re ""}} {
        return
     }
 
-    set has_re [expr ![string equal $re ""]]
+    set has_re [expr {![string equal $re ""]}]
     if { ! $has_re } {
        set re "\$FOOBAR^"
     }
index 8995997890f5a7f3fd100e69fb5622027ab7283b..52b546cd46dd6a02de2edb4331b10f2a5e975210 100644 (file)
@@ -23,7 +23,7 @@ if {[build_executable "failed to prepare" $testfile $srcfile debug] == -1} {
 }
 
 set file_arg $binfile
-if [is_remote host] {
+if {[is_remote host]} {
   set file_arg [remote_download host $file_arg]
 }
 
@@ -46,11 +46,11 @@ proc spawn_shell {} {
 
     # Try to match:
     #   PS1="gdb-subshell$ "^M
-    #   $ gdb-subshell$ 
+    #   $ gdb-subshell$
     # or:
     #   PS1="gdb-subshell$ "^M
     #   sh-4.4$ PS1="gdb-subshell$ "^M
-    #   gdb-subshell$ 
+    #   gdb-subshell$
     set gotit 0
     set test "spawn shell"
     gdb_expect {
@@ -88,7 +88,7 @@ proc exit_shell {} {
            pass "$test"
        }
     }
-    if ![is_remote host] {
+    if {![is_remote host]} {
        remote_close host
     }
 }
@@ -131,7 +131,7 @@ proc test_terminal_settings_preserved {} {
     global gdb_prompt
     global shell_prompt_re
 
-    if ![spawn_shell] {
+    if {![spawn_shell]} {
        return
     }
 
@@ -176,7 +176,7 @@ proc test_terminal_settings_preserved {} {
     }
 
     set test "terminal settings preserved"
-    if $stty_supported {
+    if {$stty_supported} {
        run_stty "stty after" stty_after
 
        gdb_assert [string equal $stty_before $stty_after] $test
@@ -224,7 +224,7 @@ proc test_terminal_settings_preserved_after_cli_exit { cmds } {
     global gdb_prompt
     global shell_prompt_re
 
-    if ![spawn_shell] {
+    if {![spawn_shell]} {
        return
     }
 
@@ -263,7 +263,7 @@ proc test_terminal_settings_preserved_after_cli_exit { cmds } {
     send_quit_command "quit gdb"
 
     set test "terminal settings preserved"
-    if $stty_supported {
+    if {$stty_supported} {
        run_stty "stty after" stty_after
 
        gdb_assert [string equal $stty_before $stty_after] $test
@@ -286,11 +286,11 @@ proc test_terminal_settings_preserved_after_sigterm { } {
     # On Windows, GDB's "shell" command spawns cmd.exe, which does not
     # understand PPID.  So we're out of luck even if the test harness
     # uses a remote_exec shell with a working "kill" command.
-    if [ishost *-*-mingw*] {
+    if {[ishost *-*-mingw*]} {
        return
     }
 
-    if ![spawn_shell] {
+    if {![spawn_shell]} {
        return
     }
 
@@ -347,13 +347,13 @@ proc test_terminal_settings_preserved_after_sigterm { } {
            }
        }
 
-       if !$gdb_killed {
+       if {!$gdb_killed} {
            send_quit_command "quit gdb"
        }
     }
 
     set test "terminal settings preserved"
-    if $stty_supported {
+    if {$stty_supported} {
        run_stty "stty after" stty_after
 
        gdb_assert [string equal $stty_before $stty_after] $test
index 8e51f09a98e42c4166c7dea97e05cbbe88b2a20e..f29824791c38a6771e0ae2eb4510df37da85ea98 100644 (file)
@@ -39,7 +39,7 @@
 #
 # This test then loads the shared library's symbol table (and other
 # debug info) using the 'add-symbol-file' command.  While doing this,
-# the test observes and records the BFD errors that were output. 
+# the test observes and records the BFD errors that were output.
 # Finally, data collected while adding the shared library symbols are
 # examined to make sure that identical messages were suppressed while
 # also making sure that at least two messages have been printed.
@@ -87,10 +87,10 @@ close $solib_fp
 set objcopy_program [gdb_find_objcopy]
 
 # Extract the .dynsym and .dynstr section from the shared object.
-if { [catch "exec $objcopy_program \
-              --dump-section .dynsym=${binfile_lib}.dynsym \
-             --dump-section .dynstr=${binfile_lib}.dynstr \
-             ${binfile_lib}" output] } {
+if { [catch {exec $objcopy_program \
+                --dump-section .dynsym=${binfile_lib}.dynsym \
+                --dump-section .dynstr=${binfile_lib}.dynstr \
+                ${binfile_lib}} output] } {
     untested "failed objcopy dump-section"
     verbose -log "objcopy output: $output"
     return -1
@@ -119,29 +119,29 @@ if { $is_elf64 } {
 } else {
     set sz 16
 }
-set cnt [expr $dynsym_len / $sz]
+set cnt [expr {$dynsym_len / $sz}]
 
 # Create 32-bit patterns (bad offsets) to write into the st_name area.
 if { $is_big_endian } {
-    set pat(0) [binary format I [expr $dynstr_len + 1000]]
-    set pat(1) [binary format I [expr $dynstr_len + 2000]]
+    set pat(0) [binary format I [expr {$dynstr_len + 1000}]]
+    set pat(1) [binary format I [expr {$dynstr_len + 2000}]]
 } else {
-    set pat(0) [binary format i [expr $dynstr_len + 1000]]
-    set pat(1) [binary format i [expr $dynstr_len + 2000]]
+    set pat(0) [binary format i [expr {$dynstr_len + 1000}]]
+    set pat(1) [binary format i [expr {$dynstr_len + 2000}]]
 }
 
 # Mangle st_name for the symbols following the first (STN_UNDEF) entry.
 while { [incr cnt -1] > 0 } {
     seek $dynsym_fp [incr off $sz]
-    puts $dynsym_fp $pat([expr $cnt % 2])
+    puts $dynsym_fp $pat([expr {$cnt % 2}])
 }
 
 close $dynsym_fp
 
 # Replace .dynsym section in shared object with the mangled version.
-if { [catch "exec $objcopy_program \
-               --update-section .dynsym=${binfile_lib}.dynsym \
-              ${binfile_lib}" output] } {
+if { [catch {exec $objcopy_program \
+                --update-section .dynsym=${binfile_lib}.dynsym \
+                ${binfile_lib}} output] } {
     untested "failed objcopy update-section"
     verbose -log "objcopy output: $output"
     return -1
index 53d274fb719a15310f75d9632a70d2e42f2b1277..1251868e111c33507bbad9dee9a1efa283d9a62e 100644 (file)
@@ -39,7 +39,7 @@ gdb_test "print b32" ".*1 = 1\.5.*" "the original value of b32 is 1.5"
 gdb_test "print b64" ".*2 = 2\.25.*" "the original value of b64 is 2.25"
 gdb_test "print b128" ".*3 = 3\.375.*" "the original value of b128 is 3.375"
 
-# Test that gdb could correctly recognize float constant expression with a suffix. 
+# Test that gdb could correctly recognize float constant expression with a suffix.
 gdb_test "print b32=-1.5f" ".*4 = -1\.5.*" "try to change b32 to -1.5 with 'print b32=-1.5f'"
 gdb_test "print b64=-2.25f" ".*5 = -2\.25.*" "try to change b64 to -2.25 with 'print b64=-2.25f'"
 gdb_test "print b128=-3.375l" ".*6 = -3\.375.*" "try to change b128 to -3.375 with 'print b128=-3.375l'"
index e7bdf4935c93b2c3bae1a631302340fbb4938fe9..923092b9ba130abc3c06be1f29975b3a8856f680 100644 (file)
@@ -36,7 +36,7 @@ proc test {continue_cmd} {
     clean_restart
     gdb_load $binfile
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return
     }
 
index f917eb82487cd9b27710df31e4e7b037210d55ad..7066a636eb315a903e12ab554252f77544fbdf5a 100644 (file)
@@ -28,8 +28,8 @@ require isnative
 # I/O bandwidth.
 
 if { [istarget "*-*-*bsd*"]
-     || [istarget "*-*-solaris*"] 
-     || [istarget "*-*-darwin*"] 
+     || [istarget "*-*-solaris*"]
+     || [istarget "*-*-darwin*"]
      || [istarget "*-*-cygwin*"] } {
     untested "kernel lacks sparse corefile support (PR gdb/1551)"
     return
index c463865a3ff450b9d2dd2e84f594366fe2630761..9a5eaff087806d412bc691bfe1b1273e21792869 100644 (file)
@@ -165,7 +165,7 @@ proc bitfield_at_offset {} {
     global srcfile
 
     gdb_breakpoint break5
-    if [gdb_test "cont" "Break.*break5 \\(\\) at .*$srcfile:$decimal.*" "continuing to break5"] {
+    if {[gdb_test "cont" "Break.*break5 \\(\\) at .*$srcfile:$decimal.*" "continuing to break5"]} {
        return
     }
 
index 3e981dd92e1351f8522983d0ab3c9bcb5e6f000a..124f9c291073336412f74acff29879d16972d2a9 100644 (file)
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# This file was adapted from bitfields.exp by Paul Hilfinger 
+# This file was adapted from bitfields.exp by Paul Hilfinger
 # (Hilfinger@gnat.com)
 
 #
-# Tests for bit-fields that do not fit in type (unsigned) int, but do fit 
+# Tests for bit-fields that do not fit in type (unsigned) int, but do fit
 # in type (unsigned) long long.  We perform essentially the same tests as
 # in bitfields.c, which considers only bit-fields that are <= 9 bits long.
 #
@@ -33,7 +33,7 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
 set has_signed_bitfields 1
 
 #
-# Continue to expected breakpoint at FUNCTION.  Append TAG to make pass/fail 
+# Continue to expected breakpoint at FUNCTION.  Append TAG to make pass/fail
 # messages (to make them unique).  Suppress tests on failure.
 #
 proc continue_test { function tag } {
@@ -54,7 +54,7 @@ proc start_test { function } {
     gdb_breakpoint $function
     continue_test $function "#0"
 }
-    
+
 
 #
 # Test bitfield locating and uniqueness.
index 6bd867547f221436a08c6a96f55608a416cbd43d..0bf6b20f30c1a57ac3ceeacdbee9c279ce4d5032 100644 (file)
@@ -20,7 +20,7 @@
 # tests expressions with bitwise operators, and some
 # logical operators
 # Does not use a target program
-# 
+#
 
 
 #
index 8cc25144075dc970d1221f34e27f34924eac2ddd..1e308f294557c12fd6bc552fac7612db1988686b 100644 (file)
@@ -158,6 +158,7 @@ foreach signed {0 1} {
        set sign_prefix "u"
     }
     foreach bits {8 16 32 64} {
+       # tclint-disable-next-line command-args
        proc make_${sign_prefix}int${bits} {lang val} \
            "make_val_cast \$lang $signed $bits \$val"
     }
index 3ae5efe109f38c6d9ea97c1e8cba6653c7241c32..df51126964356cc4034c610c5fb40e86744a3f39 100644 (file)
@@ -103,7 +103,7 @@ proc test {always_inserted sw_watchpoint} {
 
        # We now have the breakpoint instruction stored in 'buffer'.  Poke it
        # to memory manually.
-       set count [expr $address_after_bp - $address_bp]
+       set count [expr {$address_after_bp - $address_bp}]
        for {set i 0} {$i < $count} {incr i} {
            set test "p /x addr_bp\[$i\] = buffer\[$i\]"
            gdb_test_multiple $test $test {
@@ -216,7 +216,7 @@ proc test {always_inserted sw_watchpoint} {
        gdb_test "next" "after next .*"
     }
 
-    if ![target_info exists gdb,nosignals] {
+    if {![target_info exists gdb,nosignals]} {
 
        with_test_prefix "continue trips on nested permanent bp" {
            delete_breakpoints
@@ -242,7 +242,7 @@ proc test {always_inserted sw_watchpoint} {
            gdb_test "p counter" " = 2"
        }
 
-       if [can_single_step_to_signal_handler] {
+       if {[can_single_step_to_signal_handler]} {
 
            with_test_prefix "stepi signal with handler" {
                delete_breakpoints
index 8f8e8ad44910dff38eb286a7188e0a1b14124a8e..3f09786bd65da3c82b6a4e53c652e265ded19d37 100644 (file)
@@ -27,7 +27,7 @@ with_test_prefix "single-step" {
     global testfile
 
     clean_restart ${testfile}
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
     set line_num [gdb_get_line_number "loop-line" ${testfile}.c]
@@ -60,7 +60,7 @@ with_test_prefix "break-cond" {
 
        clean_restart ${testfile}
 
-       if ![runto_main] {
+       if {![runto_main]} {
            return -1
        }
 
index bc3604ed7385052ba2496b50396d4d546d71a247..9925a1dc8a2d8b4d189a2c7ddc62e0772b6591b4 100644 (file)
@@ -19,7 +19,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile}] } {
     return -1
 }
 
-if ![runto callee] {
+if {![runto callee]} {
     return 0
 }
 
index 4ea1158a8b24f5566af0a91cf7e0389a7bfc9447..584ddafd3a75d9e11e8c2f455d8da106da5d2277 100644 (file)
@@ -56,7 +56,7 @@ if {[istarget powerpc64-*] && [is_lp64_target]} {
     }
 }
 
-if ![runto "*$entry"] {
+if {![runto "*$entry"]} {
     return
 }
 gdb_test {p/x $pc} " = $entry"
index 3b32c89772d7be7590c64f00be9b2f6984cc0ab2..842ce42dc59f0927028a2712258932fa2d06cfd7 100644 (file)
@@ -165,7 +165,7 @@ foreach_with_prefix pie { "nopie" "pie" } {
        continue
     }
 
-    if [is_remote host] {
+    if {[is_remote host]} {
        set arg [remote_download host $binfile]
        if { $arg == "" } {
            untested "download failed"
index 038c3ea442726baab21a8e532b8fef26da0e6471..f06c15f23bebc40b39147c102f21fa8ed115528b 100644 (file)
@@ -49,19 +49,19 @@ proc system_debug_get {exec} {
 
     # isfile returns 1 even for symlinks to files.
     set retval $debug_root/$exec_build_id_debug
-    if [file isfile $retval] {
+    if {[file isfile $retval]} {
        return $retval
     }
     set retval $exec_dir/$debug_base
-    if [file isfile $retval] {
+    if {[file isfile $retval]} {
        return $retval
     }
     set retval $exec_dir/.debug/$debug_base
-    if [file isfile $retval] {
+    if {[file isfile $retval]} {
        return $retval
     }
     set retval $debug_root/$exec_dir/$debug_base
-    if [file isfile $retval] {
+    if {[file isfile $retval]} {
        return $retval
     }
     return ""
@@ -108,7 +108,7 @@ proc strip_debug {dest} {
     set strip_program [transform strip]
     set command "exec $strip_program --strip-debug $dest"
     verbose -log "command is $command"
-    if [catch $command] {
+    if {[catch {{*}$command}]} {
        fail $test
        return 0
     } else {
@@ -186,7 +186,7 @@ proc reach_1 {func command displacement} {
            }
        }
     }
-    if ![regexp {^(NONE|FOUND-.*)$} $displacement] {
+    if {![regexp {^(NONE|FOUND-.*)$} $displacement]} {
        fail $test_displacement
     }
 
@@ -257,7 +257,7 @@ proc test_core {file displacement} {
                pass $test
            }
        }
-       if ![regexp {^(NONE|FOUND-.*)$} $displacement] {
+       if {![regexp {^(NONE|FOUND-.*)$} $displacement]} {
            fail $test_displacement
        }
        gdb_test_no_output "set verbose off"
@@ -308,7 +308,7 @@ proc test_attach_gdb {file pid displacement prefix} {
                pass $test
            }
        }
-       if ![regexp {^(NONE|FOUND-.*)$} $displacement] {
+       if {![regexp {^(NONE|FOUND-.*)$} $displacement]} {
            fail $test_displacement
        }
        gdb_test_no_output "set verbose off"
@@ -381,7 +381,7 @@ proc test_attach {file displacement {relink_args ""}} {
            # `libfunc' is present in the backtrace and therefore the
            # displacement has been guessed right.
 
-           if [prelink$relink $relink_args [file tail $exec]] {
+           if {[prelink$relink $relink_args [file tail $exec]]} {
                # /proc/PID/exe cannot be loaded as it is "EXECNAME (deleted)".
                test_attach_gdb $exec $pid $displacement "attach-relink$relink"
            }
@@ -411,7 +411,7 @@ proc test_ld {file ifmain trynosym displacement} {
     # prevents that from happening.  So turn it off.
     gdb_test "set disable-randomization off"
 
-    if $ifmain {
+    if {$ifmain} {
        gdb_test_no_output "set args segv"
     } else {
        global binfile_test
@@ -450,7 +450,7 @@ proc test_ld {file ifmain trynosym displacement} {
        gdb_test_no_output "set verbose on"
     }
 
-    if $ifmain {
+    if {$ifmain} {
        reach "main" continue "NONE"
 
        reach "libfunc" continue "NONE"
@@ -467,13 +467,13 @@ proc test_ld {file ifmain trynosym displacement} {
     reach $solib_bp "run" $displacement 2
     gdb_test_no_output "set verbose off"
 
-    if $ifmain {
+    if {$ifmain} {
        test_core $file $displacement
 
        test_attach $file $displacement
     }
 
-    if !$trynosym {
+    if {!$trynosym} {
        return
     }
 
@@ -494,7 +494,7 @@ proc test_ld {file ifmain trynosym displacement} {
        set escapedfile [string_to_regexp $file]
        gdb_test "exec-file $file" "exec-file $escapedfile" "load"
 
-       if $ifmain {
+       if {$ifmain} {
            reach $solib_bp run $displacement 3
 
            set entrynohex ""
@@ -550,7 +550,7 @@ proc test_ld {file ifmain trynosym displacement} {
                    pass $test
                }
            }
-           if ![regexp {^(NONE|FOUND-.*)$} $displacement] {
+           if {![regexp {^(NONE|FOUND-.*)$} $displacement]} {
                fail $test_displacement
            }
        }
@@ -589,7 +589,7 @@ foreach_with_prefix ldprelink {NO YES} {
            file_copy $interp_system $interp
            # Never call strip-debug before unprelink:
            # prelink: ...: Section .note.gnu.build-id created after prelinking
-           if ![prelinkNO $interp] {
+           if {![prelinkNO $interp]} {
                continue
            }
            strip_debug $interp
@@ -605,7 +605,7 @@ foreach_with_prefix ldprelink {NO YES} {
            set test "eu-unstrip unprelinked:[file tail $interp_system] + [file tail $interp_system_debug] to [file tail $interp]"
            set command "exec eu-unstrip -o $interp $interp ${interp}.debug"
            verbose -log "command is $command"
-           if [catch $command] {
+           if {[catch {{*}$command}]} {
                setup_xfail *-*-*
                fail $test
                continue
@@ -615,7 +615,7 @@ foreach_with_prefix ldprelink {NO YES} {
        } elseif {$ldsepdebug == "SEP" && $interp_system_debug == ""} {
            file_copy $interp_system $interp
            # eu-unstrip: DWARF data in '...' not adjusted for prelinking bias; consider prelink -u
-           if ![prelinkNO $interp] {
+           if {![prelinkNO $interp]} {
                continue
            }
            gdb_gnu_strip_debug $interp
@@ -625,14 +625,14 @@ foreach_with_prefix ldprelink {NO YES} {
        }
 
        if {$ldsepdebug == "SEP"} {
-           if ![prelinkNO "${interp}.debug"] {
+           if {![prelinkNO "${interp}.debug"]} {
                continue
            }
        } else {
            file delete "${interp}.debug"
        }
 
-       if ![prelink$ldprelink $interp "[file tail $interp], second time"] {
+       if {![prelink$ldprelink $interp "[file tail $interp], second time"]} {
            continue
        }
 
@@ -647,7 +647,7 @@ foreach_with_prefix ldprelink {NO YES} {
        }
        test_ld $interp 0 [expr {$ldsepdebug == "NO"}] $displacement
 
-       if ![file_copy $interp $interp_saved] {
+       if {![file_copy $interp $interp_saved]} {
            continue
        }
 
index 19b2446a6dc95011005b6d3b6e9f3c1abb414aac..4dd88cdc8f6bc6b45279961d3bc2ba7674149535 100644 (file)
@@ -55,7 +55,7 @@ proc test_remove_bp { initial_load } {
            gdb_reload
        }
 
-       if ![runto start] {
+       if {![runto start]} {
            return
        }
 
@@ -86,7 +86,7 @@ proc test_remove_bp { initial_load } {
        # remove the memory breakpoint afterwards should fail, and GDB
        # should warn the user about it.
        set pagesize [get_integer_valueof "pg_size" 0]
-       set align_addr [expr $bp_addr - $bp_addr % $pagesize]
+       set align_addr [expr {$bp_addr - $bp_addr % $pagesize}]
        set munmap_prototype "int (*) (void *, size_t)"
        set munmap_expr "(($munmap_prototype) munmap) ($align_addr, $pagesize)"
 
index 1eec98490553a17200d8e13198cab333f0e0de9b..e1f4860b57ab05fd0db8ce603865301dfd787755 100644 (file)
@@ -765,7 +765,7 @@ proc_with_prefix test_next_with_recursion {} {
 
     delete_breakpoints
 
-    if [istarget "mips*tx39-*"] {
+    if {[istarget "mips*tx39-*"]} {
        set timeout 60
     }
     # We used to set timeout here for all other targets as well.  This
index 4b060b8dcd285999281d5db53b774fe103aac06c..7c6b1cb2216bafb275b6279b989afcb9a1612dd1 100644 (file)
@@ -25,7 +25,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
@@ -139,7 +139,7 @@ proc get_next_insn {} {
 
 set hw_step [probe_target_hardware_step]
 
-if ![get_function_bounds "main" main_lo main_hi] {
+if {![get_function_bounds "main" main_lo main_hi]} {
     # Can't do the following tests if main's bounds are unknown.
     return -1
 }
index a662016e2acaf7e1cec9f1c5cd691aea4ff98fc8..8e74ec24cecab4c444bd9510bae1d72f8a9448c2 100644 (file)
@@ -20,7 +20,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
 }
 
 # We need to start the inferior to place the breakpoints in the memory at all.
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
@@ -51,7 +51,7 @@ proc test_disassembly {test} {
     gdb_test_multiple "disass main" $test {
        -re $match {
            set got $expect_out(1,string)
-           if [string equal -nocase $orig $got] {
+           if {[string equal -nocase $orig $got]} {
                pass $test
            } else {
                fail $test
index 63428a1c93d2cae2715a2c5ddfd41c442e2a2bda..1ef977469feff15cc98ad329fd37a68a76394467 100644 (file)
@@ -126,7 +126,7 @@ foreach test_data {{SEGV "Segmentation fault"} \
                gdb_assert { $saw_fatal_msg }
                gdb_assert { $saw_bt_start }
                gdb_assert { $saw_bt_end }
-               gdb_assert { [expr $internal_error_msg_count == 2] }
+               gdb_assert { [expr {$internal_error_msg_count == 2}] }
            }
            -re "$gdb_prompt $" {
                # GDB should terminate, we should never get back to
index 8b27d8d37235eaa653769cdbf788e878e1435fce..fd1f1a09bd9f6f88e95993be19c7e6555225325d 100644 (file)
@@ -38,7 +38,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} {
 
 
 set oldtimeout $timeout
-set timeout [expr "$timeout + 60"]
+set timeout [expr {$timeout + 60}]
 
 gdb_test_no_output "set print sevenbit-strings"
 gdb_test_no_output "set print address off"
@@ -86,7 +86,7 @@ set array_c_re \
         "aZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ" \
         "aZaZaZaZaZaZaZaZaZa"]
 
-if ![gdb_skip_stdio_test "print_char_array(char_array)"] {
+if {![gdb_skip_stdio_test "print_char_array(char_array)"]} {
     gdb_test_stdio "print print_char_array(char_array)" $array_c_re
 }
 
@@ -95,7 +95,7 @@ gdb_test "tbreak $stop_line" \
 "Temporary breakpoint.*file.*$srcfile, line $stop_line.*" \
 "tbreakpoint at tbreak2"
 
-if ![gdb_skip_stdio_test "continue to tbreak2"] {
+if {![gdb_skip_stdio_test "continue to tbreak2"]} {
     set gdb_re \
        [multi_line \
             "main.*at.*:\[0-9\]+" \
@@ -106,7 +106,7 @@ if ![gdb_skip_stdio_test "continue to tbreak2"] {
 }
 
 # I am disabling this test, because it takes too long. I verified by
-# hand that it works, feel free to check for yourself. 
+# hand that it works, feel free to check for yourself.
 #call print_all_arrays(integer_array, char_array, float_array, double_array)
 #send_gdb "print print_all_arrays(integer_array, char_array, float_array, double_array)\n"
 #gdb_expect {
@@ -165,7 +165,7 @@ gdb_test "step" \
     "step inside print_all_arrays"
 
 #step -over
-if ![gdb_skip_stdio_test "next over print_int_array in print_all_arrays"] {
+if {![gdb_skip_stdio_test "next over print_int_array in print_all_arrays"]} {
     set stop_line [gdb_get_line_number "-next1-"]
     gdb_test_stdio "next" \
        "array_i :" \
@@ -214,7 +214,7 @@ if {$allow_float_test && \
 
 #call sum_array_print(10, *list1, *list2, *list3, *list4)
 
-if ![gdb_skip_stdio_test "print sum_array_print(...)"] {
+if {![gdb_skip_stdio_test "print sum_array_print(...)"]} {
 
     gdb_test_stdio "print sum_array_print(10, *list1, *list2, *list3, *list4)" \
        [multi_line \
@@ -239,7 +239,7 @@ if ![gdb_skip_stdio_test "print sum_array_print(...)"] {
 
 #step over
 set stop_line [gdb_get_line_number "-next2-"]
-if ![gdb_skip_stdio_test "next to next2"] {
+if {![gdb_skip_stdio_test "next to next2"]} {
     gdb_test_stdio "next" \
        "BYE BYE FOR NOW" \
        "$stop_line.*printf\\(.VERY GREEN GRASS.n.\\);.*" \
@@ -250,7 +250,7 @@ if ![gdb_skip_stdio_test "next to next2"] {
 
 #call print_array_rep(\*list1, \*list2, \*list3)
 
-if ![gdb_skip_stdio_test "print print_array_rep(...)"] {
+if {![gdb_skip_stdio_test "print print_array_rep(...)"]} {
     gdb_test_stdio "print print_array_rep(\*list1, \*list2, \*list3)" \
        "Contents of linked list3:"
 }
@@ -300,7 +300,7 @@ gdb_test "tbreak $stop_line" \
     "Temporary breakpoint.* file .*$srcfile, line $stop_line.*" \
     "tbreakpoint at tbreak6"
 
-if ![gdb_skip_stdio_test "continuing to tbreak6"] {
+if {![gdb_skip_stdio_test "continuing to tbreak6"]} {
     gdb_test_stdio "continue" \
        "Sum of 4 arrays.*Contents of linked list1.*Contents of two_floats_t" \
        "main \\(\\) at .*$srcfile:$stop_line.*c = 0.*" \
@@ -309,8 +309,8 @@ if ![gdb_skip_stdio_test "continuing to tbreak6"] {
     gdb_test "continue" ".*" ""
 }
 
-#call print_small_structs(*struct1, *struct2, *struct3, *struct4, 
-#                         *flags, *flags_combo, *three_char, *five_char, 
+#call print_small_structs(*struct1, *struct2, *struct3, *struct4,
+#                         *flags, *flags_combo, *three_char, *five_char,
 #                         *int_char_combo, *d1, *d2, *d3, *f1, *f2, *f3)
 
 if {$allow_float_test && \
@@ -373,7 +373,7 @@ gdb_test "print compute_with_small_structs(20)" \
     "\[0-9\]+ = void"
 
 
-#call print_ten_doubles(123.456, 123.456, -0.12, -1.23, 343434.8, 89.098, 
+#call print_ten_doubles(123.456, 123.456, -0.12, -1.23, 343434.8, 89.098,
 #                       3.14, -5678.12345, -0.11111111, 216.97065)
 
 if {$allow_float_test && \
@@ -422,8 +422,8 @@ if {$allow_float_test} {
 
 set ws "\[\n\r\t \]+"
 
-#call print_small_structs(struct1, struct2, struct3, struct4, flags, 
-#                         flags_combo, three_char, five_char, int_char_combo, 
+#call print_small_structs(struct1, struct2, struct3, struct4, flags,
+#                         flags_combo, three_char, five_char, int_char_combo,
 #                         d1, d2, d3, f1, f2, f3)
 
 if {$allow_float_test && \
@@ -495,7 +495,7 @@ gdb_test "tbreak $stop_line" \
     "Temporary breakpoint.* file .*$srcfile, line $stop_line.*" \
     "tbreakpoint at tbreak8"
 
-if ![gdb_skip_stdio_test "continuing to tbreak8"] {
+if {![gdb_skip_stdio_test "continuing to tbreak8"]} {
     gdb_test_stdio "continue" \
        "Contents of two_floats_t:" \
        ".*main \\(\\) at.*$srcfile:$stop_line.*$stop_line.*init_bit_flags_combo\\(flags_combo, \\(unsigned\\)1, \\(unsigned\\)0, .y.,.*" \
@@ -511,7 +511,7 @@ gdb_test "step" \
     "step into init_bit_flags_combo"
 
 #call print_bit_flags_combo(*bit_flags_combo)
-if ![gdb_skip_stdio_test "continuing at step3"] {
+if {![gdb_skip_stdio_test "continuing at step3"]} {
     gdb_test_stdio "print print_bit_flags_combo(*bit_flags_combo)" \
        "alpha.*gamma.*epsilon.*ch1: y.*ch2: n"
 }
@@ -600,14 +600,14 @@ gdb_test continue "Continuing\\..*main \\(\\) at .*$srcfile:$stop_line\[ \t\n\r\
 
 
 #call sum_struct_print(10, *struct1, *struct2, *struct3, *struct4)
-if ![gdb_skip_stdio_test "print sum_struct_print(...)"] {
+if {![gdb_skip_stdio_test "print sum_struct_print(...)"]} {
     gdb_test_stdio "print sum_struct_print(10,*struct1,*struct2,*struct3,*struct4)" \
        "Sum of the 4 struct values and seed :\[ \t\n\r\]+218"
 }
 
 
 #call print_struct_rep(*struct1, *struct2, *struct3)
-if ![gdb_skip_stdio_test "print print_struct_rep(...)"] {
+if {![gdb_skip_stdio_test "print print_struct_rep(...)"]} {
     gdb_test_stdio "print print_struct_rep(*struct1, *struct2, *struct3)" \
        [multi_line \
             "Contents of struct1: " \
@@ -622,7 +622,7 @@ if ![gdb_skip_stdio_test "print print_struct_rep(...)"] {
            ]
 }
 
-if ![gdb_skip_stdio_test "print print_one_large_struct(...)"] {
+if {![gdb_skip_stdio_test "print print_one_large_struct(...)"]} {
     gdb_test_stdio "print print_one_large_struct(*list1)" \
        "         4         1"
 }
index 511e209a0605a2ad016efe4af53627d0da0ef06d..4ce686b675971c1574f660fe0953d7b019456170 100644 (file)
@@ -109,13 +109,13 @@ proc print_struct_call { expr inf_result gdb_result } {
 }
 
 
-if ![gdb_skip_stdio_test "print print_struct_rep(*struct1)"] {
+if {![gdb_skip_stdio_test "print print_struct_rep(*struct1)"]} {
     print_struct_call "print_struct_rep(*struct1)" \
        ".*Contents of struct1:\[ \t\n\r\]+22\[ \t\]+0\[ \t\n\r\]+" \
        ".\[0-9\]+ = \\{value = 5, head = 0\\}"
 }
 
-if ![gdb_skip_stdio_test "print print_one_large_struct(...)"] {
+if {![gdb_skip_stdio_test "print print_one_large_struct(...)"]} {
     print_struct_call "print_one_large_struct(*list1)" \
        ".*\[ \t\]+4\[ \t\]+1\[ \r\n\]+" \
        ".\[0-9\]+ = \\{next_index = \\{1, 2, 3, 4, 5, 6, 7, 8, 9, 10\\}, values = \\{4, 6, 8, 10, 12, 14, 16, 18, 20, 22\\}, head = 0\\}"
@@ -135,43 +135,43 @@ if {$allow_float_test && \
        ".\[0-9\]+ = \\{float1 = -2\\.34500003, float2 = 1\\}"
 }
 
-if ![gdb_skip_stdio_test "print print_bit_flags_char(*cflags)"] {
+if {![gdb_skip_stdio_test "print print_bit_flags_char(*cflags)"]} {
     print_struct_call "print_bit_flags_char(*cflags)" \
        ".*alpha\[ \r\n\]+gamma\[ \r\n\]+epsilon\[ \r\n\]+" \
        ".\[0-9\]+ = \\{alpha = 1 '\\\\001', beta = 0 '\\\\000', gamma = 1 '\\\\001', delta = 0 '\\\\000', epsilon = 1 '\\\\001', omega = 0 '\\\\000'\\}"
 }
 
-if ![gdb_skip_stdio_test "print print_bit_flags_short(*sflags)"] {
+if {![gdb_skip_stdio_test "print print_bit_flags_short(*sflags)"]} {
     print_struct_call "print_bit_flags_short(*sflags)" \
        ".*alpha\[ \r\n\]+gamma\[ \r\n\]+epsilon\[ \r\n\]+" \
        ".\[0-9\]+ = \\{alpha = 1, beta = 0, gamma = 1, delta = 0, epsilon = 1, omega = 0\\}"
 }
 
-if ![gdb_skip_stdio_test "print print_bit_flags(*flags)"] {
+if {![gdb_skip_stdio_test "print print_bit_flags(*flags)"]} {
     print_struct_call "print_bit_flags(*flags)" \
        ".*alpha\[ \r\n\]+gamma\[ \r\n\]+epsilon\[ \r\n\]+" \
        ".\[0-9\]+ = \\{alpha = 1, beta = 0, gamma = 1, delta = 0, epsilon = 1, omega = 0\\}"
 }
 
-if ![gdb_skip_stdio_test "print print_bit_flags_combo(*flags_combo)"] {
+if {![gdb_skip_stdio_test "print print_bit_flags_combo(*flags_combo)"]} {
     print_struct_call "print_bit_flags_combo(*flags_combo)" \
        ".*alpha\[ \r\n\]+gamma\[ \r\n\]+epsilon\[ \r\n\]+ch1: y\[ \t\]+ch2: n\[ \r\n\]+" \
        ".\[0-9\]+ = \\{alpha = 1, beta = 0, ch1 = 121 'y', gamma = 1, delta = 0, ch2 = 110 'n', epsilon = 1, omega = 0\\}"
 }
 
-if ![gdb_skip_stdio_test "print print_three_chars(*three_chars)"] {
+if {![gdb_skip_stdio_test "print print_three_chars(*three_chars)"]} {
     print_struct_call "print_three_chars(*three_char)" \
        ".*Contents of three_char_t:\[ \r\n\]+x\[ \t\]+y\[ \t\]+z\[ \r\n\]+" \
        ".\[0-9\]+ = \\{ch1 = 120 'x', ch2 = 121 'y', ch3 = 122 'z'\\}"
 }
 
-if ![gdb_skip_stdio_test "print print_five_chars(*five_chars)"] {
+if {![gdb_skip_stdio_test "print print_five_chars(*five_chars)"]} {
     print_struct_call "print_five_chars(*five_char)" \
        ".*Contents of five_char_t:\[ \r\n\]+h\[ \t\]+e\[ \t\]+l\[ \t\]+l\[ \t\]+o\[ \r\n\]+" \
        ".\[0-9\]+ = \\{ch1 = 104 'h', ch2 = 101 'e', ch3 = 108 'l', ch4 = 108 'l', ch5 = 111 'o'\\}"
 }
 
-if ![gdb_skip_stdio_test "print print_int_char_combo(*int_char_combo)"] {
+if {![gdb_skip_stdio_test "print print_int_char_combo(*int_char_combo)"]} {
     print_struct_call "print_int_char_combo(*int_char_combo)" \
        ".*Contents of int_char_combo_t:\[ \r\n\]+13\[ \t\]+!\[ \r\n\]+" \
        ".\[0-9\]+ = \\{int1 = 13, ch1 = 33 '!'\\}"
index f67670dccc5b673ac3eb57cff73c9ae31a23b476..ff4e7ac92d8410090361efbf3965208db4556363 100644 (file)
@@ -107,7 +107,7 @@ proc test_scalar_calls { } {
     # Check that GDB can always extract a scalar-return value from an
     # inferior function call.  Since GDB always knows the location of
     # an inferior function call's return value these should never fail
-    
+
     # Implemented by calling the parameterless function "fun" and then
     # examining the return value printed by GDB.
 
@@ -250,7 +250,7 @@ proc test_scalar_returns { } {
     set test "value foo returned; ${tests}"
     gdb_test_multiple "p/c L" "${test}" {
        -re " = 49 '1'.*${gdb_prompt} $" {
-           if $return_value_unknown {
+           if {$return_value_unknown} {
                # This contradicts the above claim that GDB didn't
                # know the location of the return-value.
                fail "${test}"
@@ -259,7 +259,7 @@ proc test_scalar_returns { } {
            }
        }
        -re " = 90 .*${gdb_prompt} $" {
-           if $return_value_unknown {
+           if {$return_value_unknown} {
                # The struct return case.  Since any modification
                # would be by reference, and that can't happen, the
                # value should be unmodified and hence Z is expected.
@@ -272,7 +272,7 @@ proc test_scalar_returns { } {
            }
        }
        -re " = 57 .*${gdb_prompt} $" {
-           if $return_value_unknown {
+           if {$return_value_unknown} {
                # The struct return case.
                # The return value is stored on the stack, and since GDB
                # didn't override it, it still has value that was stored
@@ -285,7 +285,7 @@ proc test_scalar_returns { } {
            }
        }
        -re ".*${gdb_prompt} $" {
-           if $return_value_unimplemented {
+           if {$return_value_unimplemented} {
                # What a surprise.  The architecture hasn't implemented
                # return_value, and hence has to fail.
                kfail "$test" gdb/1444
@@ -293,8 +293,8 @@ proc test_scalar_returns { } {
                fail "$test"
            }
        }
-    }  
-    
+    }
+
     # Check that a "finish" works.
 
     # This is almost but not quite the same as "call struct funcs".
@@ -334,7 +334,7 @@ proc test_scalar_returns { } {
     set test "value foo finished; ${tests}"
     gdb_test_multiple "p/c" "${test}" {
        -re " = 49 '1'\[\r\n\]+${gdb_prompt} $" {
-           if $finish_value_unknown {
+           if {$finish_value_unknown} {
                # This contradicts the above claim that GDB didn't
                # know the location of the return-value.
                fail "${test}"
@@ -344,7 +344,7 @@ proc test_scalar_returns { } {
        }
        -re " = 90 'Z'\[\r\n\]+${gdb_prompt} $" {
            # The value didn't get found.  This is "expected".
-           if $finish_value_unknown {
+           if {$finish_value_unknown} {
                pass "${test}"
            } else {
                # This contradicts the above claim that GDB did
index 43e4712f86d310644e28c7c56449bfad119f62f0..02eecb699ac195d9f626458fad872d9cfa65e644 100644 (file)
@@ -67,70 +67,70 @@ gdb_test "print s" \
     " = \"test string\".*"
 
 #print str_func1(s)
-if ![gdb_skip_stdio_test "print str_func1(s)"] {
+if {![gdb_skip_stdio_test "print str_func1(s)"]} {
     gdb_test_stdio "print str_func1(s)" \
        "first string arg is: test string" \
        "\"test string\".*"
 }
 
 #print str_func1("test string")
-if ![gdb_skip_stdio_test "print str_func1(teststring)"] {
+if {![gdb_skip_stdio_test "print str_func1(teststring)"]} {
     gdb_test_stdio "print str_func1(\"test string\")" \
        "first string arg is: test string" \
        "\"test string\".*"
 }
 
 #call str_func1(s)
-if ![gdb_skip_stdio_test "call str_func1(s)"] {
+if {![gdb_skip_stdio_test "call str_func1(s)"]} {
     gdb_test_stdio "call str_func1(s)" \
        "first string arg is: test string" \
        "\"test string\".*"
 }
 
 #call str_func1("test string")
-if ![gdb_skip_stdio_test "call str_func1 (...)"] {
+if {![gdb_skip_stdio_test "call str_func1 (...)"]} {
     gdb_test_stdio "call str_func1(\"test string\")" \
        "first string arg is: test string" \
        "\"test string\".*"
 }
 
 #print str_func1(buf)
-if ![gdb_skip_stdio_test "print str_func1(buf)"] {
+if {![gdb_skip_stdio_test "print str_func1(buf)"]} {
     gdb_test_stdio "print str_func1(buf)" \
        "first string arg is: test string" \
        "\"test string\".*"
 }
 
 #call str_func1(buf)
-if ![gdb_skip_stdio_test "call str_func1(buf)"] {
+if {![gdb_skip_stdio_test "call str_func1(buf)"]} {
     gdb_test_stdio "call str_func1(buf)" \
        "first string arg is: test string" \
        "\"test string\".*"
 }
 
 #print str_func("a","b","c","d","e","f","g")
-if ![gdb_skip_stdio_test "print str_func(a,b,c,d,e,f,g)"] {
+if {![gdb_skip_stdio_test "print str_func(a,b,c,d,e,f,g)"]} {
     gdb_test_stdio "print str_func(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\")" \
        "first string arg is: a\[ \t\r\n\]+second string arg is: b\[ \t\r\n\]+third string arg is: c\[ \t\r\n\]+fourth string arg is: d\[ \t\r\n\]+fifth string arg is: e\[ \t\r\n\]+sixth string arg is: f\[ \t\r\n\]+seventh string arg is: g\[ \t\r\n\]+" \
        "= \"abcdefg\".*"
 }
 
 #call str_func("a","b","c","d","e","f","g")
-if ![gdb_skip_stdio_test "call str_func(a,b,c,d,e,f,g)"] {
+if {![gdb_skip_stdio_test "call str_func(a,b,c,d,e,f,g)"]} {
     gdb_test_stdio "call str_func(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\")" \
        "first string arg is: a\[ \t\r\n\]+second string arg is: b\[ \t\r\n\]+third string arg is: c\[ \t\r\n\]+fourth string arg is: d\[ \t\r\n\]+fifth string arg is: e\[ \t\r\n\]+sixth string arg is: f\[ \t\r\n\]+seventh string arg is: g\[ \t\r\n\]+" \
        "= \"abcdefg\".*"
 }
 
 #print str_func(s,s,s,s,s,s,s)
-if ![gdb_skip_stdio_test "print str_func(s,s,s,s,s,s,s,s)"] {
+if {![gdb_skip_stdio_test "print str_func(s,s,s,s,s,s,s,s)"]} {
     gdb_test_stdio "print str_func(s,s,s,s,s,s,s)" \
        "first string arg is: test string\[ \t\r\n\]+second string arg is: test string\[ \t\r\n\]+third string arg is: test string\[ \t\r\n\]+fourth string arg is: test string\[ \t\r\n\]+fifth string arg is: test string\[ \t\r\n\]+sixth string arg is: test string\[ \t\r\n\]+seventh string arg is: test string\[ \t\r\n\]+" \
     "\"test stringtest stringtest stringtest stringtest stringtest stringtest string\".*"
 }
 
 #call str_func(s,s,s,s,s,s,s)
-if ![gdb_skip_stdio_test "call str_func(s,s,s,s,s,s,s,s)"] {
+if {![gdb_skip_stdio_test "call str_func(s,s,s,s,s,s,s,s)"]} {
     gdb_test_stdio "call str_func(s,s,s,s,s,s,s)" \
        "first string arg is: test string\[ \t\r\n\]+second string arg is: test string\[ \t\r\n\]+third string arg is: test string\[ \t\r\n\]+fourth string arg is: test string\[ \t\r\n\]+fifth string arg is: test string\[ \t\r\n\]+sixth string arg is: test string\[ \t\r\n\]+seventh string arg is: test string\[ \t\r\n\]+" \
        "\"test stringtest stringtest stringtest stringtest stringtest stringtest string\".*"
index 0e1997af17b03b2c43bf3f965a86e97cdb348790..59306d47a4e8aebdab9045e0ea1f30cf7345230c 100644 (file)
@@ -21,7 +21,7 @@ standard_testfile
 # We still want to test non-prototype functions for now, which is why
 # we disable compilers warning about them.
 set compile_flags {debug additional_flags=-Wno-deprecated-non-prototype}
-if [support_complex_tests] {
+if {[support_complex_tests]} {
     lappend compile_flags "additional_flags=-DTEST_COMPLEX"
 }
 
@@ -132,7 +132,7 @@ proc do_function_calls {prototypes} {
        gdb_test "p t_int_double(99, 99.0)" " = 1"
     }
 
-    if [support_complex_tests] {
+    if {[support_complex_tests]} {
        gdb_test "p t_float_complex_values(fc1, fc2)" " = 1"
        gdb_test "p t_float_complex_values(fc3, fc4)" " = 0"
 
@@ -221,7 +221,7 @@ proc do_function_calls {prototypes} {
            "call inferior func with struct - returns double"
     }
 
-    if [support_complex_tests] {
+    if {[support_complex_tests]} {
 
        gdb_test "p t_structs_fc(struct_val1)" ".*= 3 \\+ 3i" \
            "call inferior func with struct - returns float _Complex"
@@ -257,7 +257,7 @@ proc fetch_all_registers {test} {
            exp_continue
        }
        -re "^bspstore\[ \t\]+\[^\r\n\]+\r\n" {
-           if [istarget "ia64-*-*"] {
+           if {[istarget "ia64-*-*"]} {
                # Filter out bspstore which is specially tied to bsp,
                # giving spurious differences.
            } else {
@@ -266,7 +266,7 @@ proc fetch_all_registers {test} {
            exp_continue
        }
        -re  "^pstate\[ \t\]+\[^\r\n\]+\r\n" {
-           if [istarget "sparc64-*-linux-gnu"] {
+           if {[istarget "sparc64-*-linux-gnu"]} {
                # Filter out the pstate register, since in sparc64
                # targets the Linux kernel disables pstate.PEF when
                # returning from traps, giving spurious differences.
@@ -276,7 +276,7 @@ proc fetch_all_registers {test} {
            exp_continue
        }
        -re "^last_break\[ \t\]+\[^\r\n\]+\r\n" {
-           if [istarget "s390*-*-*"] {
+           if {[istarget "s390*-*-*"]} {
                # Filter out last_break which is read-only,
                # giving spurious differences.
            } else {
@@ -285,7 +285,7 @@ proc fetch_all_registers {test} {
            exp_continue
        }
        -re "^\(?:cycle\|instret\)\[ \t\]+\[^\r\n\]+\r\n" {
-           if [istarget "riscv*-*-*"] {
+           if {[istarget "riscv*-*-*"]} {
                # Filter out the cycle counter and instructions
                # retired counter CSRs which are read-only, giving
                # spurious differences.
@@ -386,9 +386,9 @@ proc perform_all_tests {prototypes} {
        "The program being debugged stopped while.*" \
        "stop at breakpoint in call dummy function"
     gdb_test "continue" "Continuing.*" "continue from call dummy breakpoint"
-    if ![gdb_test "bt 2" \
-            "#0  main.*" \
-            "bt after continuing from call dummy breakpoint"] then {
+    if {![gdb_test "bt 2" \
+             "#0  main.*" \
+             "bt after continuing from call dummy breakpoint"]} then {
                 set new_reg_content [fetch_all_registers \
                                          "register contents after stop in call dummy"]
                 if {$old_reg_content == $new_reg_content} {
@@ -412,9 +412,9 @@ proc perform_all_tests {prototypes} {
     gdb_test "finish" \
        "Value returned is .* = 9" \
        "finish from call dummy breakpoint returns correct value"
-    if ![gdb_test "bt 2" \
-            "#0  main.*" \
-            "bt after finishing from call dummy breakpoint"] then {
+    if {![gdb_test "bt 2" \
+             "#0  main.*" \
+             "bt after finishing from call dummy breakpoint"]} then {
                 set new_reg_content [fetch_all_registers \
                                          "register contents after finish in call dummy"]
                 if {$old_reg_content == $new_reg_content} {
@@ -435,11 +435,11 @@ proc perform_all_tests {prototypes} {
     # with a value, make sure we are back at main with the same register contents.
     gdb_test "print add(4,5)" "The program being debugged stopped while.*" \
        "call function causing a breakpoint and then do a return"
-    if ![gdb_test "return 7" \
-            "#0  main.*" \
-            "back at main after return from call dummy breakpoint" \
-            "Make add return now. .y or n.*" \
-            "y"] then {
+    if {![gdb_test "return 7" \
+             "#0  main.*" \
+             "back at main after return from call dummy breakpoint" \
+             "Make add return now. .y or n.*" \
+             "y"]} then {
                 set new_reg_content [fetch_all_registers \
                                          "register contents after return in call dummy"]
                 if {$old_reg_content == $new_reg_content} {
index ce828db1676f63e10d95ae1376574da7bb3b6788..198b0aa19faadbf4762e5c23a99f0395116df156 100644 (file)
@@ -22,7 +22,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 224a8dfec89a7daf2ff22c260a095f3d032e1b38..e851d66e7678cc628ec9edabccb559faaeccd154 100644 (file)
@@ -59,7 +59,7 @@ proc do_test {fork_kind exit_kind} {
     with_test_prefix "$fork_kind" {
        clean_restart $testfile
 
-       if ![runto_main] {
+       if {![runto_main]} {
            return -1
        }
 
index aa629727d5df418a1fb6f6570a2d0ef35230d46d..862cae4074f79526e7da47b17f3ad7092e61bd81 100644 (file)
@@ -36,7 +36,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
@@ -47,7 +47,7 @@ gdb_test "handle SIGILL nostop noprint" \
 
 gdb_test "print return_one()" " = 1"
 
-if ![target_info exists gdb,noinferiorio] {
+if {![target_info exists gdb,noinferiorio]} {
 
     # Clean up the breakpoint state.
     delete_breakpoints
index 9c5839c29918b1e45b01a02ac6ad8241c47b2c70..0a1a4f3ca55856ff502229e68210ac38b0cbfcc0 100644 (file)
@@ -348,7 +348,7 @@ proc test_catch_syscall_execve {} {
        # Check for entry/return across the execve, making sure that the
        # syscall_state isn't lost when turning into a new process.
        insert_catch_syscall_with_arg "execve"
-       if [check_continue "execve"] {
+       if {[check_continue "execve"]} {
            # The check_continue test generates an XFAIL on Powerpc.  In
            # that case, gdb is already at main so don't do the continue.
 
index 75fb9f09d0c8826d4456e81c1567073b6a05884e..80fbf4adfc2af2dd52393171f8db1350e497da81 100644 (file)
@@ -391,7 +391,7 @@ foreach target_charset $charset_subset {
        set var_name [string tolower "${target_charset}_string"]
        regsub -all -- "\[^a-z0-9_\]" $var_name "_" var_name
     }
-    
+
     # Compute a regexp matching the results we expect.  This is static,
     # but it's easier than writing it out.
     regsub -all "." "abfnrtv" "(\\\\&|x)" escapes
@@ -492,7 +492,7 @@ foreach target_charset $charset_subset {
         }
     }
 
-    # Try printing a character escape that doesn't exist.  We should 
+    # Try printing a character escape that doesn't exist.  We should
     # get the unescaped character, in the target character set.
     gdb_test "print $L'\\q'" " = \[0-9-\]+ $L'q'" \
              "print escape that doesn't exist in $target_charset"
@@ -549,7 +549,7 @@ if {$wchar_ok} {
 
 set ucs2_ok [expr {[get_sizeof char16_t 99] == 2}]
 
-if ![valid_host_charset "UTF-16"] {
+if {![valid_host_charset "UTF-16"]} {
     verbose -log "Disabling UTF-16 tests."
     set ucs2_ok 0
 }
@@ -640,4 +640,4 @@ foreach name {short int long} {
 }
 
 
-gdb_exit 
+gdb_exit
index dbc523d2caf2344ae682ac2fbbb0e6f8142aba8c..0f7be07c3dc61bfec9b050d2f2b0b92c7a9aa8e9 100644 (file)
@@ -15,8 +15,8 @@
 
 # Author: Paul N. Hilfinger (Hilfinger@gnat.com)
 
-# Test that GDB cleans up properly after errors that result when a 
-# breakpoint is reset. 
+# Test that GDB cleans up properly after errors that result when a
+# breakpoint is reset.
 
 standard_testfile .c
 
@@ -45,21 +45,21 @@ gdb_test "break stop_here if (var1 == 42)" \
 gdb_run_cmd
 
 expect_to_stop_here "first time"
-    
+
 gdb_continue_to_end "breakpoint first time through"
 
 # Now we recompile the executable, but without a variable named "var1", first
 # waiting to insure that even on fast machines, the file modification times
-# are distinct. This will force GDB to reload the file on the 
-# next "run" command, causing an error when GDB tries to tries to reset 
+# are distinct. This will force GDB to reload the file on the
+# next "run" command, causing an error when GDB tries to tries to reset
 # the breakpoint.
 
 sleep 2
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DVARIABLE=var2}] != "" } {
 
-# Complication: Since GDB generally holds an open file descriptor on the 
-# executable at this point, there are some systems in which the 
-# re-compilation will fail. In such cases, we'll consider the test 
+# Complication: Since GDB generally holds an open file descriptor on the
+# executable at this point, there are some systems in which the
+# re-compilation will fail. In such cases, we'll consider the test
 # (vacuously) passed providing that re-running it succeeds as before.
 
     gdb_run_cmd
index 8af2ee69c2348a5d658131e78bd68060426f7af1..38f238cd1f56059fbb55b0d19c63778e88d894b1 100644 (file)
@@ -275,7 +275,7 @@ gdb_test "whatis (enum misordered @data) v_misordered" \
        "type = @data enum misordered" \
        "(enum misordered @data)"
 
-# 
+#
 # Pointers
 #
 
index aa5ed56b947b4edabb7a2605af1a6291a3487714..c21be235491ce70ab8572e9d39f63404f5b1e575 100644 (file)
@@ -255,7 +255,7 @@ proc_with_prefix infrun_breakpoint_command_test {} {
     delete_breakpoints
     gdb_test "break factorial if value == 5" "Breakpoint.*at.*"
 
-# infrun_breakpoint_command_test - This test was broken into two parts 
+# infrun_breakpoint_command_test - This test was broken into two parts
 # to get around a synchronization problem in expect.
 # part1: issue the gdb command "commands"
 # part2: send the list of commands
@@ -547,7 +547,7 @@ proc_with_prefix user_defined_command_manyargs_test {} {
 
     set expected "nargs=$nargs:"
     for {set i 1} {$i <= $nargs} {incr i} {
-       append expected " " [expr 2 * $i]
+       append expected " " [expr {2 * $i}]
     }
 
     gdb_test $cmd $expected "execute command"
@@ -658,7 +658,7 @@ proc_with_prefix test_command_prompt_position {} {
            gdb_test_multiple "printf \"Now the value is %d\\n\", value" $test {
                -re "^printf.*value\r\n>$" {
                    gdb_test_multiple "end" $test {
-                       -re "^end\r\n$gdb_prompt $" { 
+                       -re "^end\r\n$gdb_prompt $" {
                            pass $test
                        }
                    }
@@ -681,7 +681,7 @@ proc_with_prefix deprecated_command_test {} {
     gdb_test "p 5" ".\[0-9\]* = 5.*" "deprecated warning goes away /1/"
 
     gdb_test_no_output "maintenance deprecate p \"new_p\"" "maintenance deprecate p \"new_p\" /2/"
-    gdb_test_no_output "maintenance deprecate print \"new_print\"" 
+    gdb_test_no_output "maintenance deprecate print \"new_print\""
     gdb_test "p 5" \
            "Warning: command 'print' \\(p\\) is deprecated.*Use 'new_print'.*" \
            "both alias and command are deprecated"
@@ -751,7 +751,7 @@ proc_with_prefix bp_deleted_in_command_test {} {
     # one command that deletes this breakpoint.
     gdb_test "break factorial" \
              "Breakpoint \[0-9\]+ at .*: file .*run.c, line \[0-9\]+\."
-    
+
     gdb_test_multiple "commands" "begin commands" {
       -re "Type commands for breakpoint.*>$" {
           pass "begin commands"
index 981fa7b0af4c0708649cd35ccd12323b72cf2c81..b95149e5aab5c83da778d7dc2300e544e53ef1ce 100644 (file)
@@ -136,7 +136,7 @@ with_test_prefix "read-only" {
     }
 
     # Come up with different value.
-    set patch [expr 255 - $orig]
+    set patch [expr {255 - $orig}]
 
     # Write PATCH to memory.
     set written -1
index ca37559e89cbce75a782b73f005259efe6f6461b..59a6c57140b4c6b368cf937492965c5f05a80b0a 100644 (file)
@@ -20,7 +20,7 @@
 #
 # tests for command completion
 #
-# Here are some useful test cases for completion.  
+# Here are some useful test cases for completion.
 # They should be tested with both M-? and TAB.
 #
 #   "show output-" "radix"
@@ -676,7 +676,7 @@ with_cwd $srcdir {
 }
 
 # If the directory name contains a '+' we must escape it, adding a backslash.
-# If not, the test below will fail because it will interpret the '+' as a 
+# If not, the test below will fail because it will interpret the '+' as a
 # regexp operator. We use string_to_regexp for this purpose.
 
 gdb_test "cd ${fullsrcdir}" \
index 686178ddadbaf375afd059e68e20e24b557c0991..d8859c58e3236185218ee1f0f78eb5b9937f2673 100644 (file)
@@ -25,7 +25,7 @@ if {[gdb_compile $srcdir/$subdir/$srcfile $ofile \
 set objcopy_program [gdb_find_objcopy]
 set cmd "$objcopy_program --compress-debug-sections $ofile"
 verbose "invoking $cmd"
-set result [catch "exec $cmd" output]
+set result [catch {exec {*}$cmd} output]
 verbose "result is $result"
 verbose "output is $output"
 
index ea436833c1df900a436e038688fbf3a03fc09ec5..9f49801d890f610a0b10eecc06cb5c82d8923943 100644 (file)
@@ -58,7 +58,7 @@ gdb_test_multiple $test_target $test_target {
 # We now know that the target supports target-side conditional
 # evaluation.  Now make sure we can force-disable the
 # ConditionalBreakpoints RSP feature.
-if [gdb_protocol_is_remote] {
+if {[gdb_protocol_is_remote]} {
     gdb_test \
        "set remote conditional-breakpoints-packet off" \
        "Support for the 'ConditionalBreakpoints' packet on the current remote target is set to \"off\"."
index 20809378b02069fc2adb7812f96ee68935f7c3d4..31c2545b9b7a98534ad2036d7c03ee5dc0db190d 100644 (file)
@@ -18,7 +18,7 @@
 # This file is part of the gdb testsuite
 
 #
-# test of evaluation of conditional expressions, with constants and 
+# test of evaluation of conditional expressions, with constants and
 # variables. Using the print and the whatis command
 # written with the only purpose in mind to cover the holes in the
 # eval.c file
index 19c16dc3c520b02b2e2eff3efd1b87fe97067161..578478da7ca2b9d9aec8e7355fc58f197f2bc6ea 100644 (file)
@@ -94,7 +94,7 @@ with_test_prefix "with continue 2" {
     set bpnum [get_integer_valueof "\$bpnum" 0 "get bpnum"]
 
     gdb_test_no_output "cond $bpnum a == 999"
-    
+
     gdb_test "cond $bpnum gibberish" \
        "No symbol \"gibberish\" in current context." \
        "attempt a bad condition"
index 81b1a36aa223e4d3bd01cb704e0fe103e7506fd4..6392dbccac1e9baef163487d34c2bb2bbf10d10c 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/>.
 
-# This test was written by Rich Title. 
+# This test was written by Rich Title.
 # Purpose is to test conditional breakpoints.
 # Modeled after "break.exp".
 
@@ -42,7 +42,7 @@ gdb_test "break -q main" \
     "Breakpoint.*at.* file .*$srcfile, line.*" \
     "breakpoint function"
 
-# 
+#
 # test conditional break at function
 #
 gdb_test "break marker1 if 1==1" \
@@ -58,7 +58,7 @@ gdb_test "break $srcfile:$bp_location1 if 1==1" \
 
 gdb_test_no_output "delete 3"
 
-# 
+#
 # test conditional break at function
 #
 gdb_test "break marker1 if (1==1)" \
@@ -139,7 +139,7 @@ gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.
 # user instruction, GDB's search finds the second line entry, decides
 # that the PC is indeed at the beginning of a source line, and doesn't
 # print an address in the breakpoint hit message.
-# 
+#
 # GCC's Dwarf2 writer, on the other hand, squeezes out duplicate line
 # entries, so GDB considers the source line to begin at the start of
 # the function's prologue.  Thus, if the program stops at the
index 11164788638f2d004cd4e8569ea266b6ffe0e7aa..65379cc89ce10ca8e51b8d9465378804bc7312a8 100644 (file)
@@ -39,7 +39,7 @@ set n_insns 3
 
 # Extract addresses of a few consecutive instructions.
 set test "get breakpoint addresses"
-if { [gdb_test_multiple "x /[expr $n_insns + 1]i \$pc" $test {
+if { [gdb_test_multiple "x /[expr {$n_insns + 1}]i \$pc" $test {
     -re "=> $hex${up_to_nl}   ($hex)${up_to_nl}   ($hex)${up_to_nl}   ($hex)${up_to_nl}$gdb_prompt $" {
        for {set i 1} {$i <= $n_insns} {incr i} {
            set bp_addrs($i) $expect_out($i,string)
index dcc8d1b77909c6d5933cb55e057e79c6e53c8540..4abd745d76b12993643bfedf11f57ac7fe96a9d1 100644 (file)
@@ -54,7 +54,7 @@ proc local_compiler_xfail_check { } {
     if {[test_compiler_info gcc-2-*]} {
        if { ![test_debug_format "HP"] \
                && ![test_debug_format "DWARF \[0-9\]"] } then {
-           setup_xfail "*-*-*" 
+           setup_xfail "*-*-*"
        }
     }
 }
@@ -69,7 +69,7 @@ proc local_compiler_xfail_check_2 { } {
     }
 }
 
-gdb_test "break marker1" "Breakpoint $decimal at .*" 
+gdb_test "break marker1" "Breakpoint $decimal at .*"
 
 gdb_test_multiple "cont" "up from marker1" {
     -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
index 8ba1f61fc2a054a1fb9a8af23fe17773651b056b..2bac0007e26f30f9075a5640e5123b6debd3959b 100644 (file)
@@ -51,7 +51,7 @@ proc do_test {displaced breakpoint_always_inserted} {
     gdb_test_no_output "set displaced-stepping $displaced"
     gdb_test_no_output "set breakpoint always-inserted $breakpoint_always_inserted"
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
@@ -59,7 +59,7 @@ proc do_test {displaced breakpoint_always_inserted} {
     # any kind of breakpoint insertion failure.  If we can examine
     # what's at memory address 0, it is possible that we could also
     # execute it.
-    if [is_address_zero_readable] {
+    if {[is_address_zero_readable]} {
        untested "memory at address 0 is possibly executable"
        return
     }
index 5d59f8ddcefe0f9f9726883c7378a081275668f5..a3e8c276c4069a1c928e730832c2d5c8a8598210 100644 (file)
@@ -25,7 +25,7 @@ save_vars { GDBFLAGS } {
     }
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return
 }
 
index eb5b4895b82ff60005630f39cef3fb0f03b21f48..75ba07d5fcc669467b37a20ed740e2a63abcb77b 100644 (file)
@@ -48,7 +48,7 @@ if { ![gdb_gcore_cmd "$corefilename" "save corefile"] } {
 
 # Determine if GDB dumped the mapping containing the build-id.  This
 # is done by invoking an external program (eu-unstrip).
-if { [catch "exec [gdb_find_eu-unstrip] -n --core $corefilename" output] == 0 } {
+if { [catch {exec [gdb_find_eu-unstrip] -n --core $corefilename} output] == 0 } {
     set line [lindex [split $output "\n"] 0]
     set test "gcore dumped mapping with build-id"
 
index 88d989d84cc5f27c0c288d8268fd1eb91304af16..de0b2959fac33376e72672bab34d8151aade0d40 100644 (file)
@@ -36,7 +36,7 @@ proc create_core_file { progname } {
     verbose -log "corefile is $corefile"
 
     # Check the corefile has a build-id for the executable.
-    if { [catch "exec [gdb_find_eu-unstrip] -n --core $corefile" output] == 0 } {
+    if { [catch {exec [gdb_find_eu-unstrip] -n --core $corefile} output] == 0 } {
        set line [lindex [split $output "\n"] 0]
        set binfile_re (?:[string_to_regexp $progname]|\\\[(?:exe|pie)\\\])
        if { ![regexp "^${::hex}\\+${::hex} \[a-f0-9\]+@${::hex}.*$binfile_re$" $line] } {
index 23fd964955a242819991744adaab1dffc6bd3179..f6085f793ed9c8d91a78d22f02f0974aef1c7c9e 100644 (file)
@@ -32,7 +32,7 @@ if {[build_executable $testfile.exp $testfile $srcfile] == -1} {
 # length then lets try to make it longer.
 set binfile_len [string length $binfile]
 if { $binfile_len <= 80 } {
-    set extra_len [expr 80 - $binfile_len + 1]
+    set extra_len [expr {80 - $binfile_len + 1}]
     set extra_str [string repeat "x" $extra_len]
     set new_binfile $binfile$extra_str
     remote_exec build "mv $binfile $new_binfile"
index c34dfb5d9c27cae2360f15afe7479b692ac2fa14..ae1e8bf95dc1ad5887c82c4468d0c6cd7e23bae4 100644 (file)
@@ -265,7 +265,7 @@ proc corefile_test_run {} {
        "run: sanity check we see the core file"
 
     set test "run: with core"
-    if [runto_main] {
+    if {[runto_main]} {
        pass $test
     } else {
        fail $test
@@ -327,7 +327,7 @@ proc corefile_test_attach {} {
        return
     }
 
-    if [can_spawn_for_attach] {
+    if {[can_spawn_for_attach]} {
        set test "attach: spawn sleep"
        set res [remote_spawn host "$binfile sleep"]
        if { $res < 0 || $res == "" } {
index 6d55cb2614584eb9ca71a5c74f8481642b8289bd..1aaa48c9c00ecb3ca42d4fe5b9125e71d41a7d03 100644 (file)
@@ -279,7 +279,7 @@ ptype_maybe_prototyped "fffptr" "int (*(*(*)(char))(short int))(long int)" \
 
 if {[runto_main]} {
 
-  if [target_info exists gdb,cannot_call_functions] {
+  if {[target_info exists gdb,cannot_call_functions]} {
     unsupported "this target can not call functions"
     return
   }
index 1d03e0de7af00c6f3a8521ee799f676564392a7e..4a50ab6359bf303d395be2abf200612428ffcbb9 100644 (file)
@@ -56,7 +56,7 @@ clean_restart $executable
 gdb_load_shlib $libobj1
 gdb_load_shlib $libobj2
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 8e713f5ca85d0d482660a5fd4d160e4721aa4c76..0bd034bdcda7a018ed7e57ef95221478bdf4f9a8 100644 (file)
@@ -21,7 +21,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile}] } {
     return -1
 }
 
-if ![runto func] {
+if {![runto func]} {
     return -1
 }
 
index bc8f47ef028b8e414f6048840e84d835d1a469ba..62d561c829d577afb3dc990ffc49f8449977fc72 100644 (file)
@@ -21,7 +21,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile}] } {
     return -1
 }
 
-if ![runto breakpt] {
+if {![runto breakpt]} {
     return -1
 }
 
@@ -45,7 +45,7 @@ proc delete_mem {} {
 
 # Make the dcache line size bigger than the pagesize.
 set pagesize [get_integer_valueof "pg_size" -1]
-set linesize [expr $pagesize * 2]
+set linesize [expr {$pagesize * 2}]
 
 gdb_test_no_output "set dcache line-size $linesize" \
     "set dcache line size to twice the pagesize"
index f22af2416337235145ecc753df6eabfd31edfaaf..0775d236ab1bf9a44e5b561b0e5f11a53199b493 100644 (file)
@@ -25,7 +25,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug}]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index b2b944da21ca0ed640a700398932415fb5fe3512..eee65aecee9ca6ac89c779cac819f17874f855ca 100644 (file)
@@ -23,7 +23,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfiles]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index b5e64c200bd47296161628992fc546af890bd7e1..aab074cf62dd427987ca4b57bde7be9803d34021 100644 (file)
@@ -31,14 +31,14 @@ set timeout 60
 gdb_test "add-symbol-file" "add-symbol-file takes a file name and an address"
 
 # test append
-gdb_test "append" "List of \"append\" subcommands:.*" 
-gdb_test "append binary" "List of \"append binary\" subcommands:.*" 
-gdb_test "append memory" "Missing filename\." 
-gdb_test "append value"  "Missing filename\." 
-gdb_test "append binary memory" "Missing filename\." 
-gdb_test "append binary value"  "Missing filename\." 
-
-if !$use_gdb_stub {
+gdb_test "append" "List of \"append\" subcommands:.*"
+gdb_test "append binary" "List of \"append binary\" subcommands:.*"
+gdb_test "append memory" "Missing filename\."
+gdb_test "append value"  "Missing filename\."
+gdb_test "append binary memory" "Missing filename\."
+gdb_test "append binary value"  "Missing filename\."
+
+if {!$use_gdb_stub} {
     gdb_test_multiple "attach" "attach" {
        -re "Argument required .(process-id|program) to attach.*$gdb_prompt $"\
            { pass "attach" }
@@ -59,7 +59,7 @@ if !$use_gdb_stub {
        gdb_test $i "No default breakpoint address now." "break \"$i\" abbreviation"
     }
 
-    
+
     gdb_test "backtrace" "No stack."
 
     # ba and bac are no longer unique command prefixes. So these tests
@@ -148,21 +148,21 @@ gdb_test "down" "No stack.*"
 #test down-silently
 gdb_test "down-silently" "No stack."
 # test dump
-gdb_test "dump" "List of \"dump\" subcommands:.*" 
-gdb_test "dump binary" "List of \"dump binary\" subcommands:.*" 
-gdb_test "dump ihex" "List of \"dump ihex\" subcommands:.*" 
-gdb_test "dump memory" "Missing filename\." 
-gdb_test "dump srec" "List of \"dump srec\" subcommands:.*" 
-gdb_test "dump tekhex" "List of \"dump tekhex\" subcommands:.*" 
-gdb_test "dump value" "Missing filename\." 
-gdb_test "dump binary memory" "Missing filename\." 
-gdb_test "dump binary value"  "Missing filename\." 
-gdb_test "dump ihex memory" "Missing filename\." 
-gdb_test "dump ihex value"  "Missing filename\." 
-gdb_test "dump srec memory" "Missing filename\." 
-gdb_test "dump srec value"  "Missing filename\." 
-gdb_test "dump tekhex memory" "Missing filename\." 
-gdb_test "dump tekhex value"  "Missing filename\." 
+gdb_test "dump" "List of \"dump\" subcommands:.*"
+gdb_test "dump binary" "List of \"dump binary\" subcommands:.*"
+gdb_test "dump ihex" "List of \"dump ihex\" subcommands:.*"
+gdb_test "dump memory" "Missing filename\."
+gdb_test "dump srec" "List of \"dump srec\" subcommands:.*"
+gdb_test "dump tekhex" "List of \"dump tekhex\" subcommands:.*"
+gdb_test "dump value" "Missing filename\."
+gdb_test "dump binary memory" "Missing filename\."
+gdb_test "dump binary value"  "Missing filename\."
+gdb_test "dump ihex memory" "Missing filename\."
+gdb_test "dump ihex value"  "Missing filename\."
+gdb_test "dump srec memory" "Missing filename\."
+gdb_test "dump srec value"  "Missing filename\."
+gdb_test "dump tekhex memory" "Missing filename\."
+gdb_test "dump tekhex value"  "Missing filename\."
 #test echo
 gdb_test_no_output "echo" "echo"
 #test enable breakpoints delete
@@ -527,7 +527,7 @@ gdb_test "ptype" "The history is empty."
 gdb_test "pwd" "Working directory .*"
 
 #test run "r" abbreviation
-if $use_gdb_stub {
+if {$use_gdb_stub} {
     # Only extended-remote supports "run".
 } else {
     gdb_test_multiple "r" "run \"r\" abbreviation" {
@@ -549,7 +549,7 @@ if $use_gdb_stub {
 }
 
 #test run
-if $use_gdb_stub {
+if {$use_gdb_stub} {
     # Only extended-remote supports "run".
 } else {
     gdb_test_multiple "run" "run" {
@@ -771,7 +771,7 @@ set show_conv_list \
        {$_linker_namespace_count = 0} \
        {$_linker_namespace = <error: No registers.>}\
     }
-if [allow_python_tests] {
+if {[allow_python_tests]} {
     append show_conv_list \
        {
            {$_memeq = <internal function _memeq>} \
index c7466c04f75d7e3311dcc80b4547ccf340aa5e3d..b6a9da16d982a5cf57be6c8b797e11406c2ef4fd 100644 (file)
@@ -48,7 +48,7 @@ gdb_test_multiple "show sysroot" "" {
     }
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return
 }
 
index d863e9f7b479eb20d288066837981efe2e4a6bd9..34f25bea6e66ece2a3c29bdaee9ff1c3b2812d43 100644 (file)
@@ -21,7 +21,7 @@ if { [prepare_for_testing "failed to prepare" "disasm-end-cu" {disasm-end-cu-1.c
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index abb2a2356cad075cc6a6f86a88d9bcc8e2cba781..9b81a4c15166ca09043c359c04df9f563fafe780 100644 (file)
@@ -23,7 +23,7 @@ if { [prepare_for_testing "failed to prepare" $testfile ${testfile}.S {nodebug}]
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 0803e448d2a59ed82c5be25da407af27aab99eec..bbdd207902548b74957b0883667dce03e7ff69f8 100644 (file)
@@ -24,7 +24,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 2fb6e0725bef7a6ac563ae0cc4549de8387c3388..d635982006951b2bde2625940ea8644d4643fd10 100644 (file)
@@ -35,7 +35,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
 # Preserve the old timeout, and set a new one that should be
 # sufficient to avoid timing out during this test.
 set oldtimeout $timeout
-set timeout [expr "$timeout + 60"]
+set timeout [expr {$timeout + 60}]
 verbose "Timeout is now $timeout seconds" 2
 
 # use this to debug:
@@ -43,7 +43,7 @@ verbose "Timeout is now $timeout seconds" 2
 
 # Some coverage stuff
 #
-if !$use_gdb_stub {
+if {!$use_gdb_stub} {
     gdb_test "kill" ".*The program is not being run.*"
     gdb_test "detach" ".*"
     gdb_test "run" ".*"
index c4eb7cdfb223f50833adbda9e3491e05ffd75a05..f8c4f6cc623c2cf95cbb4f1e52950026ba7f25da 100644 (file)
@@ -118,7 +118,7 @@ proc check_dso_count { dso num } {
     gdb_test_multiple "info shared" "info shared" {
        -re "$hex  $hex  \($::decimal\\s+\)\?Yes \[^\r\n\]*$dso\r\n" {
            # use longer form so debug remote does not interfere
-           set count [expr $count + 1]
+           set count [expr {$count + 1}]
            exp_continue
        }
        -re "$gdb_prompt " {
index 11a831047169b0f9ecad2d20c4e1781746978185..5d8ffa381c38a915b4e91c7e7786089ae88c7cb7 100644 (file)
@@ -17,8 +17,8 @@
 
 standard_testfile
 
-if [build_executable "failed to prepare" \
-    ${testfile} ${srcfile} {debug}] {
+if {[build_executable "failed to prepare" \
+        ${testfile} ${srcfile} {debug}]} {
     return -1
 }
 
@@ -31,7 +31,7 @@ proc test { style } {
        clean_restart
        gdb_load $binfile
 
-       if ![runto_main] {
+       if {![runto_main]} {
            return -1
        }
 
index 431037ceb19164d991d19c08af6db0b306f3321f..573aa0a919e5f70d9629c8357bca20e03a964938 100644 (file)
@@ -26,8 +26,8 @@ require can_spawn_for_attach
 standard_testfile
 set escapedbinfile [string_to_regexp ${binfile}]
 
-if [build_executable "failed to prepare for dprintf-detach" \
-    ${testfile} ${srcfile} {debug}] {
+if {[build_executable "failed to prepare for dprintf-detach" \
+        ${testfile} ${srcfile} {debug}]} {
     return -1
 }
 
@@ -44,7 +44,7 @@ proc dprintf_detach_test { breakpoint_always_inserted dprintf_style disconnected
        gdb_test_no_output "set dprintf-style ${dprintf_style}"
        gdb_test_no_output "set disconnected-dprintf ${disconnected_dprintf}"
 
-       if ![runto_main] {
+       if {![runto_main]} {
            return -1
        }
 
index b28f56577ad8f5a31ce2789e5b33affc2abd03be..d8ba03d1ae2de04c2955499cc1033b3fcf5c966d 100644 (file)
@@ -19,12 +19,12 @@ set expfile $testfile.exp
 
 set dp_location [gdb_get_line_number "Set dprintf here"]
 
-if [prepare_for_testing "failed to prepare for dprintf with next" \
-    ${testfile} ${srcfile} {debug}] {
+if {[prepare_for_testing "failed to prepare for dprintf with next" \
+        ${testfile} ${srcfile} {debug}]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 7386ac600ef22ea18ac68f991301deeb77d22fc2..538f7037d557e36be651952775947619abee4743 100644 (file)
@@ -16,8 +16,8 @@
 standard_testfile
 set executable ${testfile}
 
-if [build_executable "failed to prepare for dprintf with non-stop" \
-    ${testfile} ${srcfile} {debug}] {
+if {[build_executable "failed to prepare for dprintf with non-stop" \
+        ${testfile} ${srcfile} {debug}]} {
     return -1
 }
 
@@ -26,7 +26,7 @@ save_vars { GDBFLAGS } {
     clean_restart ${executable}
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 262ccc19cf0935444652f90211902054a9e06b78..6fb208597920da13743f2bb4ebab0b702606a6b3 100644 (file)
@@ -26,7 +26,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile $flags] } {
 set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
 set dp_location1 [gdb_get_line_number "set dprintf 1 here"]
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
@@ -77,7 +77,7 @@ proc restart {} {
     clean_restart
     gdb_load $binfile
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
@@ -142,7 +142,7 @@ proc test_call {} {
 
 # The "call" style depends on having I/O functions available.
 
-if ![target_info exists gdb,noinferiorio] {
+if {![target_info exists gdb,noinferiorio]} {
     with_test_prefix "call" {
        test_call
     }
@@ -171,7 +171,7 @@ proc test_agent {} {
        }
     }
 
-    if !$target_can_dprintf {
+    if {!$target_can_dprintf} {
        return
     }
 
@@ -191,7 +191,7 @@ proc test_agent {} {
        }
     }
 
-    if $target_can_dprintf {
+    if {$target_can_dprintf} {
        gdb_test "continue" "Breakpoint \[0-9\]+, foo .*" "2nd dprintf"
 
        gdb_test_sequence "info breakpoints" "dprintf info" {
@@ -218,7 +218,7 @@ gdb_test "set dprintf-style foobar" "Undefined item: \"foobar\"." \
 # Test that force-disabling the BreakpointCommands RSP feature works
 # as expected.  dprintf relies on support for target-side breakpoint
 # commands --- use it as proxy.
-if [gdb_protocol_is_remote] {
+if {[gdb_protocol_is_remote]} {
     gdb_test \
        "set remote breakpoint-commands-packet off" \
        "Support for the 'BreakpointCommands' packet on the current remote target is set to \"off\"."
index 5d4b9df440289429109b997bd54b2b4c05c6863c..a91e31fd873e6f2081d5270d4b5c8c25be123d85 100644 (file)
@@ -21,7 +21,7 @@ proc dtrace_test {} {
     global testfile hex srcfile binfile
 
     standard_testfile
-    
+
     if {[dtrace_build_usdt_test_program] == -1} {
         untested "failed to compile"
         return -1
@@ -29,8 +29,8 @@ proc dtrace_test {} {
 
     clean_restart
     gdb_load $binfile
-    
-    if ![runto_main] {
+
+    if {![runto_main]} {
         return -1
     }
 
@@ -71,7 +71,7 @@ proc dtrace_test {} {
     # test:progress-counter probe.  Set a breakpoint on it and see
     # that it gets reached.
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
index 64d897b09a2e0bb8911012c923392a8c8b761680..67f319551864dd3b1c94e8bc9fbf62a8ed501b54 100644 (file)
@@ -192,7 +192,7 @@ proc capture_pointer_with_type { pointer } {
            # Expected output of "p ${pointer}" is like "$7 = (int (*)[32]) 0x804a0e0",
            # and we want to extract "(int (*)[32]) 0x804a0e0" from it via
            # following regexp.
-           if [regexp " \\(.*\\).* 0x\[0-9a-fA-F\]+" $expect_out(0,string) output_string] {
+           if {[regexp " \\(.*\\).* 0x\[0-9a-fA-F\]+" $expect_out(0,string) output_string]} {
                # OUTPUT_STRING is expected to be like "(int (*)[32]) 0x804a0e0".
                pass "$test"
            } else {
@@ -261,12 +261,12 @@ make_dump_file \
 
 proc test_restore_saved_value { restore_args msg oldval newval } {
     global gdb_prompt
-    
+
     gdb_test "restore $restore_args" \
        "Restoring .*" \
        "$msg; file restored ok"
     if { ![string compare $oldval \
-              [capture_value $newval "$msg"]] } then { 
+              [capture_value $newval "$msg"]] } then {
        pass "$msg; value restored ok"
     } else {
        fail "$msg; value restored ok"
@@ -398,7 +398,7 @@ test_restore_saved_value "[set intstr1.bin] binary $struct2_start" \
 #
 # test restore with start/stop addresses.
 #
-# For this purpose, we will restore just the third element of the array, 
+# For this purpose, we will restore just the third element of the array,
 # and check to see that adjacent elements are not modified.
 #
 # We will need the address and offset of the third and fourth elements.
@@ -449,7 +449,7 @@ gdb_test "print intarray\[4\] == 0" " = 1" "element 4 not changed - 4"
 if {![string compare $is64bitonly "no"]} {
   print_zero_all
 
-  # restore with expressions 
+  # restore with expressions
   test_restore_saved_value \
        "[set intarr3.srec] (char*)${array2_start}-(char*)${array_start} &intarray\[3\] &intarray\[4\]" \
        "array partial with expressions" 4 "intarray2\[3\]"
@@ -475,7 +475,7 @@ gdb_file_cmd ${binfile}
 # Now fix the endianness at the correct state.
 
 gdb_test_multiple "set endian $endian" "set endianness" {
-    -re ".* (big|little) endian.*$gdb_prompt $" { 
+    -re ".* (big|little) endian.*$gdb_prompt $" {
        pass "setting $endian endianness"
     }
 }
@@ -498,10 +498,10 @@ if { ![string compare $struct_val \
 
 proc test_reload_saved_value { filename msg oldval newval } {
     global gdb_prompt
-    
+
     gdb_file_cmd $filename
     if { ![string compare $oldval \
-              [capture_value $newval "$msg"]] } then { 
+              [capture_value $newval "$msg"]] } then {
        pass "$msg; value restored ok"
     } else {
        fail "$msg; value restored ok"
index 28cefbb1f56dae92e9e4cc26cfcca6d3c5110b16..5a5ad919f24872dbaaec312c65abddca3c798a32 100644 (file)
@@ -42,7 +42,7 @@ if {[build_executable ${testfile}.exp $executable [list ${srcfile} ${srcmainfile
 
 set test "rename section"
 set objcopy_program [gdb_find_objcopy]
-set result [catch "exec $objcopy_program --rename-section sect2=sect1 $binfile" output]
+set result [catch {exec $objcopy_program --rename-section sect2=sect1 $binfile} output]
 verbose "result is $result"
 verbose "output is $output"
 if {$result != 0} {
@@ -62,7 +62,7 @@ if {[gdb_gnu_strip_debug $binfile] != 0} {
 # in $binfile.
 set test "strip"
 set strip_program [transform strip]
-set result [catch "exec $strip_program $binfile" output]
+set result [catch {exec $strip_program $binfile} output]
 verbose "result is $result"
 verbose "output is $output"
 if {$result != 0} {
index 82982c424d87f7623ad2fc5eed96c2fd578e38f4..92815a7428175b5f5407b810ab5e8ae32fcdcaae 100644 (file)
@@ -240,7 +240,7 @@ with_test_prefix "run $count" {
     incr count
 }
 
-# See the comments in condbreak.exp for "run until breakpoint at marker1" 
+# See the comments in condbreak.exp for "run until breakpoint at marker1"
 # for an explanation of the xfail below.
 set test "continue to break marker1, 2nd time"
 gdb_test_multiple "continue" "$test" {
index 44a7cbb634d577b312a1b691388c1da738aaa7fb..013866db555c237b98f36f552c359bfcf7e32f1a 100644 (file)
@@ -16,8 +16,8 @@
 standard_testfile .c
 
 set test_sso [expr \
-                 [supports_scalar_storage_order_attribute] \
-                 && [supports_gnuc]]
+                 {[supports_scalar_storage_order_attribute] \
+                      && [supports_gnuc]}]
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
          [list debug additional_flags=-DTEST_SSO=$test_sso]] } {
index 0b5eadf806c60aa83e5480bda02a962b55e4bfdb..8c542efb00430cbab039317600d07b2143531104 100644 (file)
@@ -78,7 +78,7 @@ gdb_test_multiple "info line ending-run.c:$break1_line" "" {
 
 gdb_test_multiple "i b" "all set to continue" {
     -re ".* breakpoint .* breakpoint .*$gdb_prompt $" {
-        fail "all set to continue (didn't clear bps)" 
+        fail "all set to continue (didn't clear bps)"
     }
     -re ".*2.*main.*$break2_line.*$gdb_prompt $" {
         pass "all set to continue"
@@ -92,7 +92,7 @@ gdb_test_multiple "i b" "all set to continue" {
 # See if we can step out with control.  The "1 2 3" stuff
 # is output from the program.
 #
-if ![gdb_skip_stdio_test "cont"] {
+if {![gdb_skip_stdio_test "cont"]} {
     gdb_test_stdio "cont" \
        "1 2 7 14 23 34 47 62 79" \
        "Breakpoint.*$break2_line.*"
@@ -100,7 +100,7 @@ if ![gdb_skip_stdio_test "cont"] {
     gdb_test "cont" ".*Breakpoint.*$break2_line.*"
 }
 
-if ![gdb_skip_stdio_test "Step to return"] {
+if {![gdb_skip_stdio_test "Step to return"]} {
     gdb_test_stdio "next" \
        "Goodbye!" \
        "[expr {$break2_line + 1}].*" \
@@ -129,13 +129,13 @@ gdb_test_multiple "next" "step out of main" {
        fail "step out of main"
        gdb_test "n" ".*" ""
     }
-    -re ".*in.*start.*$gdb_prompt $" { 
+    -re ".*in.*start.*$gdb_prompt $" {
        pass "step out of main"
     }
-    -re ".*in.*bsp_trap.*$gdb_prompt $" { 
+    -re ".*in.*bsp_trap.*$gdb_prompt $" {
        pass "step out of main"
     }
-    -re ".*in.*init.*$gdb_prompt $" { 
+    -re ".*in.*init.*$gdb_prompt $" {
        # This is what happens on sparc64-elf ultra.
        pass "step out of main"
     }
@@ -172,7 +172,7 @@ gdb_test_multiple "next" "step out of main" {
        # This is what happens on the ARM RVDS runtime
        pass "step out of main"
     }
-    -re ".*in.*\\\$START\\\$.*from.*dld.sl.*$gdb_prompt $" { 
+    -re ".*in.*\\\$START\\\$.*from.*dld.sl.*$gdb_prompt $" {
        pass "step out of main"
     }
     -re ".*in __wrap__?main ().*$gdb_prompt $" {
@@ -183,7 +183,7 @@ gdb_test_multiple "next" "step out of main" {
        # another `next' is necessary.
        gdb_test "next" ".*in start_l ().*" "step out of main"
     }
-    -re ".*in.*currently asm.*$gdb_prompt $" { 
+    -re ".*in.*currently asm.*$gdb_prompt $" {
         pass "step out of main"
     }
     -re "_*start\[0-9\]* \\(\[^)\]*\\).*$gdb_prompt $" {
@@ -245,7 +245,7 @@ if {!$use_gdb_stub
                set program_exited_normally 1
            }
            -re ".*Single.*in exit.*from.*dld.sl.*$gdb_prompt $" {
-               pass "step to end of run" 
+               pass "step to end of run"
                set program_in_exit 1
            }
            -re ".*Single.*_int_reset.*$gdb_prompt $" {
@@ -254,7 +254,7 @@ if {!$use_gdb_stub
                    set program_exited_normally 1
                }
            }
-       }   
+       }
     }
 
     if {$program_in_exit} {
@@ -275,10 +275,10 @@ if {!$use_gdb_stub
 
     set exec_output [remote_exec host "ls core"]
 
-    if [ regexp "core not found" $exec_output]  {
+    if {[ regexp "core not found" $exec_output]} {
        pass "no core dumped on quit"
     } else {
-       if [ regexp "No such file or directory" $exec_output] {
+       if {[ regexp "No such file or directory" $exec_output]} {
            pass "ls: core (No core dumped on quit)"
        } else {
            remote_exec build "rm -f core"
index ea1ff70498cca94b32f05e6be4f4091d8d72ce70..9607b81aaba55480167d09f54670633a754f2bae 100644 (file)
@@ -47,7 +47,7 @@ standard_testfile
 proc do_tests {{do_xfail_cast 0} {do_xfail 0} {do_xfail_core_test 0}} {
     clean_restart
     gdb_load $::binfile
-    if ![runto_main] {
+    if {![runto_main]} {
        return
     }
 
@@ -145,12 +145,12 @@ proc do_tests {{do_xfail_cast 0} {do_xfail 0} {do_xfail_core_test 0}} {
        }
     }
 
-    if $do_xfail {
+    if {$do_xfail} {
        setup_xfail *-*-*
     }
     gdb_test "print errno" ".* = 42"
 
-    if $do_xfail_cast {
+    if {$do_xfail_cast} {
        setup_xfail *-*-*
     }
     gdb_test "print (int) errno" ".* = 42"
@@ -173,7 +173,7 @@ proc do_tests {{do_xfail_cast 0} {do_xfail 0} {do_xfail_core_test 0}} {
     gdb_test "print errno" ".* = 36" "print masking errno"
 
     # Finish test early if no core file was made.
-    if !$core_supported {
+    if {!$core_supported} {
        return
     }
 
@@ -184,7 +184,7 @@ proc do_tests {{do_xfail_cast 0} {do_xfail 0} {do_xfail_core_test 0}} {
     if { $core_loaded == -1 } {
        return
     }
-    if $do_xfail_core_test {
+    if {$do_xfail_core_test} {
        setup_xfail *-*-*
     }
     gdb_test "print errno" ".* = 42" "check errno value from corefile"
index 1040f6a3e0772ad5b9d5dfc781797185f2851aaa..43f2bc0f4b4107ba43c71278bbc906a282dfeb9f 100644 (file)
@@ -28,7 +28,7 @@ if {[lindex $status 0] != 0} {
 
 clean_restart $testfile
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index f91459412984193e5ba6db964e982774477bbfbd..fdd6bed5ac914abd992f10d1383367943746ad0e 100644 (file)
@@ -22,7 +22,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index b4c856ed2e6828ca32b5b4964f38659f17b616e9..aca51187baad308f2e1880f43d57abe3eaf87d4e 100644 (file)
@@ -23,7 +23,7 @@
 # operators, or in the non returned part of a (x ? y: z) expression.
 # the part that is not evaluated is parsed and evaluated anyway, but with
 # the EVAL_SKIP flag set
-# 
+#
 # source file "int-type.c"
 #
 
index cc162ee4c1391f0ea1f348e3757996ef2e22ce48..0eef3270cc7c9e2bc01fbf5ce6fa951d7812db0c 100644 (file)
@@ -22,7 +22,7 @@ if { [prepare_for_testing "failed to prepare for examine-backward" \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
@@ -357,7 +357,7 @@ with_test_prefix "backward disassemble general" {
         lappend disassmbly $instructions
     }
     for {set i 0} {$i < [llength $length_to_examine]} {incr i} {
-        set idx [expr [llength $length_to_examine] - $i - 1]
+        set idx [expr {[llength $length_to_examine] - $i - 1}]
         set len [lindex $length_to_examine $idx]
         set actual [capture_command_output "x/-${len}i" ""]
         set expected [lindex $disassmbly $idx]
index 55656be4eda5325e812b6fd5e3d0cdabc6a2c16a..c817db2c6d67eac75b8e6aa5b28e32c34f16ea96 100644 (file)
@@ -24,7 +24,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
 
 proc test { prefix body } {
     with_test_prefix $prefix {
-       if ![runto_main] {
+       if {![runto_main]} {
            return 0
        }
        uplevel 1 $body
@@ -39,7 +39,7 @@ test "next" {
 }
 
 test "infcall" {
-    if ![target_info exists gdb,cannot_call_functions] {
+    if {![target_info exists gdb,cannot_call_functions]} {
        gdb_test "print func ()" " = 1"  "termios ok"
     } else {
        unsupported "cannot call functions"
index 1315535d9b88d5314585d2d856ca6f38c8a1d1da..981a06d3664f61b9595636d4a457e2850eed21a1 100644 (file)
@@ -26,7 +26,7 @@
 #
 # This test is meant to verify that, even with lazy partial symtab
 # reading in effect, GDB can set breakpoints by line number
-# successfully in either compilation unit.  
+# successfully in either compilation unit.
 
 standard_testfile
 
index ee0c198bf3d8197791760506154f6965b3f2e0f3..b1cc8fb334fc791dc6d90c8882ec45170068f205 100644 (file)
@@ -45,11 +45,11 @@ proc test_expr { args } {
     if { [llength $args] % 2 } {
        warning "an even # of arguments should be passed to test_expr"
     }
-    set last_ent [expr [llength $args] - 1]
+    set last_ent [expr {[llength $args] - 1}]
     set testname [lindex $args $last_ent]
     gdb_test [lindex $args 0] ".*" "$testname, setup"
-    for {set x 1} {$x < $last_ent} {set x [expr $x + 2]} {
-       gdb_test [lindex $args $x] [lindex $args [expr $x + 1]] "$testname, [lindex $args $x]"
+    for {set x 1} {$x < $last_ent} {set x [expr {$x + 2}]} {
+       gdb_test [lindex $args $x] [lindex $args [expr {$x + 1}]] "$testname, [lindex $args $x]"
     }
 }
 #
@@ -224,10 +224,10 @@ gdb_test_multiple "print sizeof (long long) > sizeof (long)" \
        pass "sizeof (long long) > sizeof (long) (false)"
     }
 }
-if [expr ! $ok] { setup_xfail "*-*-*" }
+if {!$ok} { setup_xfail "*-*-*" }
 gdb_test "print (void*) ((long long) (unsigned long) -1 + 1)" \
        "warning: value truncated.*" "truncate (void*) 0x00000000ffffffff + 1"
-if [expr ! $ok] { setup_xfail "*-*-*" }
+if {!$ok} { setup_xfail "*-*-*" }
 gdb_test "print (void*) (~((long long)(unsigned long) -1) - 1)" \
        "warning: value truncated.*" "truncate (void*) 0xffffffff00000000 - 1"
 
index a6b4c2391c72f4e4ba135185ff0a34196759041d..e2b7354dbc252bfbf949b04869b36b4d4308fd05 100644 (file)
@@ -39,7 +39,7 @@ if {[file exists $dir2] && ![file writable $dir2]} {
 system "rm -rf [standard_output_file *.fileio.test]"
 
 set oldtimeout $timeout
-set timeout [expr "$timeout + 60"]
+set timeout [expr {$timeout + 60}]
 
 clean_restart
 gdb_load $binfile
@@ -51,7 +51,7 @@ if {![runto_main]} {
     return
 }
 
-gdb_test "break stop" "Breakpoint .*$srcfile.*" 
+gdb_test "break stop" "Breakpoint .*$srcfile.*"
 
 set stop_msg ".*Breakpoint .* stop \\(\\) at.*$srcfile:.*static void stop \\(void\\) {}.*"
 
@@ -73,7 +73,7 @@ gdb_test continue \
 
 gdb_test "continue" ".*" ""
 
-catch "system \"chmod -f -w [standard_output_file nowrt.fileio.test]\""
+catch {system "chmod -f -w [standard_output_file nowrt.fileio.test]"}
 
 # If the user is root, we will always have write permission.
 if { [root_user] } {
@@ -241,7 +241,7 @@ gdb_test continue \
 
 # This test fails on Cygwin because unlink() succeeds on Win32 systems
 # in that situation.
-if [ishost *cygwin*] {
+if {[ishost *cygwin*]} {
     setup_xfail "*-*-*"
 }
 # If the user is root, we will always have write permission.
index c10941c971774b18f9d140b5c1d1ab81e7d96cd2..c80e634c10acccc7e48fc94b671ef5eabe0ae4b7 100644 (file)
@@ -148,7 +148,7 @@ proc test_tab_complete_within_line_multiple { input_line back_count \
        [join [list \
                   [string range $input_line 0 end-$back_count] \
                   ${add_completed_line} \
-                  [string range $input_line end-[expr $back_count - 1] end]] \
+                  [string range $input_line end-[expr {$back_count - 1}] end]] \
             ""]
     set expanded_line_re [string_to_regexp $expanded_line]
 
@@ -166,7 +166,7 @@ proc test_tab_complete_within_line_multiple { input_line back_count \
     set after_tab_re "^$input_line_re"
     set after_tab_re "$after_tab_re\\\x08{$back_count}"
     set after_tab_re "$after_tab_re${completion::bell_re}"
-    set tail [string range $input_line end-[expr $back_count - 1] end]
+    set tail [string range $input_line end-[expr {$back_count - 1}] end]
     set after_tab_re "$after_tab_re$add_completed_line_re"
     set after_tab_re "$after_tab_re[string_to_regexp $tail]"
     set after_tab_re "$after_tab_re\\\x08{$back_count}"
@@ -218,7 +218,7 @@ proc test_tab_complete_within_line_unique { input_line back_count insert_str } {
     set re [string_to_regexp $input_line]
     set re $re\\\x08{$back_count}
     set re $re[string_to_regexp $insert_str]
-    set tail [string range $input_line end-[expr $back_count - 1] end]
+    set tail [string range $input_line end-[expr {$back_count - 1}] end]
     set re $re[string_to_regexp $tail]
     set re $re\\\x08{$back_count}
 
index 28c5fd88ab59d411a7065cec7737a08787f8ee6e..8f186507634676d14f18c2f10f9d013776052f3e 100644 (file)
@@ -19,7 +19,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile}] } {
     return -1
 }
 
-if ![runto breakpt] {
+if {![runto breakpt]} {
     return -1
 }
 
index 3b2dfb0a6ea7a6969f2568f1dbfc0c1f7e23c4fc..aa4fc3c8b19584d9a7323ac002578c35103c9771 100644 (file)
@@ -165,7 +165,7 @@ gdb_test "find /w search_buf, +search_buf_size, 0x12345678" \
 
 # For native targets, test a pattern straddling a chunk boundary.
 
-if [isnative] {
+if {[isnative]} {
     gdb_test_no_output "set *(int32_t*) &search_buf\[${CHUNK_SIZE}-1\] = 0xfdb97531" ""
     gdb_test "find /w search_buf, +search_buf_size, 0xfdb97531" \
     "${hex_number}${one_pattern_found}" \
index 6c23cec38b24d936bdb19a7c1c99e1d9ecc48516..8f0c7c1e4d1685244774a9b771261d3097ad290a 100644 (file)
@@ -29,7 +29,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile $opts] } {
 }
 
 proc finish_pretty { } {
-    if ![runto foo] {
+    if {![runto foo]} {
        return
     }
     gdb_test_no_output "set print pretty" \
index 12db516d58af090211486f45081eaaf316792743..470f651ce511cb4135fef69f1e634d62c4dc6aec 100644 (file)
@@ -67,8 +67,8 @@ proc_with_prefix check_fork_catchpoints {} {
 # the followed process stops where it is expected to stop, that processes
 # are detached (or not) as expected, and that the inferior list has the
 # expected contents after following the fork.  WHO is the argument to
-# the 'set follow-fork-mode' command, DETACH is the argument to the 
-# 'set detach-on-fork' command, and CMD is the GDB command used to 
+# the 'set follow-fork-mode' command, DETACH is the argument to the
+# 'set detach-on-fork' command, and CMD is the GDB command used to
 # execute the program past the fork.  If the value of WHO or DETACH is
 # 'default', the corresponding GDB command is skipped for that test.
 # The value of CMD must be either 'next 2' or 'continue'.
index 6ca7711fe8113a775796c389efa23f097ab71145..a480b930e9672e0a4490ca8e4247ab5d33ccee8b 100644 (file)
@@ -53,7 +53,7 @@ if { [is_remote target] } {
 proc setup_gdb { binfile srcfile } {
     clean_restart $binfile
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return -code return
     }
 
index c24a9bc3389fb492cee7bd61bf2d36148baf5918..0c6ad87b712368c8e81df760ad1e9286573540e5 100644 (file)
@@ -83,7 +83,7 @@ foreach_with_prefix print_inferior_events { "on" "off" } {
            # Always add the "Starting program..." string so that we
            # match exactly the lines we want.
            set output "Starting program: $binfile\\s*\r\n${thread_db_re}${output}${thread_db_re}${exited_normally_re}"
-           set i [expr $i + 1]
+           set i [expr {$i + 1}]
            gdb_test "run" $output
        }
     }
index 58383c97be0542fd3585854a58a1138e01708182..f0c4518bf944c36afc81eaa6aa967a9d4961c1fa 100644 (file)
@@ -19,7 +19,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile}] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index fd492a37bafab0a29c307cca362f19f446334d20..9806a593686534f4dc3970ad93b0deafd2493ecd 100644 (file)
@@ -52,7 +52,7 @@ proc get_new_address { {addresses {}} } {
     set elem [lindex [lsort -integer -decreasing $addresses] 0]
 
     # Return a new address as a hex formatted string.
-    return [format "%#x" [expr $elem + 0x10]]
+    return [format "%#x" [expr {$elem + 0x10}]]
 }
 
 
index ec90179dee93bfd9ff3a5c3d912947c961e271fe..d989a48d83a908bc2458322c5593a2e9f199bf2c 100644 (file)
@@ -35,7 +35,7 @@ if  { [gdb_compile [standard_output_file tmp-${srcfile}] "${binfile}" executable
     return -1
 }
 
-# Unlike most GDB tests, we do not use gdb_reinitialize_dir in this script. 
+# Unlike most GDB tests, we do not use gdb_reinitialize_dir in this script.
 # We're testing GDB's ability to find files in other ways.
 
 # Get the line number.
index d18a6f450936639058ef51e81788c8ac54464cd7..a94488fd299ea3f5dde9e2ec8f181445683a5605 100644 (file)
@@ -33,7 +33,7 @@ with_cwd $srcdir {
     }
 }
 
-set result [catch "exec realpath ${srcdir}/${subdir}/${srcfile2}" realsrcfile2]
+set result [catch {exec realpath ${srcdir}/${subdir}/${srcfile2}} realsrcfile2]
 if { $result != 0 || $realsrcfile2 == "" } {
     untested "invalid realpath of ${srcfile2}: result $result output $realsrcfile2"
     return -1
index 4bc80ac6c35a7845e15b08d550b4d22289149e8d..d2eb0bccb346134ed28ddb32cdd2cee064fcf6fd 100644 (file)
@@ -21,7 +21,7 @@ if { [prepare_for_testing "failed to prepare" "func-ptr" {func-ptr.c} {debug}] }
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return 0
 }
 
index 1c1b74bfba82f4b35a5c99562eb47e1f6bb4c9c7..e4c3c5b4dc058628b4814cf724d8f662d1b43f71 100644 (file)
@@ -21,7 +21,7 @@ standard_testfile
 set gcc_compiled [is_c_compiler_gcc]
 
 set compile_flags {debug nowarnings quiet}
-if [support_complex_tests] {
+if {[support_complex_tests]} {
     lappend compile_flags "additional_flags=-DTEST_COMPLEX"
 }
 
@@ -55,7 +55,7 @@ proc_with_prefix integral_args {} {
 
     # Print each arg as a double check to see if we can print
     # them here as well as with backtrace.
-    gdb_test "print c" ".* = 97 'a'" "print c after run to call0a" 
+    gdb_test "print c" ".* = 97 'a'" "print c after run to call0a"
     gdb_test "print s" ".* = 1" "print s after run to call0a"
     gdb_test "print i" ".* = 2" "print i after run to call0a"
     gdb_test "print l " ".* = 3" "print l after run to call0a"
@@ -921,7 +921,7 @@ proc_with_prefix localvars_in_indirect_call { } {
     gdb_breakpoint call0a
     gdb_continue call0a
     delete_breakpoints
-    
+
     # Print each arg as a double check to see if we can print
     # them here as well as with backtrace.
 
@@ -937,9 +937,9 @@ proc_with_prefix localvars_in_indirect_call { } {
        "#0.*call0a \\(c=97 'a', s=1, i=2, l=3\\).*#1.*main.*" \
        "backtrace in indirectly called function"
 
-    # 
+    #
     # "finish" brings us back to main.  We then will try to step through
-    # the second indirect call.  
+    # the second indirect call.
     # On some targets (e.g. m68k) gdb will stop from the finish in midline
     # of the first indirect call. This is due to stack adjustment instructions
     # after the indirect call. In these cases we will step till we hit the
@@ -1032,7 +1032,7 @@ proc_with_prefix stepping_over_trampolines { } {
 }
 
 set prev_timeout $timeout
-if [istarget "mips*tx39-*"] {
+if {[istarget "mips*tx39-*"]} {
     set timeout 300
 } else {
     set timeout 60
@@ -1083,7 +1083,7 @@ if {$allow_float_test} {
 }
 
 # Test _Complex type here if supported.
-if [support_complex_tests] {
+if {[support_complex_tests]} {
     complex_args
 
     complex_integral_args
index 14b03a071cff746ae081ecf8937290cb1e1bc476..ca47ad61dc3b567eedbef40365e051f56ce543d3 100644 (file)
@@ -73,8 +73,8 @@ proc run_test {megs max_mem} {
 
        # Do the main part of the test: How much is the memory
        # usage of GDB going to grow after using the gcore command.
-       set diff_k [expr $mem_after - $mem_before]
-       set diff [expr $diff_k/1024]
+       set diff_k [expr {$mem_after - $mem_before}]
+       set diff [expr {$diff_k/1024}]
        verbose -log "The gcore command used $diff Mb ($diff_k Kb)"
        gdb_assert {$diff <= $max_mem} "gdb did not use too much memory"
 
index 641caf1b798647802fed4478443d2c3f628d1bec..a7a6e9b774ceadbfd948391d1193d1409df00033 100644 (file)
@@ -29,7 +29,7 @@ set gcorefile ${binfile}.gcore
 
 set strip_program [transform strip]
 remote_file host delete ${stripped_binfile}
-if [run_on_host "strip" "$strip_program" "-g -o ${stripped_binfile} $binfile"] {
+if {[run_on_host "strip" "$strip_program" "-g -o ${stripped_binfile} $binfile"]} {
     return -1
 }
 
@@ -42,7 +42,7 @@ clean_restart
 gdb_load $stripped_binfile
 
 # The binary is stripped of debug info, but not minsyms.
-if ![runto break_here] {
+if {![runto break_here]} {
     return -1
 }
 
index 2bbd06443bc75295d3abdca451821b4dbc5a9912..4d3d352333ca4a371ffe309b6c58f99172c2e41c 100644 (file)
@@ -38,7 +38,7 @@ with_test_prefix "first session" {
     gdb_load $binfile
     gdb_load_shlib ${binfile_lib}
 
-    if ![runto lib] {
+    if {![runto lib]} {
        return -1
     }
 
index a8f7366c7a1ab631669a72dfda97f1e3840bf60c..27df21059720285199003300ae2edd81b64f0bf5 100644 (file)
@@ -33,7 +33,7 @@ set gcorefile ${binfile}.gcore
 
 set strip_program [transform strip]
 remote_file host delete ${stripped_binfile}
-if [run_on_host "strip" "$strip_program" "-g -o ${stripped_binfile} $binfile"] {
+if {[run_on_host "strip" "$strip_program" "-g -o ${stripped_binfile} $binfile"]} {
     return -1
 }
 
@@ -46,7 +46,7 @@ clean_restart
 gdb_load $stripped_binfile
 
 # The binary is stripped of debug info, but not minsyms.
-if ![runto break_here] {
+if {![runto break_here]} {
     return -1
 }
 
index c8a4c11adc8c18316709a180d2c5507531e13e86..a9027608b12cafb7fe167836f2ba1d5a20743417 100644 (file)
@@ -102,7 +102,7 @@ if {![string compare $pre_corefile_sysregs $post_corefile_sysregs]} {
 
 set post_corefile_extern_array \
        [capture_command_output "print extern_array" "$print_prefix"]
-if ![string compare $pre_corefile_extern_array $post_corefile_extern_array]  {
+if {![string compare $pre_corefile_extern_array $post_corefile_extern_array]} {
     pass "corefile restored extern array"
 } else {
     fail "corefile restored extern array"
@@ -110,7 +110,7 @@ if ![string compare $pre_corefile_extern_array $post_corefile_extern_array]  {
 
 set post_corefile_static_array \
        [capture_command_output "print static_array" "$print_prefix"]
-if ![string compare $pre_corefile_static_array $post_corefile_static_array]  {
+if {![string compare $pre_corefile_static_array $post_corefile_static_array]} {
     pass "corefile restored static array"
 } else {
     fail "corefile restored static array"
@@ -118,7 +118,7 @@ if ![string compare $pre_corefile_static_array $post_corefile_static_array]  {
 
 set post_corefile_uninit_array \
        [capture_command_output "print un_initialized_array" "$print_prefix"]
-if ![string compare $pre_corefile_uninit_array $post_corefile_uninit_array]  {
+if {![string compare $pre_corefile_uninit_array $post_corefile_uninit_array]} {
     pass "corefile restored un-initialized array"
 } else {
     fail "corefile restored un-initialized array"
@@ -126,7 +126,7 @@ if ![string compare $pre_corefile_uninit_array $post_corefile_uninit_array]  {
 
 set post_corefile_heap_string \
        [capture_command_output "print heap_string" "$print_prefix"]
-if ![string compare $pre_corefile_heap_string $post_corefile_heap_string]  {
+if {![string compare $pre_corefile_heap_string $post_corefile_heap_string]} {
     pass "corefile restored heap array"
 } else {
     fail "corefile restored heap array"
@@ -134,14 +134,14 @@ if ![string compare $pre_corefile_heap_string $post_corefile_heap_string]  {
 
 set post_corefile_local_array \
        [capture_command_output "print array_func::local_array" "$print_prefix"]
-if ![string compare $pre_corefile_local_array $post_corefile_local_array]  {
+if {![string compare $pre_corefile_local_array $post_corefile_local_array]} {
     pass "corefile restored stack array"
 } else {
     fail "corefile restored stack array"
 }
 
 set post_corefile_backtrace [capture_command_output "backtrace" ""]
-if ![string compare $pre_corefile_backtrace $post_corefile_backtrace]  {
+if {![string compare $pre_corefile_backtrace $post_corefile_backtrace]} {
     pass "corefile restored backtrace"
 } else {
     fail "corefile restored backtrace"
index f0802c4ce8fe7afe24ae7ff6d641868e753cf7a9..02410fd924b446d8e536a37128e977c2310f7282 100644 (file)
@@ -34,7 +34,7 @@ if { [build_executable ${testfile}.exp ${testfile} $srcfile $options] == -1 } {
 proc do_test { pass } {
     global testfile gdb_prompt binfile pf_prefix
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
@@ -53,7 +53,7 @@ proc do_test { pass } {
            set abort 0
        }
     }
-    if $abort {
+    if {$abort} {
        verbose -log "$pf_prefix $test: did not run"
        return $abort
     }
index ab12a28e5a9d92a71e169a91cceb9313125a2514..174c8f790c29b1bc6a6b9999a33bb2643d170d19 100644 (file)
@@ -49,8 +49,8 @@ gdb_test_multiple "s" $name \
     -re "hithere2 \\(\\) at.*${libfile}.c:\[0-9\]+\r\n\[0-9\]+.*a = 21;.*$gdb_prompt $"  {
        pass $name
     }
-    -re "0x\[0-9a-f\]+ in .* \\(\\) from /lib/ld.so.1.*$gdb_prompt $" { 
-       kfail "gdb/1555" $name 
+    -re "0x\[0-9a-f\]+ in .* \\(\\) from /lib/ld.so.1.*$gdb_prompt $" {
+       kfail "gdb/1555" $name
     }
 }
 
@@ -61,8 +61,8 @@ gdb_test_multiple "n" $name \
     -re "\[0-9\]+.*return a;.*$gdb_prompt $" {
        pass $name
     }
-    -re "Single stepping until exit from function .*, \r\nwhich has no line number information.\r\n\r\n$inferior_exited_re normally.*$gdb_prompt $" { 
-       kfail "gdb/1555" $name 
+    -re "Single stepping until exit from function .*, \r\nwhich has no line number information.\r\n\r\n$inferior_exited_re normally.*$gdb_prompt $" {
+       kfail "gdb/1555" $name
     }
 }
 
index c377150d720c30057ded143a8f9e80fe86f61a7e..cd9c542b4215ab1338ff3ef381dcf46c2e1311e0 100644 (file)
@@ -30,6 +30,6 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
 
 if {![runto_main]} {
     return
-} 
-gdb_test "print /x bar" "{x__0 = 0x0, y__0 = 0x0, z__1 = 0x0}" 
+}
+gdb_test "print /x bar" "{x__0 = 0x0, y__0 = 0x0, z__1 = 0x0}"
 
index e9590786bff913ef54f8a8a360f2b38920b667c0..2fabd45614566705005c32590c1b0a504ebd4849 100644 (file)
@@ -15,7 +15,7 @@
 
 standard_testfile
 
-if [build_executable ${testfile}.exp $testfile] {
+if {[build_executable ${testfile}.exp $testfile]} {
     return -1
 }
 
index 80b124700f1f8b0d853c267074e0e750a0544460..80c7aa81f3c70bb6ab5edf2b7a6c1ee4c7eb07b8 100644 (file)
@@ -21,7 +21,7 @@ if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile}]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index dca3bdde984d1e564bcb616a56fabf9c76ce2bf7..6a9bcbe4497956b98b047f04b7d8c1de6aabacc7 100644 (file)
@@ -21,7 +21,7 @@ if { [prepare_for_testing "failed to prepare" ${test} ${srcfile}] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 9390e404cdf1532661690d02250c986d75da24e6..65f08e26acfa85795fcd02d27a75d0dca22e1cba 100644 (file)
@@ -477,7 +477,7 @@ proc test_next_with_recursion {} {
 
     delete_breakpoints
 
-    if [istarget "mips*tx39-*"] {
+    if {[istarget "mips*tx39-*"]} {
        set timeout 60
     }
     # We used to set timeout here for all other targets as well.  This
index cb12964d073bc044898614fb8c59b40861a1730b..0c307bba7f49ddf2e2367fc94765ee0cd6dac767 100644 (file)
@@ -23,14 +23,14 @@ require {!target_info exists gdb,skip_huge_test}
 
 standard_testfile .c
 
-set max [expr 2 * 1024 * 1024]
+set max [expr {2 * 1024 * 1024}]
 set min 16
 
 set opts {}
 lappend opts debug
 
 set compilation_succeeded 0
-for { set size $max } { $size >= $min } { set size [expr $size / 2] } {
+for { set size $max } { $size >= $min } { set size [expr {$size / 2}] } {
     set try_opts [concat $opts [list additional_flags=-DCRASH_GDB=$size]]
     if { [build_executable $testfile.exp $testfile $srcfile $try_opts] == -1 } {
        continue
@@ -84,6 +84,6 @@ save_vars { timeout } {
        unsupported $test
     } else {
        # At 56 passes with and without the fix, so use 55.
-       gdb_assert {$space_used < [expr 55 * 4 * $size] } $test
+       gdb_assert {$space_used < [expr {55 * 4 * $size}] } $test
     }
 }
index 93c8f54051410c050fa62539f04e66333e481907..a342104d55c3b7c6a2e13564c5f8b3b568508c6b 100644 (file)
@@ -26,7 +26,7 @@ if { [prepare_for_testing "failed to prepare" ${test} ${srcfile}] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index e5223c9d3b947a93c8abdb8c03ffa42fe1588a73..a125a27d61c5ee9deaf85aab5ad6a99ec32678a5 100644 (file)
@@ -26,7 +26,7 @@ gdb_test_no_output "set listsize 1"
 
 gdb_test "list -q main" ".*"
 get_debug_format
-set non_dwarf [expr ! [test_debug_format "DWARF \[0-9\]"]]
+set non_dwarf [expr {! [test_debug_format "DWARF \[0-9\]"]}]
 
 # We should be able to find the source file containing the definition,
 # even though it was an included header.
index a1f64b05f1f36488d0cb3b8beb65131541b9ba62..c7dbc469beaff5eea88cffd0ab01e3ad7b99e93b 100644 (file)
@@ -29,8 +29,8 @@ if { [build_executable "failed to prepare" $testfile [list $srcfile $srcfile2] \
 #  - the binary already has an index section
 #  - we use the -readnow switch
 set has_index_section [exec_has_index_section $binfile]
-set uses_readnow [expr [string first "-readnow" $GDBFLAGS] != -1]
-set expecting_index_cache_use [expr !$has_index_section && !$uses_readnow]
+set uses_readnow [expr {[string first "-readnow" $GDBFLAGS] != -1}]
+set expecting_index_cache_use [expr {!$has_index_section && !$uses_readnow}]
 
 # List the files in DIR on the host (where GDB-under-test runs).
 # Return a list of two elements:
index 6c9593426a42a0d40adbd6c5f26cfe1888f357b9..b633cf2751979135e2fa07038f8d926a9ed57e84 100644 (file)
@@ -18,7 +18,7 @@
 # Some targets can't call functions, so don't even bother with this
 # test.
 
-if [target_info exists gdb,cannot_call_functions] {
+if {[target_info exists gdb,cannot_call_functions]} {
     unsupported "this target can not call functions"
     continue
 }
@@ -28,7 +28,7 @@ set float_types { tf td tld }
 set complex_types { tfc tdc tldc }
 
 set compile_flags {debug}
-if [support_complex_tests] {
+if {[support_complex_tests]} {
     lappend compile_flags "additional_flags=-DTEST_COMPLEX"
     lappend compile_flags "additional_flags=-Wno-psabi"
 }
@@ -164,7 +164,7 @@ foreach ta $int_types {
     start_gdb_and_run_tests $lang $ta
 }
 
-if [support_complex_tests] {
+if {[support_complex_tests]} {
     foreach ta $complex_types {
        start_gdb_and_run_tests $lang $ta
     }
index 6b92c08ab3d936bcb4a85a7beca42754e6dba3e1..2b52d8747a1de1da04340e693364561e26f05c99 100644 (file)
@@ -127,13 +127,13 @@ proc do_test { method startup_with_shell inferior_args expected_results \
        error "invalid method $method"
     }
 
-    set argc [expr [llength $expected_results] + 1]
+    set argc [expr {[llength $expected_results] + 1}]
 
     # Now that we are stopped at main, inspect argc/argv.
     gdb_test "print argc" " = $argc"
     gdb_test "print argv\[0\]" " = $hex \"\[^\r\n\]+\""
     for { set i 1 } { $i < $argc } { incr i } {
-       set idx [expr $i - 1]
+       set idx [expr {$i - 1}]
        gdb_test "print argv\[$i\]" " = [lindex $expected_results $idx]"
     }
 }
index 9ba3a4c0bb8734874d7688d62cae089b581e4ad3..83f500b6224464e948259c50795e31c8c1c71b9c 100644 (file)
@@ -31,7 +31,7 @@ save_vars { GDBFLAGS } {
 
 gdb_test_no_output "set detach-on-fork off"
 
-if ![runto_main] {
+if {![runto_main]} {
     return
 }
 
index 2dd0fc91eb8402721111b8f7096f1d302b323de3..1e10604c3b217b6fc6cca12280e87d10288c4540 100644 (file)
@@ -22,7 +22,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug macr
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 20d28db0514b5abc4d84a2ba7a9dbfe5f80e9dce..be7a74674f641a2d86a746587f5dd3a45d009370 100644 (file)
@@ -128,7 +128,7 @@ proc expect_multiline { command expect test } {
            exp_continue
        }
        -re "^$gdb_prompt $" {
-           if $found {
+           if {$found} {
                set ok 1
            }
            # Exit the loop.
index e81b28e27a5bb533123a332f6992e2b13cc5c411..74757491776a112c2bbdf4f5067190b7c86ad33f 100644 (file)
@@ -84,7 +84,7 @@ check_info_shared "info sharedlibrary before running" 0 0
 
 # Start the inferior, and check neither of the libraries are loaded at
 # the start.
-if ![runto_main] {
+if {![runto_main]} {
     return 0
 }
 check_info_shared "info sharedlibrary #1" 0 0
index d26362de7a3e6a9ff03b2439a1207430cea4fe1a..3340c831008a51c6d682e8425af70654b236045c 100644 (file)
@@ -68,7 +68,7 @@ proc test_info_sources {args expect_seen_info_sources \
     }
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 09e99727ea79a28c6d4348c00d664b0129c2405c..aa26140f2841042ceb70c22bbd696d2c233f5eba 100644 (file)
@@ -40,7 +40,7 @@ gdb_load $binfile
 
 set solib_name [gdb_load_shlib $solib_name]
 
-if ![runto foo] {
+if {![runto foo]} {
     untested "failed to run to function foo"
     return -1
 }
@@ -148,7 +148,7 @@ proc run_info_sources { extra_args args } {
            # Make sure we handle the case where there are no source files
            # associated with a particular objfile.
            set source_list {}
-           if [info exists info_sources($objfile)] {
+           if {[info exists info_sources($objfile)]} {
                set source_list $info_sources($objfile)
            }
 
index bc70a5d772cf6675572c8070d2d6da0aa47e6cd5..90300c83d633eabd7798daa987f4a8759cbd1473 100644 (file)
@@ -51,6 +51,6 @@ gdb_test "add-symbol-file $binfile 0xffff0000" \
     "add symbol table from file \".*\" at.*\\(y or n\\) " "y"
 
 # Check if we are able to read offset adjusted line information of main
-    
+
 gdb_test "info line main" \
        "Line.*starts at address 0xffff0000.*and ends at.*"
index b909437b307577f17d9ba571af455b18d7adaf04..aa6b675cf80620cfd9fa92b50bcc3d3a454deaf4 100644 (file)
@@ -35,7 +35,7 @@ proc do_test {} {
 
     gdb_test "set follow-fork-mode child" ".*"
 
-    if ![runto "daemon_main"] {
+    if {![runto "daemon_main"]} {
        return
     }
 
index fc50bd0344d53210991420f27f880f2eaa3e2829..c09a84c7cf921ca973a9b7f89f92673bfb1cc897 100644 (file)
 
 standard_testfile
 
-if [prepare_for_testing "failed to prepare for testing" \
-    ${testfile} ${srcfile} {debug}] {
+if {[prepare_for_testing "failed to prepare for testing" \
+        ${testfile} ${srcfile} {debug}]} {
     return -1
 }
 
 # Pretend there's no terminal.
 gdb_test_no_output "set interactive-mode off"
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 756a38b00f4e93c1428479b35ae58b599f9417b9..723922c775e6b47dda87d79d210ee147b2ae4b54 100644 (file)
@@ -54,11 +54,11 @@ if { ![runto_main] } {
 
 # Poke desired values directly into inferior instead of using "set
 # args" because "set args" does not work under gdbserver.
-set count [expr [llength $jit_solibs_target] + 1]
+set count [expr {[llength $jit_solibs_target] + 1}]
 gdb_test_no_output "set var argc=$count" "forging argc"
 gdb_test_no_output "set var argv=fake_argv" "forging argv"
 for {set i 1} {$i < $count} {incr i} {
-    set jit_solib_target [lindex $jit_solibs_target [expr $i-1]]
+    set jit_solib_target [lindex $jit_solibs_target [expr {$i-1}]]
     gdb_test_no_output "set var argv\[$i\]=\"${jit_solib_target}\"" \
        "forging argv\[$i\]"
 }
@@ -124,7 +124,7 @@ set count 0
 foreach addr $symfile_addrs len $symfile_lengths {
     incr count
     set output [standard_output_file "dump-elf-solib.${count}.so"]
-    set end [expr $addr + $len]
+    set end [expr {$addr + $len}]
     gdb_test_no_output "dump binary memory $output $addr $end" \
        "dump jit solib $count"
 
@@ -141,7 +141,7 @@ foreach addr $symfile_addrs len $symfile_lengths {
     set start [format 0x%x $addr]
 
     # Calculate the end address.
-    set end [format 0x%x [expr $addr + $len]]
+    set end [format 0x%x [expr {$addr + $len}]]
 
     # This is what we expect the address range to look like in the BFD
     # filename.
index 8f16bdb9623ab7ee42f6b83e0759eda60d62613d..a709c0c3317c1bf3051a5e9b0e6a7c4f3a30ce94 100644 (file)
@@ -102,10 +102,10 @@ proc one_jit_test {solib_binfiles_target match_str} {
 
        # Poke desired values directly into inferior instead of using "set args"
        # because "set args" does not work under gdbserver.
-       gdb_test_no_output "set var argc=[expr $count + 1]" "forging argc"
+       gdb_test_no_output "set var argc=[expr {$count + 1}]" "forging argc"
        gdb_test_no_output "set var argv=fake_argv" "forging argv"
        for {set i 1} {$i <= $count} {incr i} {
-           set binfile_target [lindex $solib_binfiles_target [expr $i-1]]
+           set binfile_target [lindex $solib_binfiles_target [expr {$i-1}]]
            gdb_test_no_output "set var argv\[$i\]=\"${binfile_target}\"" \
                "forging argv\[$i\]"
        }
index 2dc67a517be10e6a631c01fb29bce111ad4303fd..2ce9c77dc6bdc0b369ab0ae169cfcb388864b198 100644 (file)
@@ -103,7 +103,7 @@ proc one_jit_test {jit_solibs_target match_str reattach} {
        gdb_test_no_output "set var argc=$count" "forging argc"
        gdb_test_no_output "set var argv=fake_argv" "forging argv"
        for {set i 1} {$i < $count} {incr i} {
-           set jit_solib_target [lindex $jit_solibs_target [expr $i-1]]
+           set jit_solib_target [lindex $jit_solibs_target [expr {$i-1}]]
            gdb_test_no_output "set var argv\[$i\]=\"${jit_solib_target}\"" \
                "forging argv\[$i\]"
        }
index f577dba31b9c6eb4883d9486570cf0fe88507467..eebab229b4060751b66e7f3dab0a864aaa58d88e 100644 (file)
@@ -126,7 +126,7 @@ proc jit_test_reread {standalone change_addr} {
        # second, gdb might not reload the executable automatically.
        sleep 1
 
-       if ${change_addr} {
+       if {${change_addr}} {
            set options "additional_flags=-DSPACER"
            if {$standalone} {
                gdb_rename_execfile $binfile ${binfile}x
@@ -155,7 +155,7 @@ proc jit_test_reread {standalone change_addr} {
            "maint info breakpoints shows jit breakpoint"
     }
 
-    if ${change_addr} {
+    if {${change_addr}} {
        gdb_assert {$addr_before != $addr_after} "address changed"
     } else {
        gdb_assert {$addr_before == $addr_after} "address didn't change"
@@ -163,7 +163,7 @@ proc jit_test_reread {standalone change_addr} {
 }
 
 foreach standalone {1 0} {
-    with_test_prefix [expr ($standalone)?"standalone":"shared"] {
+    with_test_prefix [expr {($standalone)?"standalone":"shared"}] {
        with_test_prefix "change addr" {
            jit_test_reread $standalone 1
        }
index 9ed67f8a89408c01a1646997dd21c69b5dc2327b..de0093ed9752e0d11465e54fd506fbe149530ece 100644 (file)
@@ -19,13 +19,13 @@ require can_single_step_to_signal_handler
 
 require {!target_info exists gdb,nosignals}
 
-if [prepare_for_testing "failed to prepare" ${testfile}] {
+if {[prepare_for_testing "failed to prepare" ${testfile}]} {
     return -1
 }
 
 gdb_test "handle SIGUSR1 stop print pass" "SIGUSR1\[ \t\]+Yes\[ \t\]+Yes\[ \t\]+Yes\[ \t\]+.*"
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 57ec33035299f918bad21965b0d55961064c2df9..b97d2c2cb06c4e5cdc33a57616760e15202bd079 100644 (file)
@@ -24,7 +24,7 @@ require allow_multi_inferior_tests
 standard_testfile
 set executable $testfile
 
-if [prepare_for_testing "failed to prepare" $executable] {
+if {[prepare_for_testing "failed to prepare" $executable]} {
     return -1
 }
 
index 2b367e4bd7eb15802b62ec53a00ce360c8cfbd4b..6cdbdb4eaeca014b4eeb07bebf22403b27ecaf8a 100644 (file)
@@ -49,7 +49,7 @@ proc test {cmds_after_kill} {
     clean_restart
     gdb_load $binfile
 
-    if ![runto done] {
+    if {![runto done]} {
        return
     }
 
index aa8d8e00cfa180154345d1bab58f9519bf4d1e24..ab09d8275efedbd4ad7aceacacc872345f7807bb 100644 (file)
@@ -16,7 +16,7 @@
 
 standard_testfile langs0.c langs1.c langs2.c
 
-if [is_remote host] {
+if {[is_remote host]} {
     remote_download host ${srcdir}/${subdir}/langs1.f
     remote_download host ${srcdir}/${subdir}/langs2.cxx
 }
@@ -88,7 +88,7 @@ if {[runto csub]} {
     gdb_test "show language" "currently $lang\".*" \
        "show language at main"
 
-    if [target_info exists gdb,noresults] { return }
+    if {[target_info exists gdb,noresults]} { return }
 
     gdb_continue_to_end "first session"
 }
@@ -102,7 +102,7 @@ if {[runto csub]} {
     # Also test warn-language-frame-mismatch.
     gdb_test_no_output "set warn-language-frame-mismatch off"
     gdb_test_no_output "set lang minimal" "set lang to minimal"
-    
+
     gdb_test "print x" " = 5000" "print parameter value"
 
     # Ensure this at least does not crash.
index c7b2bcbbd4d8592392ab56da03c56f087ca3e4ac..cb997cb04e11bf468c8eb546b6559b553e2d3fbd 100644 (file)
@@ -19,7 +19,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index cd628b4545e68b51357461ff65732e26c0adf2af..3b0857dac33f955428a969799602a58a82c4d1a7 100644 (file)
@@ -74,7 +74,7 @@ with_test_prefix "with standard max-value size" {
 # Set the max-value-size so we can only print 51 elements.
 set elements 51
 set int_size [get_valueof "/d" "sizeof(large_1d_array\[0\])" "*unknown*"]
-gdb_test_no_output "set max-value-size [expr $int_size * $elements]"
+gdb_test_no_output "set max-value-size [expr {$int_size * $elements}]"
 
 with_test_prefix "with reduced max-value size" {
     gdb_test "print large_1d_array" \
index cd3326da7094f0efc0353905d7e56e028fd06c99..f937b325b85b796ba60ba4763e90c7965ce772d9 100644 (file)
@@ -24,7 +24,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 2382fa534d8d7f5d80fd3a626a4697ea36541aab..61983cc33955c2bf657fedcf43fa29a86060fedd 100644 (file)
@@ -21,7 +21,7 @@
 #
 # Compiling lineinc.c with Dwarf 2 macro information will produce
 # something like this:
-# 
+#
 #     $ gcc -g3 lineinc.c -o lineinc
 #     $ readelf -wml lineinc
 #     ...
 #       4      0       0       0       lineinc3.h
 #     ...
 #     Contents of the .debug_macinfo section:
-#     
+#
 #      DW_MACINFO_start_file - lineno: 0 filenum: 1
 #      DW_MACINFO_define - lineno : 1 macro : __VERSION__ "3.2 20020903 (Red Hat Linux 8.0 3.2-7)"
-#      DW_MACINFO_define - lineno : 2 macro : __USER_LABEL_PREFIX__ 
+#      DW_MACINFO_define - lineno : 2 macro : __USER_LABEL_PREFIX__
 #     ...
 #      DW_MACINFO_define - lineno : 1 macro : __i386__ 1
 #      DW_MACINFO_define - lineno : 1 macro : __tune_i386__ 1
@@ -52,7 +52,7 @@
 #      DW_MACINFO_define - lineno : 2 macro : FOO 3
 #      DW_MACINFO_end_file
 #      DW_MACINFO_end_file
-#     $   
+#     $
 #
 # Note how the inclusions of lineinc1.h and lineinc2.h are both
 # attributed to line 10 of lineinc.c, and the #inclusion of lineinc3.h
@@ -105,7 +105,7 @@ gdb_test_multiple "break -q main" $test_name {
                 exp_continue
             }
             -re "$gdb_prompt" {
-            }                
+            }
             timeout {
                 fail "$test_name (timeout)"
             }
index cc1210e996e1394a3437cad49feaaa3af46f3bb9..e3c821d115a229abe32a179b90f2093076ca2d86 100644 (file)
@@ -48,8 +48,8 @@ proc test_list_ambiguous_symbol {symbol_line symbol} {
 
     set lineno0 [gdb_get_line_number $symbol_line $srcfile]
     set lineno1 [gdb_get_line_number $symbol_line $srcfile2]
-    set lines0_re [line_range_pattern [expr $lineno0 - 5] [expr $lineno0 + 4]]
-    set lines1_re [line_range_pattern [expr $lineno1 - 5] [expr $lineno1 + 4]]
+    set lines0_re [line_range_pattern [expr {$lineno0 - 5}] [expr {$lineno0 + 4}]]
+    set lines1_re [line_range_pattern [expr {$lineno1 - 5}] [expr {$lineno1 + 4}]]
 
     set any "\[^\r\n\]*"
     set h0_re "file: \"${any}list-ambiguous0.c\", line number: $lineno0, symbol: \"$symbol\""
index bdbb52ba0cfc39389e9704318414cf13111f4d1a..2da274276a9c5cd0a0f5dbf75231f2f8c20dfcb3 100644 (file)
@@ -44,14 +44,14 @@ proc set_listsize { arg } {
     global set_listsize_count
 
     incr set_listsize_count
-    if [gdb_test_no_output "set listsize $arg" "setting listsize to $arg #$set_listsize_count"] {
+    if {[gdb_test_no_output "set listsize $arg" "setting listsize to $arg #$set_listsize_count"]} {
        return 0
     }
     if { $arg == 0 } {
        set arg "unlimited"
     }
 
-    if [gdb_test "show listsize" "Number of source lines.* is ${arg}.*" "show listsize $arg #$set_listsize_count"] {
+    if {[gdb_test "show listsize" "Number of source lines.* is ${arg}.*" "show listsize $arg #$set_listsize_count"]} {
        return 0
     }
     return 1
@@ -68,21 +68,21 @@ proc test_listsize {} {
     # Show default size
 
     gdb_test "show listsize" "Number of source lines gdb will list by default is 10.*" "show default list size"
-    
+
     # Show the default lines
 
     gdb_test "list" "(1\[ \t\]+#include \"list0.h\".*7\[ \t\]+x = 0;\r\n.*10\[ \t\]+foo .x\[+)\]+;)" "list default lines around main"
 
     # Ensure we can limit printouts to one line
 
-    if [set_listsize 1] {
+    if {[set_listsize 1]} {
        gdb_test "list 1" "1\[ \t\]+#include \"list0.h\"" "list line 1 with listsize 1"
        gdb_test "list 2" "2\[ \t\]+" "list line 2 with listsize 1"
-    }    
+    }
 
     # Try just two lines
-    
-    if [ set_listsize 2 ] {
+
+    if {[ set_listsize 2 ]} {
        gdb_test "list 1" "1\[ \t\]+#include \"list0.h\"\r\n2\[ \t\]+" "list line 1 with listsize 2"
        gdb_test "list 2" "1\[ \t\]+#include \"list0.h\"\r\n2\[ \t\]+" "list line 2 with listsize 2"
        gdb_test "list 3" "2\[ \t\]+\r\n3\[ \t\]+int main \[)(\]+" "list line 3 with listsize 2"
@@ -90,7 +90,7 @@ proc test_listsize {} {
 
     # Try small listsize > 1 that is an odd number
 
-    if [ set_listsize 3 ] {
+    if {[ set_listsize 3 ]} {
        gdb_test "list 1" "1\[ \t\]+#include \"list0.h\".*3\[ \t\]+int main \[)(\]+" "list line 1 with listsize 3"
        gdb_test "list 2" "1\[ \t\]+#include \"list0.h\".*3\[ \t\]+int main \[)(\]+" "list line 2 with listsize 3"
        gdb_test "list 3" "2\[ \t\]+\r\n3\[ \t\]+int main \[(\]+\[)\]+\r\n4\[ \t\]+\{" "list line 3 with listsize 3"
@@ -101,7 +101,7 @@ proc test_listsize {} {
     if {[set_listsize 4]} {
        gdb_test "list 1" "1\[ \t\]+#include \"list0.h\".*4\[ \t\]+\{" "list line 1 with listsize 4"
        gdb_test "list 2" "1\[ \t\]+#include \"list0.h\".*4\[ \t\]+\{" "list line 2 with listsize 4"
-       
+
        gdb_test "list 3" "1\[ \t\]+#include \"list0.h\".*4\[ \t\]+\{" "list line 3 with listsize 4"
        gdb_test "list 4" "2\[ \t\]+\r\n.*5\[ \t\]+int x;.*" "list line 4 with listsize 4"
     }
@@ -110,7 +110,7 @@ proc test_listsize {} {
 
     if {[set_listsize 100]} {
        gdb_test "list 1" "1\[ \t\]+#include \"list0.h\".*\r\n${last_line_re}" "list line 1 with listsize 100"
-       
+
        gdb_test "list 10" "1\[ \t\]+#include \"list0.h\".*\r\n${last_line_re}" "list line 10 with listsize 100"
     }
 
@@ -182,7 +182,7 @@ proc_with_prefix test_list_forward {} {
 # Test that repeating the list linenum command doesn't print the same
 # lines over again.  Note that this test makes sure that the argument
 # linenum is dropped, when we repeat the previous command. 'x/5i $pc'
-# works the same way.  
+# works the same way.
 
 proc_with_prefix test_repeat_list_command {} {
     global last_line_re
@@ -227,8 +227,8 @@ proc test_list_range {} {
 
 #    gdb_test     "list -100,-40"      "Line number -60 out of range; .*list0.c has 39 lines." "list range; both bounds negative"
 
-    set past_end [expr ${last_line} + 10]
-    set much_past_end [expr ${past_end} + 10]
+    set past_end [expr {${last_line} + 10}]
+    set much_past_end [expr {${past_end} + 10}]
 
     gdb_test "list 30,${past_end}" "30\[ \t\]+foo \(.*\);.*${last_line_re}" "list range; upper bound past EOF"
 
@@ -323,7 +323,7 @@ proc test_list_filename_and_function {} {
     # Test some invalid specs
     # The following test takes the FIXME result on most systems using
     # DWARF.  It fails to notice that main() is not in the file requested.
-   
+
     setup_xfail "*-*-*"
 
 # Does this actually work ANYWHERE?  I believe not, as this is an `aspect' of
@@ -369,7 +369,7 @@ proc test_forward_reverse_search {} {
        # Test that GDB won't crash if the line being searched is extremely long.
 
        set oldtimeout $timeout
-       set timeout [expr "$timeout + 300"]
+       set timeout [expr {$timeout + 300}]
        verbose "Timeout is now $timeout seconds" 2
        gdb_test "search 1234" ".*1234.*" "search extremely long line (> 5000 chars)"
        set timeout $oldtimeout
index 15818734e70d0759b22bad57072d6780e8e5dda7..811140460627e1249289d1de872569d54c6b252b 100644 (file)
@@ -17,7 +17,7 @@
 
 standard_testfile
 
-if [gdb_protocol_is_native] {
+if {[gdb_protocol_is_native]} {
     unsupported "the native target does not support the load command"
     return
 }
@@ -27,11 +27,11 @@ if [gdb_protocol_is_native] {
 
 set opts {debug nopie}
 
-if [prepare_for_testing "failed to prepare" $testfile $srcfile $opts] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile $opts]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index b00d6d58c7ddd40ee7de7d66ba57a6922342c111..f924b095ca3cc0027e82e32c820627cdfaff242b 100644 (file)
@@ -49,7 +49,7 @@ proc evaluate { vars ops } {
        set var [lindex $vars $vari]
        for {set opi 0} {$opi < [llength $ops]} {incr opi} {
            set op [lindex [lindex $ops $opi] 0]
-           set val [lindex [lindex $ops $opi] [expr $vari + 1]]
+           set val [lindex [lindex $ops $opi] [expr {$vari + 1}]]
            gdb_test "print $var, $op" " = $val" "evaluate $op; variables $var; expecting $val"
        }
     }
index 8ef7c53ccbe58fcb6aff5c89950597a69b3b6489..90369f8f8241bd96ec7c83f36789e406c62bb75b 100644 (file)
@@ -32,7 +32,7 @@ require {!target_info exists gdb,noinferiorio}
 
 standard_testfile
 
-if [prepare_for_testing "failed to prepare" $testfile {} {debug}] {
+if {[prepare_for_testing "failed to prepare" $testfile {} {debug}]} {
     return -1
 }
 
index 4fbb75735507dc93abc9cc68b5b5318264b74252..2e2400b94092b868aafafa046e502d1b37062658 100644 (file)
@@ -34,7 +34,7 @@ clean_restart
 gdb_load $binfile
 
 if {![runto known_types]} {
-   return 
+   return
 }
 
 # Detect the size of the target's basic types.
@@ -53,7 +53,7 @@ set sizeof_long_double [get_sizeof "long double" 8]
 proc pat2 { n pats } {
     set i 0
     while { $n > 1 } {
-       set n [expr $n / 2]
+       set n [expr {$n / 2}]
        incr i
     }
     return [lindex $pats $i]
index 63f1356efc3a46842fa106e425a07b192dab0e3e..c275d74eed3043f013baae6947d93496aa38a658 100644 (file)
@@ -44,7 +44,7 @@ gdb_load $binfile
 #
 # If GDB complains that it doesn't have any information about
 # preprocessor macro definitions, return the string `no-macro-info'.
-# 
+#
 # If expect times out waiting for GDB, we return the string `timeout'.
 #
 # If GDB's output doesn't otherwise match what we're expecting, we
@@ -208,7 +208,7 @@ if {$macro_support == 0} {
     unsupported "skipping test because debug information does not include macro information."
     return 0
 }
+
 list_and_check_macro main WHERE {macscp1.c {before macscp1_3}}
 list_and_check_macro macscp2_2 WHERE {macscp2.h macscp1.c {before macscp2_2}}
 list_and_check_macro macscp3_2 WHERE {macscp3.h macscp1.c {before macscp3_2}}
@@ -234,10 +234,10 @@ switch -exact -- [info_macro WHERE] {
         pass "info macro WHERE after `list macscp_4_2_from_macscp2'"
     }
     {macscp4.h macscp3.h macscp1.c {before macscp4_2_..., from macscp3.h}} {
-        setup_kfail "gdb/7660" *-*-* 
+        setup_kfail "gdb/7660" *-*-*
         fail "info macro WHERE after `list macscp_4_2_from_macscp2' (gdb/7660)"
     }
-    timeout { 
+    timeout {
         fail "info macro WHERE after `list macscp_4_2_from_macscp2' (timeout)"
     }
     default { fail "info macro WHERE after `list macscp_4_2_from_macscp2'" }
@@ -249,7 +249,7 @@ switch -exact -- [info_macro WHERE] {
         pass "info macro WHERE after `list macscp_4_2_from_macscp3'"
     }
     {macscp4.h macscp2.h macscp1.c {before macscp4_2_..., from macscp2.h}} {
-        setup_kfail "gdb/7660" *-*-* 
+        setup_kfail "gdb/7660" *-*-*
         fail "info macro WHERE after `list macscp_4_2_from_macscp3' (gdb/7660)"
     }
     timeout {
@@ -360,7 +360,7 @@ for {set i 0} {$i < [llength $funcs]} {incr i} {
     if {[string compare $result $expected] == 0} {
         pass "info macro WHERE stopped in $func"
     } elseif {[string compare $result $kfail_expected] == 0} {
-        setup_kfail "gdb/7660" *-*-* 
+        setup_kfail "gdb/7660" *-*-*
         fail "info macro WHERE stopped in $func (gdb/7660)"
     } elseif {[string compare $result timeout] == 0} {
         fail "info macro WHERE stopped in $func (timeout)"
@@ -393,7 +393,7 @@ for {set i 0} {$i < [llength $funcs]} {incr i} {
                 switch -- [lindex $result end] {
                     undefined { pass $test_name }
                     timeout { fail "$test_name (timeout)" }
-                    default { 
+                    default {
                         maybe_kfail $func "$test_name"
                     }
                 }
@@ -408,7 +408,7 @@ for {set i 0} {$i < [llength $funcs]} {incr i} {
                 switch -- [lindex $result end] {
                     undefined { pass $test_name }
                     timeout { fail "$test_name (timeout)" }
-                    default { 
+                    default {
                         maybe_kfail $func "$test_name"
                     }
                 }
index 3d49b36a862d1fa825fbc0d61eecc5a7f5a678c1..fd366d61f7d9de65fd6a44f82e489db702b24f53 100644 (file)
@@ -179,7 +179,7 @@ if { $index_cache_misses == 0 && $using_index_cache } {
     set have_gdb_index 1
 }
 
-set have_psyms [expr ! ( $have_gdb_index || $readnow_p )]
+set have_psyms [expr {! ( $have_gdb_index || $readnow_p )}]
 
 #
 # this command does not produce any output
@@ -223,9 +223,9 @@ gdb_test "maint set per-command off" \
 # The timeout value is raised, because printing all the symbols and
 # statistical information about Cygwin and Windows libraries takes a lot
 # of time.
-if [istarget "*-*-cygwin*"] {
+if {[istarget "*-*-cygwin*"]} {
        set oldtimeout $timeout
-       set timeout [expr $timeout + 500]
+       set timeout [expr {$timeout + 500}]
 }
 
 set re \
@@ -288,7 +288,7 @@ gdb_test_multiple "$cmd $re" "$cmd" -lbl {
 }
 
 proc maint_pass_if {val name} {
-    if $val { pass $name } else { fail $name }
+    if {$val} { pass $name } else { fail $name }
 }
 
 maint_pass_if $header   "maint print objfiles: header"
@@ -378,7 +378,7 @@ gdb_test_multiple "maint print type argc" $msg {
     }
 }
 
-if [istarget "hppa*-*-11*"] {
+if {[istarget "hppa*-*-11*"]} {
     setup_xfail hppa*-*-*11* CLLbs14860
     gdb_test_multiple "maint print unwind &main" "maint print unwind" {
         -re ".*unwind_table_entry \\($hex\\):\r\n\tregion_start = $hex <main>\r\n\tregion_end = $hex <main\\+\[0-9\]*>\r\n\tflags = Args_stored Save_RP\r\n\tRegion_description = $hex\r\n\tEntry_FR = $hex\r\n\tEntry_GR = $hex\r\n\tTotal_frame_size = $hex\r\n$gdb_prompt $" {
@@ -391,7 +391,7 @@ if [istarget "hppa*-*-11*"] {
 }
 
 set oldtimeout $timeout
-set timeout [expr $timeout + 300]
+set timeout [expr {$timeout + 300}]
 
 set bp_location6 [gdb_get_line_number "set breakpoint 6 here"]
 
@@ -406,7 +406,7 @@ gdb_test_multiple "maint info breakpoints" "maint info breakpoints" {
 
 gdb_test "maint print" \
     "List.*unambiguous\\..*" \
-    "maint print w/o args" 
+    "maint print w/o args"
 
 gdb_test "maint info" \
     "List.*unambiguous\\..*" \
@@ -506,7 +506,7 @@ test_prefix_command_help {"maint" "maintenance"} {
 }
 
 #set oldtimeout $timeout
-#set timeout [expr $timeout + 300]
+#set timeout [expr {$timeout + 300}]
 
 gdb_test_multiple "maint dump-me" "maint dump-me" {
     -re "Should GDB dump core.*\\(y or n\\) $" {
@@ -522,7 +522,7 @@ send_gdb "maint internal-error\n"
 gdb_expect {
     -re "A problem internal to GDB has been detected" {
        pass "maint internal-error"
-       if [gdb_internal_error_resync] {
+       if {[gdb_internal_error_resync]} {
            pass "internal-error resync"
        } else {
            fail "internal-error resync"
index 1a8d6d9ad43d03deb5b3d2e678d201fdc1e6ba4f..09500b3b6a40dd3a29307db643f2cf8e82620e6c 100644 (file)
@@ -25,7 +25,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
 }
 
 set linespec ${srcfile}:[gdb_get_line_number "Break here"]
-if ![runto ${linespec}] {
+if {![runto ${linespec}]} {
     return -1
 }
 
index 4cd593cb3c7e4fcfb9831b4d1d67d46ea7328195..2951c910ef21f5da17209b96d9ed58de2757f81e 100644 (file)
@@ -39,7 +39,7 @@ with_test_prefix "before program execution" {
 
 clean_restart $testfile
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index f723d751bd0017bd6575438abbab2eb83c198660..9d2d1d29233633e63961bd24a22383b144d67199 100644 (file)
 #
 # tests for expressions with struct/array elements and mixed operator types
 # with elementary types
-# 
+#
 
 # By default, the datastructures are allocated on the stack.  For targets
 # with very small stack, that will not work.  In that case, just set
 # storage to `-DSTORAGE=static' which changes the datastructures to be
 # allocated in data segment.
 set storage "-DSTORAGE="
-if [target_info exists gdb,small_stack_section] {
+if {[target_info exists gdb,small_stack_section]} {
     set storage "-DSTORAGE=static"
 }
 
index d8da583e988713d6758c75e26fd4d6630ccd11ee..96cc15c72e6301c3a846d895e816b2d8d5a1d47b 100644 (file)
@@ -25,7 +25,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} $srcfile \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index b643f0718cbc20ea35fd94d4d5d81d53ff679ef4..d28e33f54fa61f0385893169e9c8bccd7137810a 100644 (file)
@@ -24,7 +24,7 @@ save_vars { GDBFLAGS } {
     }
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return
 }
 
index 41dc818b4296f304e99196b26a0434f2af51c9ca..fb0a99d02a0253560345038d474675817b7cf275 100644 (file)
@@ -75,7 +75,7 @@ proc test {debug} {
        }
     }
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return
     }
 
index 62e8ec1f0e16c1917620ac0f78ed36e3c09314e8..08da72e3534eb7d3de82290c9d8158fb129aee27 100644 (file)
@@ -68,7 +68,7 @@ proc test {debug} {
 
     test_break "before run"
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return
     }
 
index 5d2d22009bc11d1a0355ae4a84f53b8833cc047f..73bd1c4a93ef977d23892b58aeab7575f18d5592 100644 (file)
@@ -151,7 +151,7 @@ gdb_test "show detach-on-fork" "on." "show detach default on"
 gdb_test_no_output "set detach off" "set detach off"
 
 #
-# We will now run every fork up to the exit bp, 
+# We will now run every fork up to the exit bp,
 # eventually winding up with 16 inferiors.
 #
 
@@ -180,9 +180,9 @@ gdb_test "inferior 2" " main .*" "restart final"
 # Now we should examine all the pids.
 #
 
-# 
+#
 # Test detach inferior
-# 
+#
 
 # [assumes we're at #1]
 gdb_test "detach inferior 2" "Detaching .*" "detach 2"
@@ -190,7 +190,7 @@ gdb_test "detach inferior 3" "Detaching .*" "detach 3"
 gdb_test "detach inferior 4" "Detaching .*" "detach 4"
 gdb_test "detach inferior 5" "Detaching .*" "detach 5"
 
-# 
+#
 # Test kill inferior
 #
 
index c4450f68bfac82cdf5196fa001bd18afcf2645de..8f190177d145b79f7daf6b6b97ecdc77340717ef 100644 (file)
@@ -19,7 +19,7 @@ if {[prepare_for_testing "failed to prepare" "${testfile}" "${srcfile}"]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 7ea461a78744dee2a62ff3ae3d30e0f29ccc8ddb..9d0e873ad7ca4d3dd745c0454e21ac455f603c27 100644 (file)
@@ -24,7 +24,7 @@ standard_testfile
 
 set testcase "nested-subp1"
 
-if ![support_nested_function_tests] {
+if {![support_nested_function_tests]} {
     untested "compiler does not support nested functions"
     return -1
 }
@@ -40,7 +40,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${testcase}.c" \
 # Run until the variables we are interested in are visible.
 
 clean_restart "${testcase}"
-if ![runto_main] {
+if {![runto_main]} {
     return
 }
 
index d6c67a44b91e4d2f2f44e770c727ec40684d2d55..1846685a5d17037b0f10a6d0d8f9fef4229a1349 100644 (file)
@@ -24,7 +24,7 @@ standard_testfile
 
 set testcase "nested-subp2"
 
-if ![support_nested_function_tests] {
+if {![support_nested_function_tests]} {
     untested "compiler does not support nested functions"
     return -1
 }
@@ -49,7 +49,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${testcase}.c" \
 # Run until the variables we are interested in are visible.
 
 clean_restart "${testcase}"
-if ![runto_main] {
+if {![runto_main]} {
     return
 }
 
index f5ea4cee9e05297fd517f04c463e13e59b0e6bac..4099667fdacfbde853bcbf0552fb1c4b6309c581 100644 (file)
@@ -24,7 +24,7 @@ standard_testfile
 
 set testcase "nested-subp3"
 
-if ![support_nested_function_tests] {
+if {![support_nested_function_tests]} {
     untested "compiler does not support nested functions"
     return -1
 }
@@ -49,7 +49,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${testcase}.c" \
 # Run until the variables we are interested in are visible.
 
 clean_restart "${testcase}"
-if ![runto_main] {
+if {![runto_main]} {
     return
 }
 
index f66ddc59efef924f78005f7dbbe9aa7cd7f4a0f0..345cd3668c1af5061de6454025279d8aebe48a38 100644 (file)
@@ -81,7 +81,7 @@ proc_with_prefix do_test {} {
 
     clean_restart $testfile
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
@@ -184,14 +184,14 @@ proc_with_prefix do_test_invalid_args {} {
             "new-ui with bad interpreter name"
 
     # Test that the TUI cannot be used for a new UI.
-    if [allow_tui_tests] {
+    if {[allow_tui_tests]} {
        gdb_test "new-ui tui $extra_tty_name" \
            "interpreter 'tui' cannot be used with a new UI" \
            "new-ui with tui"
     }
 
     # Test that we can continue working normally.
-    if ![runto_main] {
+    if {![runto_main]} {
        return
     }
 }
index b839317d00a8b0bf14ed4f84d657911da942a56a..6ed428e6c74136dcc96634cbba3a7493be492076 100644 (file)
@@ -18,9 +18,9 @@
 
 standard_testfile .c
 
-if [test_compiler_info "xlc-*"] {
+if {[test_compiler_info "xlc-*"]} {
     # By default, IBM'x xlc compiler doesn't add static variables into the symtab.
-    # Use "-qstatsym" to do so. 
+    # Use "-qstatsym" to do so.
     set exec_opts additional_flags=-qstatsym
 } else {
     set exec_opts ""
@@ -42,7 +42,7 @@ gdb_load $binfile
 
 proc nodebug_runto {func} {
     with_test_prefix $func {
-       if ![runto $func] {
+       if {![runto $func]} {
            return false
        }
        gdb_test_no_output "nosharedlibrary" \
@@ -55,7 +55,7 @@ proc nodebug_runto {func} {
 # require coercion/promotion, both prototyped and unprototyped, both
 # return-type-cast style, and function-pointer-cast styles.
 proc test_call_promotion {} {
-    if [target_info exists gdb,cannot_call_functions] {
+    if {[target_info exists gdb,cannot_call_functions]} {
        return
     }
 
@@ -86,9 +86,9 @@ proc test_call_promotion {} {
 }
 
 if {[nodebug_runto inner]} {
-    
+
     # Expect to find global/local symbols in each of text/data/bss.
-    
+
     # The exact format for some of this output is not necessarily
     # ideal, particularly interpreting "p top" requires a fair bit of
     # savvy about gdb's workings and the meaning of the "{}"
@@ -100,7 +100,7 @@ if {[nodebug_runto inner]} {
     # to detect that gdb does not know the type, rather than just
     # being told they are ints or functions returning int like old
     # versions of gdb used to do.
-    
+
     # On alpha (and other ecoff systems) the native compilers put
     # out debugging info for non-aggregate return values of functions
     # even without -g, which should be accepted.
@@ -220,7 +220,7 @@ if {[nodebug_runto inner]} {
     # Check that pointer arithmetic works as expected.
     set addr1 [get_hexadecimal_valueof "&dataglobal" "*UNKNOWN*"]
     set addr2 [get_hexadecimal_valueof "(int *) &dataglobal + 1" "*UNKNOWN*"]
-    set offset [expr $addr2 - $addr1]
+    set offset [expr {$addr2 - $addr1}]
     set int_size [get_integer_valueof "sizeof (int)" "*UNKNOWN*"]
     gdb_assert { $offset == $int_size }
 
@@ -271,14 +271,14 @@ if {[nodebug_runto inner]} {
     # ever, why bother with a weaker test?
     #gdb_test "backtrace 10" "#0.*inner.*#1.*#2.*top.*#3.*main.*" \
        #    "backtrace from inner for externals"
-    
+
     # This test is not as obscure as it might look.  `p getenv ("TERM")'
     # is a real-world example, at least on many systems.
     foreach cmd {"p/c" "ptype" "whatis"} {
        gdb_test "$cmd array_index(\"abcdef\",2)" \
            "'array_index' has unknown return type; cast the call to its declared return type"
     }
-    if [target_info exists gdb,cannot_call_functions] {
+    if {[target_info exists gdb,cannot_call_functions]} {
        unsupported "p/c (int) array_index(\"abcdef\",2)"
     } else {
        # We need to up this because this can be really slow on some boards.
index 43b23530e32d6f6f77f1559e4bdcd1f43b623736..2da0a400fc1145ddeaa1b0f84f770db76c0fff05 100644 (file)
@@ -15,7 +15,7 @@
 
 standard_testfile
 
-if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug}] {
+if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug}]} {
     return -1
 }
 
index e6537497550ef87fb3534a9887619506776385a4..e6f8117d4bb1cdac393c3595351602b9a5a7471d 100644 (file)
@@ -15,7 +15,7 @@
 
 standard_testfile
 
-if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug}] {
+if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug}]} {
     return -1
 }
 
index 8dcefcf276ec1be90a38797fdf6616211521cffd..826fbd9727a9b61b4b6f4f52c7a09a1a7fe105f9 100644 (file)
@@ -34,13 +34,15 @@ foreach_with_prefix pie { "nopie" "pie" } {
     set binfile [standard_output_file $testfile-$pie]
 
     set board [target_info name]
-    if [board_info $board exists mathlib] {
+    if {[board_info $board exists mathlib]} {
        set mathlib [board_info $dest mathlib]
        set_board_info mathlib ""
+       # tclint-disable-next-line command-args
        set err [eval $compile]
        set_board_info mathlib $mathlib
     } else {
        set_board_info mathlib ""
+       # tclint-disable-next-line command-args
        set err [eval $compile]
        unset_board_info mathlib
     }
index 548f2a4d3f8975f8c0d1d3e204bbae30c418575b..3193ed9146a74dbaf1697ac3cb9b9d4142924d3f 100644 (file)
@@ -35,7 +35,7 @@ gdb_test_multiple "print &big_struct.second" "$test" {
     -re "\\$\[0-9\]* = .* (0x\[0-9a-fA-F\]*) .*\[\r\n\]*$gdb_prompt $" {
        set addr2 $expect_out(1,string)
 
-       if {[expr $addr2 - $addr1] == [expr 0x10000000 + 16]} {
+       if {[expr {$addr2 - $addr1}] == [expr {0x10000000 + 16}]} {
            pass "big offsets"
        } else {
            fail "big offsets"
index 9a5364a025a170deea53168471190ec8268d0569..c010fb899b832e5a2ca5b8580338de71626f919c 100644 (file)
@@ -110,7 +110,7 @@ gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 
 # Run to main, where struct foo is incomplete.
-if ![runto_main] {
+if {![runto_main]} {
     return
 }
 
@@ -160,7 +160,7 @@ gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 
 # Run to getfoo, where struct foo is complete.
-if ![runto getfoo] {
+if {![runto getfoo]} {
     perror "cannot run to breakpoint at getfoo"
 }
 
index 8ac9f4ee755182f17292efeea450cf6d86c2344f..067f55e149f072bd00c6cb26369a83d9d725c51e 100644 (file)
@@ -208,7 +208,7 @@ proc_with_prefix test-print {{prefix ""}} {
     clean_restart
     gdb_load $binfile
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return
     }
 
@@ -321,7 +321,7 @@ proc_with_prefix test-backtrace {} {
     clean_restart
     gdb_load $binfile
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return
     }
 
@@ -1163,7 +1163,7 @@ foreach prefix {
 # Same for "compile print".  Not really a wrapper prefix command like
 # "frame apply", but similar enough that we test pretty much the same
 # things.
-if ![skip_compile_feature_tests] {
+if {![skip_compile_feature_tests]} {
     test-print "compile "
 }
 
index 0aa94f940183c8bea6a88fd1b721c706aaa01585..8e7e0c0ab70d72dbf957c4fc64148b0f194b0c61 100644 (file)
@@ -1,5 +1,5 @@
 # Copyright 1997-2025 Free Software Foundation, Inc.
-# 
+#
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 3 of the License, or
@@ -64,7 +64,7 @@ proc get_func_address { func func_sym msg } {
     global hexx
 
     set func_addr 0
-    send_gdb "print $func\n" 
+    send_gdb "print $func\n"
     gdb_expect {
        -re "\\$\[0-9\]+ = $fptrcast (${hexx}) <$func_sym>.*$gdb_prompt $" {
            set func_addr $expect_out(1,string)
@@ -99,39 +99,39 @@ if {$data_overlays} {
 # map each overlay successively, and
 # capture the VMA addresses of [foo bar baz grbx foox barx bazx grbxx]
 
-gdb_test "overlay map .ovly0" "" 
+gdb_test "overlay map .ovly0" ""
 gdb_test "overlay list" "Section .ovly0, loaded at.*, mapped at.*" "list ovly0"
 set foo_vma [get_func_address "foo"  "foo"  "foo  runtime address"]
 
-gdb_test "overlay map .ovly1" "" 
+gdb_test "overlay map .ovly1" ""
 gdb_test "overlay list" "Section .ovly1, loaded at.*, mapped at.*" "list ovly1"
 set bar_vma [get_func_address "bar"  "bar"  "bar  runtime address"]
 
-gdb_test "overlay map .ovly2" "" 
+gdb_test "overlay map .ovly2" ""
 gdb_test "overlay list" "Section .ovly2, loaded at.*, mapped at.*" "list ovly2"
 set baz_vma [get_func_address "baz"  "baz"  "baz  runtime address"]
 
-gdb_test "overlay map .ovly3" "" 
+gdb_test "overlay map .ovly3" ""
 gdb_test "overlay list" "Section .ovly3, loaded at.*, mapped at.*" "list ovly3"
 set grbx_vma [get_func_address "grbx" "grbx" "grbx runtime address"]
 
 if {$data_overlays} {
-    gdb_test "overlay map .data00" "" 
+    gdb_test "overlay map .data00" ""
     gdb_test "overlay list" "Section .data00, loaded .*, mapped .*" "list data00"
     gdb_test "print \$foox_vma = &foox" \
        ".* $iptrcast 0x.*"  "foox runtime addr"
 
-    gdb_test "overlay map .data01" "" 
+    gdb_test "overlay map .data01" ""
     gdb_test "overlay list" "Section .data01, loaded .*, mapped .*" "list data01"
     gdb_test "print \$barx_vma = &barx" \
        ".* $iptrcast 0x.*"  "barx runtime addr"
 
-    gdb_test "overlay map .data02" "" 
+    gdb_test "overlay map .data02" ""
     gdb_test "overlay list" "Section .data02, loaded .*, mapped .*" "list data02"
     gdb_test "print \$bazx_vma = &bazx" \
        ".* $iptrcast 0x.*"  "bazx runtime addr"
 
-    gdb_test "overlay map .data03" "" 
+    gdb_test "overlay map .data03" ""
     gdb_test "overlay list" "Section .data03, loaded .*, mapped .*" "list data03"
     gdb_test "print \$grbxx_vma = &grbxx" \
        ".* $iptrcast 0x.*"  "grbxx runtime addr"
@@ -149,7 +149,7 @@ if {$data_overlays} {
     gdb_test "print \$grbxx_lma != \$grbxx_vma" ".* = 1" "grbxx's LMA != VMA"
 }
 
-# Verify that early-mapped overlays have been bumped out 
+# Verify that early-mapped overlays have been bumped out
 # by later-mapped overlays laid over in the same VMA range.
 
 send_gdb "overlay list\n"
index 430bda3d9dff58beba3cdd9c65fc6876a205757e..8f971c8c4a50be586ec7939338c6f916bb99f346 100644 (file)
@@ -23,7 +23,7 @@ if {[build_executable "failed to prepare" $testfile $srcfile debug] == -1} {
 }
 
 set file_arg $binfile
-if [is_remote host] {
+if {[is_remote host]} {
   set file_arg [remote_download host $file_arg]
 }
 
@@ -176,7 +176,7 @@ save_vars { INTERNAL_GDBFLAGS } {
 
     if {[probe_can_run_cmdline] > 0} {
        test_fg_execution_pagination_return
-       if ![target_info exists gdb,nointerrupts] {
+       if {![target_info exists gdb,nointerrupts]} {
            test_fg_execution_pagination_cancel "ctrl-c"
        }
        test_fg_execution_pagination_cancel "quit"
index 14ccd8e6ed2b05602b0f781db3b70018e6e643c4..7f6e37f3f958d5ba7c6ff97112f8543a09cc8690 100644 (file)
@@ -48,21 +48,21 @@ proc fits_in_type { n type_bits type_signedness } {
 
     if { $n < 0} {
        set n_sign -1
-       set n [expr -$n]
+       set n [expr {-$n}]
     } else {
        set n_sign 1
     }
 
-    set smax [expr 1 << ($type_bits - 1)];
+    set smax [expr {1 << ($type_bits - 1)}];
     if  { $n_sign == -1 } {
        # Negative number, signed type.
-       return [expr ($n <= $smax)]
+       return [expr {($n <= $smax)}]
     } elseif { $n_sign == 1 && $type_signed_p } {
        # Positive number, signed type.
-       return [expr ($n < $smax)]
+       return [expr {($n < $smax)}]
     } elseif { $n_sign == 1 && !$type_signed_p } {
        # Positive number, unsigned type.
-       return [expr ($n >> $type_bits) == 0]
+       return [expr {($n >> $type_bits) == 0}]
     } else {
        error "unreachable"
     }
@@ -99,9 +99,9 @@ proc parse_number { lang n } {
     }
 
     global sizeof_long_long sizeof_long sizeof_int
-    set long_long_bits [expr $sizeof_long_long * 8]
-    set long_bits [expr $sizeof_long * 8]
-    set int_bits [expr $sizeof_int * 8]
+    set long_long_bits [expr {$sizeof_long_long * 8}]
+    set long_bits [expr {$sizeof_long * 8}]
+    set int_bits [expr {$sizeof_int * 8}]
 
     if { $lang == "rust" } {
        if { [fits_in_type $n 32 s] } {
@@ -303,7 +303,7 @@ proc test_parse_numbers {arch} {
        foreach_with_prefix prefix $prefixes {
            foreach baseval $basevals {
                foreach offset { -2 -1 0 1 2 } {
-                   set dec_val [expr $baseval + $offset]
+                   set dec_val [expr {$baseval + $offset}]
                    set hex_val [format "0x%llx" $dec_val]
                    if { $dec_val < 0 } {
                        continue
index 150adbe50ce42bb338f87dd726b2eebf84c2b9ba..fc1820a2efcb757f3978b1b83b40b8687caed6a5 100644 (file)
@@ -103,8 +103,8 @@ gdb_test "info break" \
 "pending plus real breakpoint info"
 
 
-# 
-# Test not setting a pending breakpoint 
+#
+# Test not setting a pending breakpoint
 #
 gdb_test "break pendfunc2" \
     "" \
@@ -113,7 +113,7 @@ gdb_test "break pendfunc2" \
     "n"
 
 #
-# Add condition to pending breakpoint 
+# Add condition to pending breakpoint
 #
 
 gdb_test_no_output "condition 1 k == 1"
index d26aa6235e2c497fc29a98d9e0704caa5d4a1d35..0400a9909f8e99d8cfc204b6561b4aef0d3c841c 100644 (file)
@@ -49,7 +49,7 @@ clean_restart ${executable1}
 
 gdb_test_no_output "set args ${binfile2}" "set args ${binfile2_test_msg}"
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
@@ -113,7 +113,7 @@ verbose -log "addr2 is $addr2"
 
 # Ensure we cannot get a false PASS and the inferior has really changed.
 set test "pie_execl_marker address has changed"
-if [string equal $addr1 $addr2] {
+if {[string equal $addr1 $addr2]} {
     fail $test
 } else {
     pass $test
index 9d232c83592747bd9a81739934876e1fec1d4180..fcc6ad4f0d1622c287ce7455205fe89b43ccbe9c 100644 (file)
@@ -22,7 +22,7 @@ standard_testfile
 
 set opts [list debug pie]
 
-if [build_executable "failed to prepare" $testfile $srcfile $opts] {
+if {[build_executable "failed to prepare" $testfile $srcfile $opts]} {
     return
 }
 
@@ -32,7 +32,7 @@ proc setup_test {detach_on_fork {follow_fork_mode "parent"}} {
     clean_restart
     gdb_load $binfile
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return
     }
 
index 4d4d58ed881697e50e43ee13546c25fb8b2b2b11..9895a2f5209f5a21756083bef99b1c4371700807 100644 (file)
@@ -19,7 +19,7 @@
 #
 # tests for pointer arithmetic and pointer dereferencing
 # with integer type variables and pointers to integers
-# 
+#
 
 #
 # test running programs
@@ -65,7 +65,7 @@ gdb_test "next " "more_code.*;" "continuing after dummy()"
 #        pass "illegal pointer assignment rejected"
 #      }
 #    -re ".*$gdb_prompt $" { fail "illegal pointer assignment rejected" }
-#    timeout           { fail "(timeout) illegal pointer assignment rejected" }    
+#    timeout           { fail "(timeout) illegal pointer assignment rejected" }
 #  }
 
 
@@ -75,7 +75,7 @@ gdb_test "next " "more_code.*;" "continuing after dummy()"
 #        pass "illegal pointer assignment rejected"
 #      }
 #    -re ".*$gdb_prompt $" { fail "illegal pointer assignment rejected" }
-#    timeout           { fail "(timeout) ilegal pointer assignment rejected" }    
+#    timeout           { fail "(timeout) ilegal pointer assignment rejected" }
 #  }
 
 #send_gdb "print v_unsigned_int_pointer == v_double_pointer\n"
@@ -84,7 +84,7 @@ gdb_test "next " "more_code.*;" "continuing after dummy()"
 #        pass "illegal pointer operation (+) rejected"
 #      }
 #    -re ".*$gdb_prompt $" { fail "illegal pointer operation (+) rejected" }
-#    timeout           { fail "(timeout) illegal pointer operation (+) rejected" }    
+#    timeout           { fail "(timeout) illegal pointer operation (+) rejected" }
 #  }
 
 
@@ -94,7 +94,7 @@ gdb_test "next " "more_code.*;" "continuing after dummy()"
 #        pass "illegal pointer operation (*) rejected"
 #      }
 #    -re ".*$gdb_prompt $" { fail "illegal pointer operation (*) rejected" }
-#    timeout           { fail "(timeout) illegal pointer operation (*) rejected" }    
+#    timeout           { fail "(timeout) illegal pointer operation (*) rejected" }
 #  }
 
 
@@ -104,7 +104,7 @@ gdb_test "next " "more_code.*;" "continuing after dummy()"
 #        pass "ilegal pointer assignment rejected"
 #      }
 #    -re ".*$gdb_prompt $" { fail "illegal pointer assignment rejected" }
-#    timeout           { fail "(timeout) illegal pointer assignment rejected" }    
+#    timeout           { fail "(timeout) illegal pointer assignment rejected" }
 #  }
 
 
@@ -114,7 +114,7 @@ gdb_test "next " "more_code.*;" "continuing after dummy()"
 #        pass "illegal pointer assignment rejected"
 #      }
 #    -re ".*$gdb_prompt $" { fail "illegal pointer assignment rejected" }
-#    timeout           { fail "(timeout) illegal pointer assignment rejected" }    
+#    timeout           { fail "(timeout) illegal pointer assignment rejected" }
 #  }
 
 gdb_test_no_output "set variable v_int_pointer=&v_int_array\[0\]" \
@@ -203,9 +203,9 @@ gdb_test "print *( *(matrix+1) +2)" " = 5" \
 gdb_test "print **ptr_to_ptr_to_float" " = 100" \
     "print through ptr to ptr"
 
-# tests for pointers 
+# tests for pointers
 # with elementary type variables and pointers.
-# 
+#
 
 gdb_test "break marker1" ".*" ""
 gdb_test "cont" "Break.* marker1 \\(\\) at .*:$decimal.*" \
@@ -221,7 +221,7 @@ gdb_test "print *pS" " = -14" "print value of *pS"
 gdb_test_multiple "ptype pS" "ptype pS" {
     -re "type = short \\*.*$gdb_prompt $"  { pass "ptype pS" }
     -re "type = short int \\*.*$gdb_prompt $"  { pass "ptype pS" }
-}    
+}
 
 gdb_test "print *pUS" " = 7" "print value of *pUS"
 
index dfb8f9b5d427192b7aa5429590e0d5acd8a0c62e..a6d8a832755237164393f841de898a1080a17023 100644 (file)
@@ -22,7 +22,7 @@ if {[build_executable ${testname}.exp $testname $sources {debug}] == -1} {
 
 clean_restart ${testname}
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 5dd4cdc46b0424209dd1d99b35d2512ea3fddcf3..73380bb45bc553740199c35b738cbf83a5779ab5 100644 (file)
@@ -43,13 +43,13 @@ if {$prelink_args == ""} {
 }
 
 set test "split debug of executable"
-if [gdb_gnu_strip_debug $binfile] {
+if {[gdb_gnu_strip_debug $binfile]} {
     fail $test
 } else {
     pass $test
 }
 
-if ![prelink_yes $prelink_args] {
+if {![prelink_yes $prelink_args]} {
     # Maybe we don't have prelink.
     return -1
 }
@@ -57,10 +57,10 @@ if ![prelink_yes $prelink_args] {
 set found 0
 set coredir "[standard_output_file coredir.[getpid]]"
 file mkdir $coredir
-catch "system \"(cd ${coredir}; ulimit -c unlimited; ${binfile}; true) >/dev/null 2>&1\""
+catch {system "(cd ${coredir}; ulimit -c unlimited; ${binfile}; true) >/dev/null 2>&1"}
 
 foreach i "${coredir}/core ${coredir}/core.coremaker.c ${binfile}.core" {
-    if [remote_file build exists $i] {
+    if {[remote_file build exists $i]} {
        remote_exec build "mv $i [standard_output_file prelink.core]"
        set found 1
     }
@@ -85,7 +85,7 @@ if { $found == 0  } {
 }
 
 # Relink $libfile to a different address.
-if ![prelink_yes $prelink_args] {
+if {![prelink_yes $prelink_args]} {
     return -1
 }
 
index e512d199afa035b18af8c77c3576e23e35c9bc20..1e93ea7a8b801eaf6fe0df47a362941b92270656 100644 (file)
@@ -22,7 +22,7 @@ if {[prepare_for_testing $testfile.exp $testfile $srcfile debug]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 8b60d1399b7c7c90626a7b15c552a2bd163d8e8f..8533481772bfad3e1e398436978939f77e3369f5 100644 (file)
@@ -22,7 +22,7 @@ if {[prepare_for_testing $testfile.exp $testfile $srcfile debug]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index a9d30643b227f802ddce4a34ce3967fc3edc8bff..d4866ad7c7a83a7af88b5afd8269b09c7d03cbd5 100644 (file)
@@ -81,7 +81,7 @@ proc test {hidden dlopen version_id_main lang} {
     gdb_load_shlib $libobj1
     gdb_locate_shlib $libobj2
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
@@ -129,7 +129,7 @@ proc test {hidden dlopen version_id_main lang} {
        }
     }
 
-    if $version_id_main {
+    if {$version_id_main} {
        compare "'print-file-var-main.c'::this_version_id" "vm"
        compare "this_version_id" "vm"
     }
index 156fb80c28fdab55e7d017050c9230f3d8751620..ddfaaefe8a4097adb22731020a29ecf9c5a40a7a 100644 (file)
@@ -27,7 +27,7 @@ if {![runto_main]} {
     return 0
 }
 
-if [allow_python_tests] {
+if {[allow_python_tests]} {
     # The $_as_string convenience function is implemented in Python.
     gdb_test {printf "%s\n", $_as_string("aabbcc")} "\"aabbcc\""
 
index 91e818b179d7b6563d373a72eef5f26e2f8431f5..695a3d2c894c1ee589b4a7e1a099ffbce072415d 100644 (file)
@@ -39,7 +39,7 @@ clean_restart
 gdb_load $binfile
 gdb_load_shlib ${binfile_lib}
 
-if ![runto lib] {
+if {![runto lib]} {
     return -1
 }
 
@@ -97,7 +97,7 @@ proc test_load_shlib { print_symbol_loading } {
     with_test_prefix "shlib ${print_symbol_loading}" {
        clean_restart
        gdb_load $binfile
-       if ![runto_main] {
+       if {![runto_main]} {
            return -1
        }
 
index 8634668605a4aa74bddd726180571a87b03ff842..0165791e3d90bf3cd86cfaca8e828a8e1fb36120 100644 (file)
@@ -96,18 +96,18 @@ proc test_integer_literals_rejected {} {
 
     # Test various octal values.
 
-    test_print_reject "p 09" 
-    test_print_reject "p 079" 
+    test_print_reject "p 09"
+    test_print_reject "p 079"
 
     # Test various hexadecimal values.
 
-    test_print_reject "p 0xG" 
-    test_print_reject "p 0xAG" 
+    test_print_reject "p 0xG"
+    test_print_reject "p 0xAG"
 
     # Test various binary values.
 
-    test_print_reject "p 0b2" 
-    test_print_reject "p 0b12" 
+    test_print_reject "p 0b2"
+    test_print_reject "p 0b12"
 }
 
 proc test_float_accepted {} {
@@ -458,14 +458,14 @@ proc test_print_repeats_10_one { setting } {
     for { set x 1 } { $x <= 16 } { incr x } {
        gdb_test_no_output "set print $setting $x" "$setting $x repeats"
        for { set e 1 } { $e <= 16 } {incr e } {
-           set v [expr $e - 1]
+           set v [expr {$e - 1}]
            set command "p &ctable2\[${v}*16\]"
            if { $x < $e } {
                set aval $x
            } else {
                set aval $e
            }
-           set xval [expr $x - $e]
+           set xval [expr {$x - $e}]
            if { $xval < 0 } {
                set xval 0
            }
@@ -703,7 +703,7 @@ proc test_artificial_arrays {} {
     # for the test because that character isn't recognized as an
     # escape character.
     set ctrlv "\026"
-    if [ishost *-*-mingw*] {
+    if {[ishost *-*-mingw*]} {
        set ctrlv ""
     }
     gdb_test_escape_braces "p int1dim\[0\]${ctrlv}@2" " = {0, 1}" {p int1dim[0]@2}
@@ -797,7 +797,7 @@ proc test_print_string_constants {} {
 
     gdb_test_no_output "set print elements 50"
 
-    if [target_info exists gdb,cannot_call_functions] {
+    if {[target_info exists gdb,cannot_call_functions]} {
        unsupported "this target can not call functions"
        return
     }
@@ -821,7 +821,7 @@ proc test_print_string_constants {} {
 proc test_print_array_constants {} {
     global hex
 
-    if [target_info exists gdb,cannot_call_functions] {
+    if {[target_info exists gdb,cannot_call_functions]} {
        unsupported "this target can not call functions"
        return
     }
@@ -1028,7 +1028,7 @@ proc test_print_symbol {} {
     gdb_test_no_output "set print symbol off"
 }
 
-# Escape a left curly brace to prevent it from being interpreted as 
+# Escape a left curly brace to prevent it from being interpreted as
 # the beginning of a bound
 proc gdb_test_escape_braces { args } {
 
index 8bffb26336a6fa4f7c978419483c10d86213859d..f7bdf084c447ddf27e6f209f874381012b151f85 100644 (file)
@@ -25,7 +25,7 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
 clean_restart
 gdb_load $binfile
 
-if ![runto marker1] {
+if {![runto marker1]} {
     untested "couldn't run to marker1"
 }
 
index 04d2d2b0234fb7b9869d401c9497d5144e320a11..25dd4c912e44b978cc0e7ba849b2ba931ddc35ee 100644 (file)
@@ -51,7 +51,7 @@ gdb_test_multiple "ptype red1" "ptype unnamed enumeration member" {
 # Here and elsewhere, we accept
 # "long", "long int", or "int" for long variables (whatis.exp already
 # has an XFAIL for "int" (Sun cc bug), so no need to fail it here).
-gdb_test "ptype struct t_struct" "type = struct t_struct \{.*\[\r\n\]    (unsigned |)char v_char_member;.*\[\r\n\]    (short|short int) v_short_member;.*\[\r\n\]    int v_int_member;.*\[\r\n\]    (long|long int|int) v_long_member;.*\[\r\n\]    float v_float_member;.*\[\r\n\]    double v_double_member;.*\[\r\n\]\}.*" "ptype structure" 
+gdb_test "ptype struct t_struct" "type = struct t_struct \{.*\[\r\n\]    (unsigned |)char v_char_member;.*\[\r\n\]    (short|short int) v_short_member;.*\[\r\n\]    int v_int_member;.*\[\r\n\]    (long|long int|int) v_long_member;.*\[\r\n\]    float v_float_member;.*\[\r\n\]    double v_double_member;.*\[\r\n\]\}.*" "ptype structure"
 
 
 # Test the equivalence between '.' and '->' for struct member references.
@@ -73,30 +73,30 @@ if {[gdb_test "ptype v_t_struct_p->v_float_member" "type = float"] < 0} {
 # IBM's xlc puts out bogus stabs--the stuff field is type 42,
 # which isn't defined.
 
-gdb_test "ptype struct link" "type = struct link \{\[\r\n\]+\[ \t\]+struct link \\*next;\[\r\n\]+\[ \t\]+struct link \\*\\(\\*linkfunc\\)\\((struct link \\*, int|void|)\\);\[\r\n\]+\[ \t\]+struct t_struct stuff.1..2..3.;\[\r\n\]+\}.*" "ptype linked list structure" 
+gdb_test "ptype struct link" "type = struct link \{\[\r\n\]+\[ \t\]+struct link \\*next;\[\r\n\]+\[ \t\]+struct link \\*\\(\\*linkfunc\\)\\((struct link \\*, int|void|)\\);\[\r\n\]+\[ \t\]+struct t_struct stuff.1..2..3.;\[\r\n\]+\}.*" "ptype linked list structure"
 
 #
 # test ptype command with unions
 #
-gdb_test "ptype union t_union" "type = union t_union \{.*\[\r\n\]    (unsigned |)char v_char_member;.*\[\r\n\]    (short|short int) v_short_member;.*\[\r\n\]    int v_int_member;.*\[\r\n\]    (long|long int|int) v_long_member;.*\[\r\n\]    float v_float_member;.*\[\r\n\]    double v_double_member;.*\[\r\n\]\}.*" "ptype union" 
+gdb_test "ptype union t_union" "type = union t_union \{.*\[\r\n\]    (unsigned |)char v_char_member;.*\[\r\n\]    (short|short int) v_short_member;.*\[\r\n\]    int v_int_member;.*\[\r\n\]    (long|long int|int) v_long_member;.*\[\r\n\]    float v_float_member;.*\[\r\n\]    double v_double_member;.*\[\r\n\]\}.*" "ptype union"
 
 # IBM's xlc puts out bogus stabs--the stuff field is type 42,
 # which isn't defined.
-gdb_test "ptype union tu_link" "type = union tu_link \{\[\r\n\]+\[ \t\]+struct link \\*next;\[\r\n\]+\[ \t\]+struct link \\*\\(\\*linkfunc\\)\\((struct link \\*, int|void|)\\);\[\r\n\]+\[ \t\]+struct t_struct stuff.1..2..3.;\[\r\n\]+\}.*" "ptype linked list union" 
+gdb_test "ptype union tu_link" "type = union tu_link \{\[\r\n\]+\[ \t\]+struct link \\*next;\[\r\n\]+\[ \t\]+struct link \\*\\(\\*linkfunc\\)\\((struct link \\*, int|void|)\\);\[\r\n\]+\[ \t\]+struct t_struct stuff.1..2..3.;\[\r\n\]+\}.*" "ptype linked list union"
 
 #
 # test ptype command with enums
 #
 
-gdb_test "ptype primary" "type = enum .red, green, blue.*" "ptype unnamed enumeration" 
+gdb_test "ptype primary" "type = enum .red, green, blue.*" "ptype unnamed enumeration"
 
-gdb_test "ptype enum colors" "type = enum colors \{yellow, purple, pink\}.*" "ptype named enumeration" 
+gdb_test "ptype enum colors" "type = enum colors \{yellow, purple, pink\}.*" "ptype named enumeration"
 
 
 #
 # test ptype command with enums as typedef
 #
-gdb_test "ptype boolean" "type = enum (boolean |)\{FALSE, TRUE\}.*" "ptype unnamed typedef'd enumeration" 
+gdb_test "ptype boolean" "type = enum (boolean |)\{FALSE, TRUE\}.*" "ptype unnamed typedef'd enumeration"
 
 # And check that whatis shows the name, not "enum {...}".
 # This probably fails for all DWARF 1 cases, so assume so for now. -fnf
@@ -132,20 +132,20 @@ gdb_test "ptype enum bvals" "type = enum bvals \{my_false, my_true\}.*" "ptype n
 #
 # test ptype command with out-of-order enum values
 #
-gdb_test "ptype enum misordered" "type = enum misordered \{two = 2, one = 1, zero = 0, three = 3\}.*" "ptype misordered enumeration" 
+gdb_test "ptype enum misordered" "type = enum misordered \{two = 2, one = 1, zero = 0, three = 3\}.*" "ptype misordered enumeration"
 
 #
 # test ptype command with a named enum's value
 #
-gdb_test "ptype three" "type = enum misordered \{two = 2, one = 1, zero = 0, three = 3\}.*" "ptype named enumeration member" 
+gdb_test "ptype three" "type = enum misordered \{two = 2, one = 1, zero = 0, three = 3\}.*" "ptype named enumeration member"
 
-gdb_test "ptype red" "type = enum \{red, green, blue\}.*" "ptype unnamed enumeration member #2" 
+gdb_test "ptype red" "type = enum \{red, green, blue\}.*" "ptype unnamed enumeration member #2"
 
 #
 # test ptype command with basic C types
 #
 # I've commented most of this out because it duplicates tests in whatis.exp.
-# I've just left in a token test or 2 which is designed to test that ptype 
+# I've just left in a token test or 2 which is designed to test that ptype
 # acts like whatis for basic types.  If it is thought to be necessary to
 # test both whatis and ptype for all the types, the tests should be
 # merged into whatis.exp, or else maintenance will be a royal pain -kingdon
@@ -174,7 +174,7 @@ gdb_test "ptype red" "type = enum \{red, green, blue\}.*" "ptype unnamed enumera
 #    timeout           { fail "(timeout) ptype unsigned char" }
 #}
 
-gdb_test "ptype v_short" "type = short(| int).*" "ptype short" 
+gdb_test "ptype v_short" "type = short(| int).*" "ptype short"
 
 #send "ptype v_signed_short\n"
 #gdb_expect {
@@ -192,7 +192,7 @@ gdb_test "ptype v_short" "type = short(| int).*" "ptype short"
 #}
 
 
-gdb_test "ptype v_int" "type = int.*" "ptype int" 
+gdb_test "ptype v_int" "type = int.*" "ptype int"
 
 #send "ptype v_signed_int\n"
 #gdb_expect {
@@ -306,7 +306,7 @@ gdb_test "ptype v_int" "type = int.*" "ptype int"
 #
 #send "ptype v_long_array\n"
 #gdb_expect {
-#    -re "type = (long|int|long int) .2..*$gdb_prompt $"       { 
+#    -re "type = (long|int|long int) .2..*$gdb_prompt $"       {
 #      pass "ptype long array" }
 #    -re ".*$gdb_prompt $"     { fail "ptype long array" }
 #    timeout           { fail "(timeout) ptype long array" }
@@ -315,7 +315,7 @@ gdb_test "ptype v_int" "type = int.*" "ptype int"
 #
 #send "ptype v_signed_long_array\n"
 #gdb_expect {
-#    -re "type = (long|int|long int) .2..*$gdb_prompt $"       { 
+#    -re "type = (long|int|long int) .2..*$gdb_prompt $"       {
 #      pass "ptype signed long array" }
 #    -re ".*$gdb_prompt $"     { fail "ptype signed long array" }
 #    timeout           { fail "(timeout) ptype signed long array" }
@@ -585,7 +585,7 @@ gdb_test "ptype foo" "type = char" "ptype foo typedef after second list of charf
 
 if {[runto_main]} {
 
-  if [target_info exists gdb,cannot_call_functions] {
+  if {[target_info exists gdb,cannot_call_functions]} {
     unsupported "this target can not call functions"
     return
   }
index 0d32baa7eed9d2584f210932f21e9b66c14b78fe..eeeb9bb6169299149b114103db7c479674a3f919 100644 (file)
@@ -59,20 +59,20 @@ proc test_input_radix { iradix iradixhex iradixoctal } {
     test_one_input $iradix  "-1"          "-1"
 
     # test simple two-digit constants
-    test_one_input $iradix "10"          [expr $iradix]
-    test_one_input $iradix "11"          [expr $iradix + 1]
-    test_one_input $iradix "-10"         [expr 0 - $iradix]
-    test_one_input $iradix "-11"         [expr 0 - $iradix - 1]
+    test_one_input $iradix "10"          [expr {$iradix}]
+    test_one_input $iradix "11"          [expr {$iradix + 1}]
+    test_one_input $iradix "-10"         [expr {0 - $iradix}]
+    test_one_input $iradix "-11"         [expr {0 - $iradix - 1}]
 
     # test simple three-digit constants
-    test_one_input $iradix "100"         [expr $iradix * $iradix]
-    test_one_input $iradix "101"         [expr $iradix * $iradix + 1]
-    test_one_input $iradix "-100"        [expr 0 - $iradix * $iradix]
-    test_one_input $iradix "-101"        [expr 0 - $iradix * $iradix - 1]
+    test_one_input $iradix "100"         [expr {$iradix * $iradix}]
+    test_one_input $iradix "101"         [expr {$iradix * $iradix + 1}]
+    test_one_input $iradix "-100"        [expr {0 - $iradix * $iradix}]
+    test_one_input $iradix "-101"        [expr {0 - $iradix * $iradix - 1}]
 
     # test a five-digit constant
     test_one_input $iradix  "10101"      \
-       [expr $iradix * $iradix * $iradix * $iradix + $iradix * $iradix + 1]
+       [expr {$iradix * $iradix * $iradix * $iradix + $iradix * $iradix + 1}]
 }
 
 test_input_radix 2 "2" "2"
index 63bff21dd1d0e30d1c9dcf897b782187ed01cbec..5a7b08915964705c63c4686701efdfae0c5cca09 100644 (file)
@@ -60,7 +60,7 @@ gdb_test "show disable-randomization"       \
 set addr1 [address_get "randomized first address"]
 set addr2 [address_get "randomized second address"]
 set test "randomized addresses should not match"
-if [string equal $addr1 $addr2] {
+if {[string equal $addr1 $addr2]} {
     untested "no randomization detected on this system"
     return -1
 } else {
@@ -75,7 +75,7 @@ gdb_test "show disable-randomization"       \
 set addr1 [address_get "fixed first address"]
 set addr2 [address_get "fixed second address"]
 set test "fixed addresses should match"
-if [string equal $addr1 $addr2] {
+if {[string equal $addr1 $addr2]} {
     pass $test
 } else {
     fail $test
index af78a2a14af074bbd50816d9b1266a6c41fdda20..d1131c8407e5bd7dc7afea549c1b52ba5ed79dd2 100644 (file)
@@ -22,11 +22,11 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile {debug}] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
-if ![gdb_range_stepping_enabled] {
+if {![gdb_range_stepping_enabled]} {
     unsupported "range stepping not supported by the target"
     return -1
 }
@@ -171,7 +171,7 @@ with_test_prefix "loop 2" {
 # Check that range stepping works well even when it is interrupted by
 # ctrl-c.
 
-if ![target_info exists gdb,nointerrupts] {
+if {![target_info exists gdb,nointerrupts]} {
     with_test_prefix "interrupt" {
        gdb_test_no_output "set debug remote 1"
 
index 7e6979056922a9f71949c63db26a56b980d3f227..5676067c31db3272429bd9217fcac62c646dac3d 100644 (file)
@@ -19,7 +19,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index efe50dba1595871727c0ceae6e2340914fb0dfb3..e05f7e072a5edf78290f698f8de0fd2c2e8ddf0a 100644 (file)
@@ -108,10 +108,10 @@ proc recurse_tests {} {
        # The former version expected the test to return to main().
        # Now it expects the test to return to main or to stop in the
        # function's epilogue.
-       # 
+       #
        # The problem is that gdb needs to (but doesn't) understand
        # function epilogues in the same way as for prologues.
-       # 
+       #
        # If there is no hardware watchpoint (such as a x86 debug register),
        # then watchpoints are done "the hard way" by single-stepping the
        # target until the value of the watched variable changes.  If you
@@ -119,7 +119,7 @@ proc recurse_tests {} {
        # When you do that, the "top" stack frame may become partially
        # deconstructed (as when you pop the frame pointer, for instance),
        # and from that point on, GDB can no longer make sense of the stack.
-       # 
+       #
        # A test which stops in the epilogue is trying to determine when GDB
        # leaves the stack frame in which the watchpoint was created.  It does
        # this basically by watching for the frame pointer to change.  When
@@ -134,7 +134,7 @@ proc recurse_tests {} {
 # Preserve the old timeout, and set a new one that should be
 # sufficient to avoid timing out during this test.
 set oldtimeout $timeout
-set timeout [expr "$timeout + 60"]
+set timeout [expr {$timeout + 60}]
 verbose "Timeout is now $timeout seconds" 2
 
 recurse_tests
index 9e549bdda1548fa4d962891062e4b99def2aeceb..0d333afb34571a98299e4e4e2e1e8e9fd82a6c77 100644 (file)
@@ -114,7 +114,7 @@ set reggroups [fetch_reggroups "fetch reggroups"]
 set regcount 0
 foreach reggroup $reggroups {
     set regs [fetch_reggroup_regs $reggroup "fetch reggroup regs $reggroup"]
-    set regcount [expr $regcount + [llength $regs]]
+    set regcount [expr {$regcount + [llength $regs]}]
 }
 
 gdb_assert "[llength $regcount] != 0" "system has reggroup registers"
index 886cc4d79a3ea280402d72b59e7b336a5d6ebeba..d79e205bd5956c32e5f2d98284673e5394331bdf 100644 (file)
@@ -19,7 +19,7 @@
 #
 # tests for correctenss of relational operators, associativity and precedence
 # with integer type variables
-# 
+#
 
 #
 # test running programs
index c1c081505789b51e5763fd0a22ac073de13d8cb7..db42885374ca9106642206d4ad995b24ab9ea6a2 100644 (file)
@@ -29,7 +29,7 @@ clean_restart
 
 #Check that invalid options are rejected.
 foreach x {"-raednow" "readnow" "foo" "-readnow s"} {
-    set word [lindex $x [expr [llength $x]-1]]
+    set word [lindex $x [expr {[llength $x]-1}]]
     gdb_test "add-symbol-file ${binfile} 0 $x" \
        "Unrecognized argument \"$word\"" \
        "add-symbol-file: unknown option $word"
@@ -278,7 +278,7 @@ with_test_prefix "functions, 2nd" {
 
 # Re-load the object giving an explicit address for .text
 
-set text [ format "0x%x" [expr ${function_foo_addr} + 0x20000] ]
+set text [ format "0x%x" [expr {${function_foo_addr} + 0x20000}] ]
 clean_restart
 gdb_test "add-symbol-file $binfile -o $offset $text" \
     "Reading symbols from ${binfile}\.\.\.(\r\n$readnow_re)?" \
@@ -295,7 +295,7 @@ with_test_prefix "functions, 3rd" {
 
 # Re-load the object giving an explicit address for .data
 
-set data [ format "0x%x" [expr ${global_foo_addr} + 0x20000] ]
+set data [ format "0x%x" [expr {${global_foo_addr} + 0x20000}] ]
 clean_restart
 gdb_test "add-symbol-file $binfile -o $offset -s .data $data" \
     "Reading symbols from ${binfile}\.\.\.(\r\n$readnow_re)?" \
index c1d6a99ba0b0952a8f040af19efc79202283b1f5..1d97726b1f6ac66c793ae10183fa6bbba384f36a 100644 (file)
@@ -136,7 +136,7 @@ proc gdb_load_timed {executable class writesize} {
        fail "$test - loading executable"
        return
     }
-    verbose "$test - time [expr ($load_end_time - $load_begin_time) / 1000] ms"
+    verbose "$test - time [expr {($load_end_time - $load_begin_time) / 1000}] ms"
     pass $test
 }
 
index 6c71f40dc79ed56fa85ca22c0705e6011c3c1ebf..065cf1b3370b4efc1cd74cee1035d006652658fc 100644 (file)
@@ -86,7 +86,7 @@ foreach_with_prefix opts { "" "pie" } {
        # Should see "Breakpoint 1, foo () at reread2.c:9"
 
        set test "run to foo() second time"
-       if [is_remote target] {
+       if {[is_remote target]} {
            unsupported $test
        } else {
            gdb_run_cmd
@@ -97,7 +97,7 @@ foreach_with_prefix opts { "" "pie" } {
        ### Second pass: verify that GDB checks the executable file's
        ### timestamp when the program is *restarted*, not just when it exits.
 
-       if [is_remote target] {
+       if {[is_remote target]} {
            unsupported "second pass: GDB should check for changes before running"
        } else {
 
index 5448fb42e67b3672d6f21bf37098775e9b97fd73..a19c956645bc6ba1091affe352b412963fbb45c1 100644 (file)
@@ -55,10 +55,10 @@ proc restore_tests { } {
 
             gdb_test "tbreak callee$e" "Temporary breakpoint.*\[0-9\]*\\." \
                "caller$c calls callee$e; tbreak callee"
-            
+
            gdb_test "continue" " callee$e prologue .*/" \
                "caller$c calls callee$e; continue to callee"
-           
+
             # Do a forced return from the callee.
            set test "caller$c calls callee$e; return callee now"
 
@@ -71,7 +71,7 @@ proc restore_tests { } {
             # Check that the values of the local variables are what
            # they should be.
             for {set var 1} {$var <= $c} {incr var} {
-                set expected [expr 0x7eeb + $var]
+                set expected [expr {0x7eeb + $var}]
                set test "caller$c calls callee$e; return restored l$var to $expected"
                set pass_pattern " = $expected"
                set unsupported_pattern " = <optimized out>"
index f39eebdd7b9d6e8a0322e060456b3aa9f53a4baa..2d8665fc8080d1df54112acd4b36036be8e6af83 100644 (file)
@@ -36,8 +36,8 @@ proc return_tests { } {
            send_gdb "step\n"
            exp_continue
        }
-       -re ".*in main after func1.*$gdb_prompt $" { 
-           pass "simple return" 
+       -re ".*in main after func1.*$gdb_prompt $" {
+           pass "simple return"
        }
     }
 
index d1e240b07a7f8bfa0f15e9ee673bff2cc2c824c9..a2086a1f5c518f001ee7ba7e6b28fc0f6ed8d528 100644 (file)
@@ -53,7 +53,7 @@ set binfile_rtld [standard_output_file ${rtld_basename}]
 # the flags -static-pie -fPIE were needed for Fedora 35 through Fedora
 # 38.  The source file rtld-step-rtld.c didn't need the _start()
 # function either.  And, better still, it was possible to call
-# printf() to output progress messages in the pretend/fake RTLD. 
+# printf() to output progress messages in the pretend/fake RTLD.
 # Sadly, these output statements had to be removed in order to obtain
 # code which would work on other Linux distributions / releases.
 #
index fde38547c40819c383eff6ed7f7e6e8db6906626..2b8b4d0e74b2bc558bbad9054850da4a6ab2b9b0 100644 (file)
@@ -21,7 +21,7 @@ require can_spawn_for_attach
 standard_testfile
 set executable $testfile
 
-if [prepare_for_testing "failed to prepare" $executable] {
+if {[prepare_for_testing "failed to prepare" $executable]} {
     return -1
 }
 
index 8a696cd3fe1456fa9445ac2d01befebc81d14263..00b216a79a8d6d230d6520b0bb30337421a44d19 100644 (file)
@@ -19,7 +19,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} $srcfile] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 # Delete all breakpoints, watchpoints, tracepoints, and catchpoints so that
@@ -61,7 +61,7 @@ gdb_test "save breakpoint $bps" "" "save breakpoint bps"
 
 # Now start a new debugger session...
 clean_restart $testfile
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 # Delete all breakpoints, watchpoints, tracepoints, and catchpoints so that
index d71d8720f2c29b7d9e65c517044d81bfe671c004..74b402f9bbe4c5e21547a553963cc381f0f4d6a6 100644 (file)
@@ -96,7 +96,7 @@ proc process_saved_regs { current inner outer } {
        }
        incr level
     }
-    
+
     # Now iterate through the list of OUTER frames checking that the
     # "info frame" output from each still matches what was captured
     # during an early query.  To avoid cascading failures, checking is
@@ -109,7 +109,7 @@ proc process_saved_regs { current inner outer } {
     foreach func $outer {
        set test [concat "Check $func info frame; stack contains" \
                      $current $inner $outer]
-       if $ok {
+       if {$ok} {
            set ok 0
            set pat [string_to_regexp "$saved_regs($func)"]
            gdb_test_multiple "info frame $level" "$test" {
index bb902a13ecd6682947a36248b1783fe1c73f0e06..38ab6ca1bbf61f4e809621f326f3f5a01bf5a75e 100644 (file)
@@ -263,7 +263,7 @@ proc_with_prefix test_at_autovars {} {
     set count 0
     while {$count < 100} {
        gdb_test "print i$count" ".* = $count" ""
-       set count [expr $count+1]
+       set count [expr {$count+1}]
     }
     clear_xfail "*-*-*"
     pass "$count auto variables correctly initialized"
@@ -327,7 +327,7 @@ clean_restart
 gdb_file_cmd $binfile
 
 # Test that variables in various segments print out correctly before
-# the program is run.  
+# the program is run.
 
 # AIX--sections get mapped to the same address so we can't get the right one.
 setup_xfail "rs6000-*-*"
index 71cc0ebee926dcc492a6d14bd64daedcf9dbe02f..0235cbef805f8bfdafeceaa9027c879bc820b13b 100644 (file)
@@ -42,7 +42,7 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
 # the name of a debuginfo only file. This file will be stored in the
 # gdb.base/ subdirectory.
 
-if [gdb_gnu_strip_debug $binfile$EXEEXT] {
+if {[gdb_gnu_strip_debug $binfile$EXEEXT]} {
     # check that you have a recent version of strip and objcopy installed
     unsupported "cannot produce separate debug info files"
     return -1
@@ -461,7 +461,7 @@ gdb_test "finish 123" \
 
 # Verify that GDB responds gracefully to a request to "finish" from
 # the outermost frame.  On a stub that never exits, this will just
-# run to the stubs routine, so we don't get this error...  Thus the 
+# run to the stubs routine, so we don't get this error...  Thus the
 # second condition.
 #
 
@@ -478,7 +478,7 @@ gdb_test_multiple "finish" "finish from outermost frame disallowed" {
 # Test "next" over recursive function call.
 #
 
-proc test_next_with_recursion {} { 
+proc test_next_with_recursion {} {
     global gdb_prompt
     global decimal
     global binfile
@@ -520,7 +520,7 @@ proc test_next_with_recursion {} {
 
     delete_breakpoints
 
-    if [istarget "mips*tx39-*"] {
+    if {[istarget "mips*tx39-*"]} {
        set timeout 60
     }
     # We used to set timeout here for all other targets as well.  This
@@ -610,7 +610,7 @@ proc test_different_dir {type test_different_dir xfail} {
        #
        # Add a second pass pattern.  The behavior differs here between stabs
        # and dwarf for one-line functions.  Stabs preserves two line symbols
-       # (one before the prologue and one after) with the same line number, 
+       # (one before the prologue and one after) with the same line number,
        # but dwarf regards these as duplicates and discards one of them.
        # Therefore the address after the prologue (where the breakpoint is)
        # has no exactly matching line symbol, and GDB reports the breakpoint
index ed7a7a23f8283539d253329a2b5fb0f4c0491a33..1822f1fea3322a672f28376ddbcf4d38554c85a7 100644 (file)
@@ -25,7 +25,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
     return -1
 }
 
-if [gdb_gnu_strip_debug $binfile no-main] {
+if {[gdb_gnu_strip_debug $binfile no-main]} {
     # check that you have a recent version of strip and objcopy installed
     unsupported "cannot produce separate debug info files"
     return -1
index 0e38a9d8279410d5ca30c822afc4004e549f4046..de62692cd2ae7850c5545b6dc06b460a71df889a 100644 (file)
@@ -411,7 +411,7 @@ proc_with_prefix test_setshow_print_characters {} {
 proc_with_prefix test_setshow_prompt {} {
     clean_restart
 
-    if [board_info target exists gdb_prompt] {
+    if {[board_info target exists gdb_prompt]} {
        return
     }
 
index 0bce6202592f554c935f7e19db1048899d9cde2c..5335effd1826cb0d0a51ac766ecb348b6cdd4dfc 100644 (file)
@@ -33,7 +33,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
 #
 # set it up at a breakpoint so we canplay with the variable values
 #
-gdb_test_no_output "set print sevenbit-strings" 
+gdb_test_no_output "set print sevenbit-strings"
 
 if {![runto_main]} {
     return
@@ -51,22 +51,22 @@ gdb_test_multiple "print sizeof (unsigned long)" "sizeof ulong" {
        set ulong_minus_1 18446744073709551615
        set ulong_minus_456 18446744073709551160
     }
-}    
+}
 
 proc test_set { args } {
     global gdb_prompt
 
-    set length [expr [llength $args] - 1]
+    set length [expr {[llength $args] - 1}]
     set message "[lindex $args $length]"
-    set final [expr $length - 2]
+    set final [expr {$length - 2}]
     set count 1
 
     # Set up the variables.
     for {set x 0} {$x < $length} {incr x} {
        if { "[lindex $args $x]" != "" } {
            set arg [lindex $args $x]
-           if { ($x == $final) || ([string first ".*" [lindex $args [expr $x + 1]]] >= 0) } {
-               set match [lindex $args [expr $x + 1]]
+           if { ($x == $final) || ([string first ".*" [lindex $args [expr {$x + 1}]]] >= 0) } {
+               set match [lindex $args [expr {$x + 1}]]
                set mess "$message -- $match"
                if { $count != 1 } {
                    append mess " (#$count)"
@@ -78,7 +78,7 @@ proc test_set { args } {
                set mess "$message -- $match"
            }
            verbose "doing $arg $match"
-           if [gdb_test -nopass "$arg" "$match" "$mess"] {
+           if {[gdb_test -nopass "$arg" "$match" "$mess"]} {
                return 1
            }
        }
@@ -91,27 +91,27 @@ proc test_set { args } {
 #
 # Because bare char types can be either signed or unsigned, we just test the
 # range of values that are common to both (0-127).
-#    
+#
 
-test_set "set variable v_char=0" "print v_char" ".\[0-9\]* = 0 \'.000\'"        "set variable char=0" 
-test_set "set variable v_char=1" "print v_char" ".\[0-9\]* = 1 \'.001\'"        "set variable char=1" 
-test_set "set variable v_char=7" "print v_char" ".\[0-9\]* = 7 \'.a\'"        "set variable char=7 (Bel)" 
-test_set "set variable v_char=32" "print v_char" ".\[0-9\]* = 32 \' \'"        "set variable char=32 (SPC)" 
-test_set "set variable v_char=65" "print v_char" ".\[0-9\]* = 65 \'A\'"        "set variable char=65 ('A')" 
-test_set "set variable v_char=97" "print v_char" ".\[0-9\]* = 97 \'a\'"        "set variable char=97 ('a')" 
-test_set "set variable v_char=126" "print v_char" ".\[0-9\]* = 126 \'~\'"        "set variable char=126 ('~')" 
-test_set "set variable v_char=127" "print v_char" ".\[0-9\]* = 127 \'.177\'"        "set variable char=127 (8-bit)" 
+test_set "set variable v_char=0" "print v_char" ".\[0-9\]* = 0 \'.000\'"        "set variable char=0"
+test_set "set variable v_char=1" "print v_char" ".\[0-9\]* = 1 \'.001\'"        "set variable char=1"
+test_set "set variable v_char=7" "print v_char" ".\[0-9\]* = 7 \'.a\'"        "set variable char=7 (Bel)"
+test_set "set variable v_char=32" "print v_char" ".\[0-9\]* = 32 \' \'"        "set variable char=32 (SPC)"
+test_set "set variable v_char=65" "print v_char" ".\[0-9\]* = 65 \'A\'"        "set variable char=65 ('A')"
+test_set "set variable v_char=97" "print v_char" ".\[0-9\]* = 97 \'a\'"        "set variable char=97 ('a')"
+test_set "set variable v_char=126" "print v_char" ".\[0-9\]* = 126 \'~\'"        "set variable char=126 ('~')"
+test_set "set variable v_char=127" "print v_char" ".\[0-9\]* = 127 \'.177\'"        "set variable char=127 (8-bit)"
 #
 # test "set variable" for type "signed char"
-#    
-test_set "set variable v_char=0" "print v_signed_char" ".\[0-9\]* = 0 \'.000\'"                 "set variable signed char=0" 
-test_set "set variable v_signed_char=1" "print v_signed_char" ".\[0-9\]* = 1 \'.001\'"        "set variable signed char=1" 
-test_set "set variable v_signed_char=7" "print v_signed_char" ".\[0-9\]* = 7 \'.a\'"        "set variable signed char=7 (Bel)" 
-test_set "set variable v_signed_char=32" "print v_signed_char" ".\[0-9\]* = 32 \' \'"        "set variable signed char=32 (SPC)" 
-test_set "set variable v_signed_char=65" "print v_signed_char" ".\[0-9\]* = 65 \'A\'"        "set variable signed char=65 ('A')" 
-test_set "set variable v_signed_char=97" "print v_signed_char" ".\[0-9\]* = 97 \'a\'"        "set variable signed char=97 ('a')" 
-test_set "set variable v_signed_char=126" "print v_signed_char" ".\[0-9\]* = 126 \'~\'"        "set variable signed char=126 ('~')" 
-test_set "set variable v_signed_char=127" "print v_signed_char" ".\[0-9\]* = 127 \'.177\'"        "set variable signed char=127 (8-bit)" 
+#
+test_set "set variable v_char=0" "print v_signed_char" ".\[0-9\]* = 0 \'.000\'"                 "set variable signed char=0"
+test_set "set variable v_signed_char=1" "print v_signed_char" ".\[0-9\]* = 1 \'.001\'"        "set variable signed char=1"
+test_set "set variable v_signed_char=7" "print v_signed_char" ".\[0-9\]* = 7 \'.a\'"        "set variable signed char=7 (Bel)"
+test_set "set variable v_signed_char=32" "print v_signed_char" ".\[0-9\]* = 32 \' \'"        "set variable signed char=32 (SPC)"
+test_set "set variable v_signed_char=65" "print v_signed_char" ".\[0-9\]* = 65 \'A\'"        "set variable signed char=65 ('A')"
+test_set "set variable v_signed_char=97" "print v_signed_char" ".\[0-9\]* = 97 \'a\'"        "set variable signed char=97 ('a')"
+test_set "set variable v_signed_char=126" "print v_signed_char" ".\[0-9\]* = 126 \'~\'"        "set variable signed char=126 ('~')"
+test_set "set variable v_signed_char=127" "print v_signed_char" ".\[0-9\]* = 127 \'.177\'"        "set variable signed char=127 (8-bit)"
 gdb_test_no_output "set variable v_signed_char=-1"
 
 with_target_charset "ASCII" {
@@ -129,156 +129,156 @@ with_target_charset "ASCII" {
 #
 # test "set variable" for type "unsigned char"
 #
-test_set "set variable v_unsigned_char=0" "print v_unsigned_char" ".\[0-9\]* = 0 \'.000\'"        "set variable unsigned char=0" 
-test_set "set variable v_unsigned_char=1" "print v_unsigned_char" ".\[0-9\]* = 1 \'.001\'"        "set variable unsigned char=1" 
-test_set "set variable v_unsigned_char=7" "print v_unsigned_char" ".\[0-9\]* = 7 \'.a\'"        "set variable unsigned char=7 (Bel)" 
-test_set "set variable v_unsigned_char=32" "print v_unsigned_char" ".\[0-9\]* = 32 \' \'"        "set variable unsigned char=32 (SPC)" 
-test_set "set variable v_unsigned_char=65" "print v_unsigned_char" ".\[0-9\]* = 65 \'A\'"        "set variable unsigned char=65 ('A')" 
-test_set "set variable v_unsigned_char=97" "print v_unsigned_char" ".\[0-9\]* = 97 \'a\'"        "set variable unsigned char=97 ('a')" 
-test_set "set variable v_unsigned_char=126" "print v_unsigned_char" ".\[0-9\]* = 126 \'~\'"        "set variable unsigned char=126 ('~')" 
+test_set "set variable v_unsigned_char=0" "print v_unsigned_char" ".\[0-9\]* = 0 \'.000\'"        "set variable unsigned char=0"
+test_set "set variable v_unsigned_char=1" "print v_unsigned_char" ".\[0-9\]* = 1 \'.001\'"        "set variable unsigned char=1"
+test_set "set variable v_unsigned_char=7" "print v_unsigned_char" ".\[0-9\]* = 7 \'.a\'"        "set variable unsigned char=7 (Bel)"
+test_set "set variable v_unsigned_char=32" "print v_unsigned_char" ".\[0-9\]* = 32 \' \'"        "set variable unsigned char=32 (SPC)"
+test_set "set variable v_unsigned_char=65" "print v_unsigned_char" ".\[0-9\]* = 65 \'A\'"        "set variable unsigned char=65 ('A')"
+test_set "set variable v_unsigned_char=97" "print v_unsigned_char" ".\[0-9\]* = 97 \'a\'"        "set variable unsigned char=97 ('a')"
+test_set "set variable v_unsigned_char=126" "print v_unsigned_char" ".\[0-9\]* = 126 \'~\'"        "set variable unsigned char=126 ('~')"
 
 with_target_charset "ASCII" {
-    test_set "set variable v_unsigned_char=~0" "print v_unsigned_char" ".\[0-9\]* = 255 \'.377\'"        "set variable unsigned char=255 (8-bit)" 
+    test_set "set variable v_unsigned_char=~0" "print v_unsigned_char" ".\[0-9\]* = 255 \'.377\'"        "set variable unsigned char=255 (8-bit)"
 }
 #
 # test "set variable" for type "short"
 #
-test_set "set variable v_short=0" "print v_short" ".\[0-9\]* = 0"        "set variable short=0" 
-test_set "set variable v_short=1" "print v_short" ".\[0-9\]* = 1"        "set variable short=1" 
-test_set "set variable v_short=-1" "print v_short" ".\[0-9\]* = -1"        "set variable short=-1 (minus)" 
+test_set "set variable v_short=0" "print v_short" ".\[0-9\]* = 0"        "set variable short=0"
+test_set "set variable v_short=1" "print v_short" ".\[0-9\]* = 1"        "set variable short=1"
+test_set "set variable v_short=-1" "print v_short" ".\[0-9\]* = -1"        "set variable short=-1 (minus)"
 #
 # test "set variable" for type "signed short"
 #
-test_set "set variable v_signed_short=0" "print v_signed_short" ".\[0-9\]* = 0"        "set variable signed short=0" 
-test_set "set variable v_signed_short=1" "print v_signed_short" ".\[0-9\]* = 1"        "set variable signed short=1" 
-test_set "set variable v_signed_short=-1" "print v_signed_short" ".\[0-9\]* = -1"        "set variable signed short=-1 (minus)" 
+test_set "set variable v_signed_short=0" "print v_signed_short" ".\[0-9\]* = 0"        "set variable signed short=0"
+test_set "set variable v_signed_short=1" "print v_signed_short" ".\[0-9\]* = 1"        "set variable signed short=1"
+test_set "set variable v_signed_short=-1" "print v_signed_short" ".\[0-9\]* = -1"        "set variable signed short=-1 (minus)"
 #
 # test "set variable" for type "unsigned short"
 #
-test_set "set variable v_unsigned_short=0" "print v_unsigned_short" ".\[0-9\]* = 0"        "set variable unsigned short=0" 
-test_set "set variable v_unsigned_short=1" "print v_unsigned_short" ".\[0-9\]* = 1"        "set variable unsigned short=1" 
-test_set "set variable v_unsigned_short=~0" "print v_unsigned_short" ".\[0-9\]* = 65535"        "set variable unsigned short=~0 (minus)" 
+test_set "set variable v_unsigned_short=0" "print v_unsigned_short" ".\[0-9\]* = 0"        "set variable unsigned short=0"
+test_set "set variable v_unsigned_short=1" "print v_unsigned_short" ".\[0-9\]* = 1"        "set variable unsigned short=1"
+test_set "set variable v_unsigned_short=~0" "print v_unsigned_short" ".\[0-9\]* = 65535"        "set variable unsigned short=~0 (minus)"
 #
 # test "set variable" for type "int"
 #
-test_set "set variable v_int=0" "print v_int" ".\[0-9\]* = 0"        "set variable int=0" 
-test_set "set variable v_int=1" "print v_int" ".\[0-9\]* = 1"        "set variable int=1" 
-test_set "set variable v_int=-1" "print v_int" ".\[0-9\]* = -1"        "set variable int=-1 (minus)" 
+test_set "set variable v_int=0" "print v_int" ".\[0-9\]* = 0"        "set variable int=0"
+test_set "set variable v_int=1" "print v_int" ".\[0-9\]* = 1"        "set variable int=1"
+test_set "set variable v_int=-1" "print v_int" ".\[0-9\]* = -1"        "set variable int=-1 (minus)"
 #
 # test "set variable" for type "signed int"
 #
-test_set "set variable v_signed_int=0" "print v_signed_int" ".\[0-9\]* = 0"        "set variable signed int=0" 
-test_set "set variable v_signed_int=1" "print v_signed_int" ".\[0-9\]* = 1"        "set variable signed int=1" 
-test_set "set variable v_signed_int=-1" "print v_signed_int" ".\[0-9\]* = -1"        "set variable signed int=-1 (minus)" 
+test_set "set variable v_signed_int=0" "print v_signed_int" ".\[0-9\]* = 0"        "set variable signed int=0"
+test_set "set variable v_signed_int=1" "print v_signed_int" ".\[0-9\]* = 1"        "set variable signed int=1"
+test_set "set variable v_signed_int=-1" "print v_signed_int" ".\[0-9\]* = -1"        "set variable signed int=-1 (minus)"
 #
 # test "set variable" for type "unsigned int"
 #
-test_set "set variable v_unsigned_int=0" "print v_unsigned_int" ".\[0-9\]* = 0"        "set variable unsigned int=0" 
-test_set "set variable v_unsigned_int=1" "print v_unsigned_int" ".\[0-9\]* = 1"        "set variable unsigned int=1" 
-test_set "set variable v_unsigned_int=~0" "print v_unsigned_int" ".\[0-9\]* = (4294967295|65535)"        "set variable unsigned int=~0 (minus)" 
-#test_set ".\[0-9\]* = 65535"        "set variable unsigned int=~0 (minus)" 
+test_set "set variable v_unsigned_int=0" "print v_unsigned_int" ".\[0-9\]* = 0"        "set variable unsigned int=0"
+test_set "set variable v_unsigned_int=1" "print v_unsigned_int" ".\[0-9\]* = 1"        "set variable unsigned int=1"
+test_set "set variable v_unsigned_int=~0" "print v_unsigned_int" ".\[0-9\]* = (4294967295|65535)"        "set variable unsigned int=~0 (minus)"
+#test_set ".\[0-9\]* = 65535"        "set variable unsigned int=~0 (minus)"
 #
 # test "set variable" for type "long"
 #
-test_set "set variable v_long=0" "print v_long" ".\[0-9\]* = 0"        "set variable long=0" 
-test_set "set variable v_long=1" "print v_long" ".\[0-9\]* = 1"        "set variable long=1" 
-test_set "set variable v_long=-1" "print v_long" ".\[0-9\]* = -1"        "set variable long=-1 (minus)" 
+test_set "set variable v_long=0" "print v_long" ".\[0-9\]* = 0"        "set variable long=0"
+test_set "set variable v_long=1" "print v_long" ".\[0-9\]* = 1"        "set variable long=1"
+test_set "set variable v_long=-1" "print v_long" ".\[0-9\]* = -1"        "set variable long=-1 (minus)"
 #
 # test "set variable" for type "signed long"
 #
-test_set "set variable v_signed_long=0" "print v_signed_long" ".\[0-9\]* = 0"        "set variable signed long=0" 
-test_set "set variable v_signed_long=1" "print v_signed_long" ".\[0-9\]* = 1"        "set variable signed long=1" 
-test_set "set variable v_signed_long=-1" "print v_signed_long" ".\[0-9\]* = -1"        "set variable signed long=-1 (minus)" 
+test_set "set variable v_signed_long=0" "print v_signed_long" ".\[0-9\]* = 0"        "set variable signed long=0"
+test_set "set variable v_signed_long=1" "print v_signed_long" ".\[0-9\]* = 1"        "set variable signed long=1"
+test_set "set variable v_signed_long=-1" "print v_signed_long" ".\[0-9\]* = -1"        "set variable signed long=-1 (minus)"
 #
 # test "set variable" for type "unsigned long"
 #
-test_set "set variable v_unsigned_long=0" "print v_unsigned_long" ".\[0-9\]* = 0"        "set variable unsigned long=0" 
-test_set "set variable v_unsigned_long=1" "print v_unsigned_long" ".\[0-9\]* = 1"        "set variable unsigned long=1" 
-test_set "set variable v_unsigned_long=~0" "print v_unsigned_long" ".\[0-9\]* = $ulong_minus_1"        "set variable unsigned long=~0 (minus)" 
+test_set "set variable v_unsigned_long=0" "print v_unsigned_long" ".\[0-9\]* = 0"        "set variable unsigned long=0"
+test_set "set variable v_unsigned_long=1" "print v_unsigned_long" ".\[0-9\]* = 1"        "set variable unsigned long=1"
+test_set "set variable v_unsigned_long=~0" "print v_unsigned_long" ".\[0-9\]* = $ulong_minus_1"        "set variable unsigned long=~0 (minus)"
 #
 # test "set variable" for type "float"
 #
-test_set "set variable v_float=0.0" "print v_float" ".\[0-9\]* = 0"        "set variable float=0" 
-test_set "set variable v_float=1.0" "print v_float" ".\[0-9\]* = 1"        "set variable float=1" 
-test_set "set variable v_float=-1.0" "print v_float" ".\[0-9\]* = -1"        "set variable float=-1 (minus)" 
+test_set "set variable v_float=0.0" "print v_float" ".\[0-9\]* = 0"        "set variable float=0"
+test_set "set variable v_float=1.0" "print v_float" ".\[0-9\]* = 1"        "set variable float=1"
+test_set "set variable v_float=-1.0" "print v_float" ".\[0-9\]* = -1"        "set variable float=-1 (minus)"
 #
 # test "set variable" for type "double"
 #
-test_set "set variable v_double=0.0" "print v_double" ".\[0-9\]* = 0"        "set variable double=0" 
-test_set "set variable v_double=1.0" "print v_double" ".\[0-9\]* = 1"        "set variable double=1" 
-test_set "set variable v_double=-1.0" "print v_double" ".*.\[0-9\]* = -1"        "set variable double=-1 (minus)" 
+test_set "set variable v_double=0.0" "print v_double" ".\[0-9\]* = 0"        "set variable double=0"
+test_set "set variable v_double=1.0" "print v_double" ".\[0-9\]* = 1"        "set variable double=1"
+test_set "set variable v_double=-1.0" "print v_double" ".*.\[0-9\]* = -1"        "set variable double=-1 (minus)"
 #
 # test "set variable" for "char array[2]"
 #
-test_set "set variable v_char_array\[0\]='h'" "set variable v_char_array\[1\]='i'" "print v_char_array" ".*.\[0-9\]* =.*\"hi\""        "set variable char array=\"hi\" (string)" 
+test_set "set variable v_char_array\[0\]='h'" "set variable v_char_array\[1\]='i'" "print v_char_array" ".*.\[0-9\]* =.*\"hi\""        "set variable char array=\"hi\" (string)"
 #
 # test "set variable" for "signed char array[2]"
 #
-test_set "set variable v_signed_char_array\[0\]='h'" "set variable v_signed_char_array\[1\]='i'" "print v_signed_char_array" ".*.\[0-9\]* =.*\"hi\""        "set variable signed char array=\"hi\" (string)" 
+test_set "set variable v_signed_char_array\[0\]='h'" "set variable v_signed_char_array\[1\]='i'" "print v_signed_char_array" ".*.\[0-9\]* =.*\"hi\""        "set variable signed char array=\"hi\" (string)"
 #
 # test "set variable" for "unsigned char array[2]"
 #
-test_set "set variable v_unsigned_char_array\[0\]='h'" "set variable v_unsigned_char_array\[1\]='i'" "print v_unsigned_char_array" ".*.\[0-9\]* =.*\"hi\""        "set variable unsigned char array=\"hi\" (string)" 
+test_set "set variable v_unsigned_char_array\[0\]='h'" "set variable v_unsigned_char_array\[1\]='i'" "print v_unsigned_char_array" ".*.\[0-9\]* =.*\"hi\""        "set variable unsigned char array=\"hi\" (string)"
 #
 # test "set variable" for "short array[2]"
 #
-test_set "set variable v_short_array\[0\]=123" "set variable v_short_array\[1\]=-456" "print v_short_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"        "set variable short array" 
+test_set "set variable v_short_array\[0\]=123" "set variable v_short_array\[1\]=-456" "print v_short_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"        "set variable short array"
 #
 # test "set variable" for "signed short array[2]"
 #
-test_set "set variable v_signed_short_array\[0\]=123" "set variable v_signed_short_array\[1\]=-456" "print v_signed_short_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"        "set variable signed short array" 
+test_set "set variable v_signed_short_array\[0\]=123" "set variable v_signed_short_array\[1\]=-456" "print v_signed_short_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"        "set variable signed short array"
 #
 # test "set variable" for "unsigned short array[2]"
 #
-test_set "set variable v_unsigned_short_array\[0\]=123" "set variable v_unsigned_short_array\[1\]=-456" "print v_unsigned_short_array" ".*.\[0-9\]* =.*\\{123,.*65080\\}"        "set variable unsigned short array" 
+test_set "set variable v_unsigned_short_array\[0\]=123" "set variable v_unsigned_short_array\[1\]=-456" "print v_unsigned_short_array" ".*.\[0-9\]* =.*\\{123,.*65080\\}"        "set variable unsigned short array"
 #
 # test "set variable" for "int array[2]"
 #
-test_set "set variable v_int_array\[0\]=123" "set variable v_int_array\[1\]=-456" "print v_int_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"        "set variable int array" 
+test_set "set variable v_int_array\[0\]=123" "set variable v_int_array\[1\]=-456" "print v_int_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"        "set variable int array"
 #
 # test "set variable" for "signed int array[2]"
 #
-test_set "set variable v_signed_int_array\[0\]=123" "set variable v_signed_int_array\[1\]=-456" "print v_signed_int_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"        "set variable signed int array" 
+test_set "set variable v_signed_int_array\[0\]=123" "set variable v_signed_int_array\[1\]=-456" "print v_signed_int_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"        "set variable signed int array"
 #
 # test "set variable" for "unsigned int array[2]"
 #
-test_set "set variable v_unsigned_int_array\[0\]=123" "set variable v_unsigned_int_array\[1\]=-456" "print v_unsigned_int_array" ".*.\[0-9\]* =.*\\{123,.*(4294966840|65080)\\}"        "set variable unsigned int array" 
+test_set "set variable v_unsigned_int_array\[0\]=123" "set variable v_unsigned_int_array\[1\]=-456" "print v_unsigned_int_array" ".*.\[0-9\]* =.*\\{123,.*(4294966840|65080)\\}"        "set variable unsigned int array"
 #
 # test "set variable" for "long array[2]"
 #
-test_set "set variable v_long_array\[0\]=123" "set variable v_long_array\[1\]=-456" "print v_long_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"        "set variable long array" 
+test_set "set variable v_long_array\[0\]=123" "set variable v_long_array\[1\]=-456" "print v_long_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"        "set variable long array"
 #
 # test "set variable" for "signed long array[2]"
 #
-test_set "set variable v_signed_long_array\[0\]=123" "set variable v_signed_long_array\[1\]=-456" "print v_signed_long_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"        "set variable signed long array" 
+test_set "set variable v_signed_long_array\[0\]=123" "set variable v_signed_long_array\[1\]=-456" "print v_signed_long_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"        "set variable signed long array"
 #
 # test "set variable" for "unsigned long array[2]"
 #
-test_set "set variable v_unsigned_long_array\[0\]=123" "set variable v_unsigned_long_array\[1\]=-456" "print v_unsigned_long_array" ".*.\[0-9\]* =.*\\{123,.*$ulong_minus_456\\}"        "set variable unsigned long array" 
+test_set "set variable v_unsigned_long_array\[0\]=123" "set variable v_unsigned_long_array\[1\]=-456" "print v_unsigned_long_array" ".*.\[0-9\]* =.*\\{123,.*$ulong_minus_456\\}"        "set variable unsigned long array"
 #
 # test "set variable" for "float array[2]"
 #
-test_set "set variable v_float_array\[0\]=123.0" "set variable v_float_array\[1\]=-456.0" "print v_float_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"        "set variable float array" 
+test_set "set variable v_float_array\[0\]=123.0" "set variable v_float_array\[1\]=-456.0" "print v_float_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"        "set variable float array"
 #
 # test "set variable" for "double array[2]"
 #
-test_set "set variable v_double_array\[0\]=123.0" "set variable v_double_array\[1\]=-456.0" "print v_double_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"        "set variable double array" 
+test_set "set variable v_double_array\[0\]=123.0" "set variable v_double_array\[1\]=-456.0" "print v_double_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"        "set variable double array"
 #
 # test "set variable" for type "char *"
 #
-test_set "set v_char_pointer=v_char_array" "set variable *(v_char_pointer)='h'" "set variable *(v_char_pointer+1)='i'" "print v_char_array" ".*.\[0-9\]* =.*\"hi\""  "print *(v_char_pointer+1)" ".*.\[0-9\]* = 105 \'i\'"     "set variable char pointer=\"hi\" (string)" 
+test_set "set v_char_pointer=v_char_array" "set variable *(v_char_pointer)='h'" "set variable *(v_char_pointer+1)='i'" "print v_char_array" ".*.\[0-9\]* =.*\"hi\""  "print *(v_char_pointer+1)" ".*.\[0-9\]* = 105 \'i\'"     "set variable char pointer=\"hi\" (string)"
 #
 # test "set variable" for type "signed char *"
 #
-test_set "set v_signed_char_pointer=v_signed_char_array" "set variable *(v_signed_char_pointer)='h'" "set variable *(v_signed_char_pointer+1)='i'" "print v_signed_char_array" ".*.\[0-9\]* =.*\"hi\""  "print *(v_signed_char_pointer+1)" ".*.\[0-9\]* = 105 \'i\'"     "set variable signed char pointer=\"hi\" (string)" 
+test_set "set v_signed_char_pointer=v_signed_char_array" "set variable *(v_signed_char_pointer)='h'" "set variable *(v_signed_char_pointer+1)='i'" "print v_signed_char_array" ".*.\[0-9\]* =.*\"hi\""  "print *(v_signed_char_pointer+1)" ".*.\[0-9\]* = 105 \'i\'"     "set variable signed char pointer=\"hi\" (string)"
 #
 # test "set variable" for type "unsigned char *"
 #
-test_set "set v_unsigned_char_pointer=v_unsigned_char_array" "set variable *(v_unsigned_char_pointer)='h'" "set variable *(v_unsigned_char_pointer+1)='i'" "print v_unsigned_char_array" ".*.\[0-9\]* =.*\"hi\""  "print *(v_unsigned_char_pointer+1)" ".*.\[0-9\]* = 105 \'i\'"     "set variable unsigned char pointer=\"hi\" (string)" 
+test_set "set v_unsigned_char_pointer=v_unsigned_char_array" "set variable *(v_unsigned_char_pointer)='h'" "set variable *(v_unsigned_char_pointer+1)='i'" "print v_unsigned_char_array" ".*.\[0-9\]* =.*\"hi\""  "print *(v_unsigned_char_pointer+1)" ".*.\[0-9\]* = 105 \'i\'"     "set variable unsigned char pointer=\"hi\" (string)"
 #
 # test "set variable" for type "short *"
 #
-test_set "set v_short_pointer=v_short_array" "set variable *(v_short_pointer)=123" "set variable *(v_short_pointer+1)=-456" "print v_short_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"  "print *(v_short_pointer+1)" ".*.\[0-9\]* = -456"     "set variable short pointer" 
+test_set "set v_short_pointer=v_short_array" "set variable *(v_short_pointer)=123" "set variable *(v_short_pointer+1)=-456" "print v_short_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"  "print *(v_short_pointer+1)" ".*.\[0-9\]* = -456"     "set variable short pointer"
 #
 # test "set variable" for type "signed short *"
 #
@@ -300,11 +300,11 @@ gdb_test "print *(v_unsigned_short_pointer+1)" ".\[0-9\]* = 65080"
 #
 # test "set variable" for type "int *"
 #
-test_set "set v_int_pointer=v_int_array" "set variable *(v_int_pointer)=123" "set variable *(v_int_pointer+1)=-456" "print v_int_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"  "print *(v_int_pointer+1)" ".*.\[0-9\]* = -456"     "set variable int pointer" 
+test_set "set v_int_pointer=v_int_array" "set variable *(v_int_pointer)=123" "set variable *(v_int_pointer+1)=-456" "print v_int_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"  "print *(v_int_pointer+1)" ".*.\[0-9\]* = -456"     "set variable int pointer"
 #
 # test "set variable" for type "signed int *"
 #
-test_set "set v_signed_int_pointer=v_signed_int_array" "set variable *(v_signed_int_pointer)=123" "set variable *(v_signed_int_pointer+1)=-456" "print v_signed_int_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"  "print *(v_signed_int_pointer+1)" ".*.\[0-9\]* = -456"     "set variable signed int pointer" 
+test_set "set v_signed_int_pointer=v_signed_int_array" "set variable *(v_signed_int_pointer)=123" "set variable *(v_signed_int_pointer+1)=-456" "print v_signed_int_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"  "print *(v_signed_int_pointer+1)" ".*.\[0-9\]* = -456"     "set variable signed int pointer"
 #
 # test "set variable" for type "unsigned int *"
 #
@@ -313,32 +313,32 @@ test_set "" "print *(v_unsigned_int_pointer+1)" ".*.\[0-9\]* = (4294966840|65080
 #
 # test "set variable" for type "long *"
 #
-test_set "set v_long_pointer=v_long_array" "set variable *(v_long_pointer)=123" "set variable *(v_long_pointer+1)=-456" "print v_long_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"  "print *(v_long_pointer+1)" ".*.\[0-9\]* = -456"     "set variable long pointer" 
+test_set "set v_long_pointer=v_long_array" "set variable *(v_long_pointer)=123" "set variable *(v_long_pointer+1)=-456" "print v_long_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"  "print *(v_long_pointer+1)" ".*.\[0-9\]* = -456"     "set variable long pointer"
 #
 # test "set variable" for type "signed long *"
 #
-test_set "set v_signed_long_pointer=v_signed_long_array" "set variable *(v_signed_long_pointer)=123" "set variable *(v_signed_long_pointer+1)=-456" "print v_signed_long_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"  "print *(v_signed_long_pointer+1)" ".*.\[0-9\]* = -456"     "set variable signed long pointer" 
+test_set "set v_signed_long_pointer=v_signed_long_array" "set variable *(v_signed_long_pointer)=123" "set variable *(v_signed_long_pointer+1)=-456" "print v_signed_long_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"  "print *(v_signed_long_pointer+1)" ".*.\[0-9\]* = -456"     "set variable signed long pointer"
 #
 # test "set variable" for type "unsigned long *"
 #
-test_set "set v_unsigned_long_pointer=v_unsigned_long_array" "set variable *(v_unsigned_long_pointer)=123" "set variable *(v_unsigned_long_pointer+1)=-456" "print v_unsigned_long_array" ".*.\[0-9\]* =.*\\{123,.*$ulong_minus_456\\}"  "print *(v_unsigned_long_pointer+1)" ".*.\[0-9\]* = $ulong_minus_456"     "set variable unsigned long pointer" 
+test_set "set v_unsigned_long_pointer=v_unsigned_long_array" "set variable *(v_unsigned_long_pointer)=123" "set variable *(v_unsigned_long_pointer+1)=-456" "print v_unsigned_long_array" ".*.\[0-9\]* =.*\\{123,.*$ulong_minus_456\\}"  "print *(v_unsigned_long_pointer+1)" ".*.\[0-9\]* = $ulong_minus_456"     "set variable unsigned long pointer"
 #
 # test "set variable" for type "float *"
 #
-test_set "set v_float_pointer=v_float_array" "set variable *(v_float_pointer)=123.0" "set variable *(v_float_pointer+1)=-456.0" "print v_float_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"  "print *(v_float_pointer+1)" ".*.\[0-9\]* = -456"     "set variable float pointer" 
+test_set "set v_float_pointer=v_float_array" "set variable *(v_float_pointer)=123.0" "set variable *(v_float_pointer+1)=-456.0" "print v_float_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"  "print *(v_float_pointer+1)" ".*.\[0-9\]* = -456"     "set variable float pointer"
 #
 # test "set variable" for type "double *"
 #
-test_set "set v_double_pointer=v_double_array" "set variable *(v_double_pointer)=123.0" "set variable *(v_double_pointer+1)=-456.0" "print v_double_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"  "print *(v_double_pointer+1)" ".*.\[0-9\]* = -456"     "set variable double pointer" 
+test_set "set v_double_pointer=v_double_array" "set variable *(v_double_pointer)=123.0" "set variable *(v_double_pointer+1)=-456.0" "print v_double_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}"  "print *(v_double_pointer+1)" ".*.\[0-9\]* = -456"     "set variable double pointer"
 #
 # test "set variable" for struct members
 #
-test_set "set variable v_struct1.v_char_member='h'" "print v_struct1.v_char_member" ".*.\[0-9\]* = 104 \'h\'"        "set variable structure char member" 
-test_set "set variable v_struct1.v_short_member=1" "print v_struct1.v_short_member" ".*.\[0-9\]* = 1"        "set variable structure short member" 
-test_set "set variable v_struct1.v_int_member=2" "print v_struct1.v_int_member" ".*.\[0-9\]* = 2"        "set variable structure int member" 
-test_set "set variable v_struct1.v_long_member=3" "print v_struct1.v_long_member" ".*.\[0-9\]* = 3"        "set variable structure long member" 
-test_set "set variable v_struct1.v_float_member=4.0" "print v_struct1.v_float_member" ".*.\[0-9\]* = 4"        "set variable structure float member" 
-test_set "set variable v_struct1.v_double_member=5.0" "print v_struct1.v_double_member" ".*.\[0-9\]* = 5"        "set variable structure double member" 
+test_set "set variable v_struct1.v_char_member='h'" "print v_struct1.v_char_member" ".*.\[0-9\]* = 104 \'h\'"        "set variable structure char member"
+test_set "set variable v_struct1.v_short_member=1" "print v_struct1.v_short_member" ".*.\[0-9\]* = 1"        "set variable structure short member"
+test_set "set variable v_struct1.v_int_member=2" "print v_struct1.v_int_member" ".*.\[0-9\]* = 2"        "set variable structure int member"
+test_set "set variable v_struct1.v_long_member=3" "print v_struct1.v_long_member" ".*.\[0-9\]* = 3"        "set variable structure long member"
+test_set "set variable v_struct1.v_float_member=4.0" "print v_struct1.v_float_member" ".*.\[0-9\]* = 4"        "set variable structure float member"
+test_set "set variable v_struct1.v_double_member=5.0" "print v_struct1.v_double_member" ".*.\[0-9\]* = 5"        "set variable structure double member"
 
 gdb_test "print v_struct1" \
   ".*.\[0-9\]* = \{.*v_char_member = 104 \'h\',.*v_short_member = 1,\
index d3ff1c3374c52392e8f6cddf31b09d301cb4efcc..4a5cefd53a55bef01a0249d2390d3a4368dd7d88 100644 (file)
@@ -79,7 +79,7 @@ gdb_test "next 2" "g = shr1\\(g\\);" "next to shr1"
 gdb_test "print g" "\[0-9\]* = 1"
 
 #step -over
-if ![gdb_skip_stdio_test "next over shr1"] {
+if {![gdb_skip_stdio_test "next over shr1"]} {
     gdb_test_stdio "next" \
        "address of sgs is $hex" \
        "g = shr2\\(g\\);" \
@@ -93,7 +93,7 @@ if ![gdb_skip_stdio_test "next over shr1"] {
 gdb_test "print g" "\[0-9\]* = 2" "print g two"
 
 #print shr1(1)
-if ![gdb_skip_stdio_test "print shr1(1)"] {
+if {![gdb_skip_stdio_test "print shr1(1)"]} {
     gdb_test_stdio "print shr1(1)" \
        "address of sgs is $hex" \
        "\[0-9\]* = 2" \
@@ -101,7 +101,7 @@ if ![gdb_skip_stdio_test "print shr1(1)"] {
 }
 
 #print shr1(g)
-if ![gdb_skip_stdio_test "print shr1(g)"] {
+if {![gdb_skip_stdio_test "print shr1(g)"]} {
     gdb_test_stdio "print shr1(g)" \
        "address of sgs is $hex" \
        "\[0-9\]* = 4" \
@@ -120,7 +120,7 @@ gdb_test "continue" \
 
 
 #print shr1(1)
-if ![gdb_skip_stdio_test "print shr1(1) 2nd time"] {
+if {![gdb_skip_stdio_test "print shr1(1) 2nd time"]} {
     gdb_test_stdio "print shr1(1)" \
        "address of sgs is $hex" \
        "\[0-9\]* = 2" \
index 0e1369eda4f4f78b232f64e0815359475ba3819d..e38d04dac11d374aada66c38373b0e07ade00af9 100644 (file)
@@ -57,7 +57,7 @@ set bp_disabled_re "warning: Temporarily disabling breakpoints for unloaded shar
 # assuming that GDB has disabled some breakpoints.
 set stop_after_bp_re [multi_line \
                          "^$::bp_disabled_re" \
-                         "[expr $::bp_line + 1]\\s+assert \\(res == 0\\);"]
+                         "[expr {$::bp_line + 1}]\\s+assert \\(res == 0\\);"]
 
 # Checking that a breakpoint with multiple locations in a shared
 # library only triggers a single breakpoint modified event from
index 2bd79affcc53807d7aa58a205e878e8cc3e15acd..e960291c10142d63ac1d9fea2e7426a65b7acde3 100644 (file)
@@ -42,11 +42,11 @@ if {([istarget "*pc-cygwin"] || [istarget "*pc-mingw32"]) } {
     lappend lib_opts "ldflags=-Wl,--image-base,0x04000000"
 }
 
-if [test_compiler_info "xlc-*"] {
+if {[test_compiler_info "xlc-*"]} {
 
-    # IBM's xlc compiler does not add static variables to the ELF symbol 
-    # table by default.  We need this option to make the variables show 
-    # up in "maint print msymbols". 
+    # IBM's xlc compiler does not add static variables to the ELF symbol
+    # table by default.  We need this option to make the variables show
+    # up in "maint print msymbols".
 
     lappend lib_opts "additional_flags=-qstatsym"
 
@@ -194,13 +194,13 @@ proc check_different {var msymfile} {
     return 1
 }
 
-if [is_remote host] {
+if {[is_remote host]} {
     set msymfile shreloc.txt
 } else {
     set msymfile [standard_output_file shreloc.txt]
 }
 
-if [send_gdb_discard "maint print msymbols ${msymfile}"] {
+if {[send_gdb_discard "maint print msymbols ${msymfile}"]} {
     if {[check_different "static_var_\[12\]" "${msymfile}"]} {
        pass "(msymbol) relocated static vars have different addresses"
     } else {
index a9da0f54db9837dba38936dad7ccdaa6be5aacac..c003baf0f82cba691811c96035ad3a50ab15783f 100644 (file)
@@ -236,7 +236,7 @@ proc cont_out { name args } {
     # Now single step the faulted instrction at that breakpoint.
     gdb_test "stepi" \
        "Program received signal ${signame}.*pc(\r\n| *)=> [at_segv] .*" \
-       "${name}; stepi fault"    
+       "${name}; stepi fault"
 
     # Clear any breakpoints
     for {set i 0} {$i < [llength $args]} {incr i} {
index e60270c1024b59a0f21bb34c424ff2f9051d6073..46d67cc327b07f766d3b9918f14414ca84c2e231 100644 (file)
@@ -21,7 +21,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 00ad7f5183459f56281cdd4adef38642ec22ee6c..9bcf73086222819af03d47dadbae0144e96f8001 100644 (file)
@@ -90,7 +90,7 @@ if { $res < 0 || $res == "" } {
 }
 
 set wait_status [remote_wait target 60]
-set have_standalone [expr [lindex $wait_status 0] == 0]
+set have_standalone [expr {[lindex $wait_status 0] == 0}]
 gdb_assert { $have_standalone } "collect standalone signals state"
 remote_close target
 
index 5ff1e381dfe89ae4b0371611cc8c92fdb7a263bf..c0aaa0a3ed27deb23657770aff8f528b96f38125 100644 (file)
@@ -35,7 +35,7 @@ proc test_handle_all_print {} {
     # Increase timeout and expect input buffer for large output from gdb.
     # Allow blank or TAB as whitespace characters.
     set oldtimeout $timeout
-    set timeout [expr "$timeout + 60"]
+    set timeout [expr {$timeout + 60}]
     verbose "Timeout is now $timeout seconds" 2
     if { ![istarget "*-*-linux*"]
          && ( [istarget "*-*-gnu*"]
@@ -258,7 +258,7 @@ The program being debugged stopped while in a function called from GDB.*" \
     gdb_test "signal" \
        "Argument required .signal number..*" \
        "signal without arguments disallowed"
-    
+
     # Verify that we can successfully send a signal other than 0 to
     # the inferior.  (This probably causes the inferior to run away.
     # Be prepared to rerun to main for further testing.)
index 0e62f0b7090da39fe96983753b3d88614a3be2fa..c55db4aec7ecd1f1b70955793a1ec15fb41a8f33 100644 (file)
@@ -19,7 +19,7 @@ standard_testfile
 
 require {!target_info exists gdb,nosignals}
 
-if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug}] {
+if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug}]} {
     return -1
 }
 
index 1152e13612d2107e73ce6fe63209aaa7427a5d7b..3c81b77b4cec491dc15211ad72483d54c1a5e1b1 100644 (file)
@@ -127,7 +127,7 @@ while { $ok } {
     gdb_expect {
        -re ".*dump" {
            #pass "maint print arch $ok"
-           #set ok [expr $ok + 1]
+           #set ok [expr {$ok + 1}]
        }
        -re "$gdb_prompt $" {
            pass "maint print arch"
index 33a39511c1e697458694f19f3b0f279aa621239e..e3bc108e4b8ecb20806ca1d00d202a96d2400019 100644 (file)
@@ -27,7 +27,7 @@ set srcfile skip-inline.c
 set srcfile1 skip1.c
 
 proc_with_prefix single_step { } {
-    if ![runto_main] {
+    if {![runto_main]} {
        return
     }
 
@@ -43,7 +43,7 @@ proc_with_prefix single_step { } {
 }
 
 proc_with_prefix double_step { } {
-    if ![runto_main] {
+    if {![runto_main]} {
        return
     }
 
@@ -61,7 +61,7 @@ proc_with_prefix double_step { } {
 }
 
 proc_with_prefix triple_step { } {
-    if ![runto_main] {
+    if {![runto_main]} {
        return
     }
 
@@ -75,7 +75,7 @@ proc_with_prefix triple_step { } {
 }
 
 proc_with_prefix skip_current_frame { } {
-    if ![runto_main] {
+    if {![runto_main]} {
        return
     }
 
index d96d1ace2e074e3b19d92c483bea04a3934b342a..e152023e6bb0ae0fac160957958afcc76ff02b90 100644 (file)
@@ -72,7 +72,7 @@ with_test_prefix "ignoring solib file" {
             "Num\\s+Enb\\s+Glob\\s+File\\s+RE\\s+Function\\s*" \
             "1\\s+y\\s+n\\s+${srcfile_lib}\\s+n\\s+<none>\\s*"]
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return
     }
 
@@ -94,7 +94,7 @@ with_test_prefix "ignoring solib function" {
        "Function multiply will be skipped when stepping\\." \
        "skip function"
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return
     }
 
index 0c84cf90127ac9a62dd2b732e5bcbd302ac615d9..3e2f162730b71e298f9d901d8277862d8129cc2d 100644 (file)
@@ -49,7 +49,7 @@ gdb_test "skip -rfunction" "Missing value for -rfunction option."
 gdb_test "skip -x" "Invalid skip option: -x"
 gdb_test "skip -rfu foo.* xyzzy" "Invalid argument: xyzzy"
 
-if ![runto_main] {
+if {![runto_main]} {
     return
 }
 
@@ -93,7 +93,7 @@ gdb_test "info skip" \
 # files, so when we step into the first line in main(), we should step
 # right over it and go to the second line of main().
 
-if ![runto_main] {
+if {![runto_main]} {
     return
 }
 
@@ -121,7 +121,7 @@ with_test_prefix "step after deleting 1" {
                    "4\\s+y\\s+n\\s+<none>\\s+n\\s+baz"] \
        "info skip (delete 1)"
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return
     }
 
@@ -164,7 +164,7 @@ with_test_prefix "step after disabling 3" {
        "3\\s+n\\s+n\\s+$srcfile1\\s+n\\s+<none>\\s*" \
        "info skip shows entry as disabled"
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return
     }
 
@@ -180,7 +180,7 @@ with_test_prefix "step after enable 3" {
        "3\\s+y\\s+n\\s+$srcfile1\\s+n\\s+<none>\\s*" \
        "info skip shows entry as enabled"
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return
     }
 
@@ -247,7 +247,7 @@ gdb_test "skip -fu baz" "Function baz will be skipped when stepping\."
 gdb_test "skip -rfu ^b.z$" "Function\\(s\\) \\^b\\.z\\$ will be skipped when stepping."
 
 with_test_prefix "step using -fi" {
-    if ![runto_main] {
+    if {![runto_main]} {
        return
     }
 
@@ -257,7 +257,7 @@ with_test_prefix "step using -fi" {
 }
 
 with_test_prefix "step using -gfi" {
-    if ![runto_main] {
+    if {![runto_main]} {
        return
     }
 
@@ -267,7 +267,7 @@ with_test_prefix "step using -gfi" {
 }
 
 with_test_prefix "step using -fu for baz" {
-    if ![runto_main] {
+    if {![runto_main]} {
        return
     }
 
@@ -278,7 +278,7 @@ with_test_prefix "step using -fu for baz" {
 }
 
 with_test_prefix "step using -rfu for baz" {
-    if ![runto_main] {
+    if {![runto_main]} {
        return
     }
 
@@ -293,7 +293,7 @@ with_test_prefix "step using -rfu for baz" {
 with_test_prefix "step using -fi + -fu" {
     gdb_test_no_output "skip delete"
 
-    if ![runto test_skip_file_and_function] {
+    if {![runto test_skip_file_and_function]} {
        return
     }
 
@@ -311,7 +311,7 @@ with_test_prefix "skip delete completion" {
     global binfile
     clean_restart
     gdb_load $binfile
-    if ![runto_main] {
+    if {![runto_main]} {
        return
     }
 
index ec440ab23b8afa77437a43ac8cbc1e0497783a25..29f9254bc03e5929a2990a5fcc4c6fd4b29cba6e 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
 }
 
index a9cc59dbd9b013059f6db2eec91b22acec0797bf..9b5556ddbe09a3f5ae3dc0eee2f9a87923c03e84 100644 (file)
@@ -30,7 +30,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
 # corruption cannot be tested.  Disable the probes interface.
 gdb_test "maint ignore-probes rtld"
 
-if ![runto_main] {
+if {![runto_main]} {
     return
 }
 
index 510164c167ee5e7abef4c28c697984d447110cb4..249f494d642636436bda80daeedfa3ffc55336b8 100644 (file)
@@ -53,7 +53,7 @@ gdb_test_no_output "set cwd ${binlibfiledir}" \
     "set cwd OBJDIR/${subdir}"
 
 set test "library loaded"
-if [runto_main] {
+if {[runto_main]} {
     pass $test
 } else {
     fail $test
index ce18607d70efb42304ad197803c46c2e15b37aed..893deb6eec4d6c98040e486d049d7129ee650a5c 100644 (file)
@@ -42,7 +42,7 @@ set srcfile ${srcdir}/${subdir}/${testfile}.c
 # Prelink first lib1 at 0x40000000 and lib2 at 0x41000000.
 # During second pass try lib1 at 0x50000000 and lib2 at 0x51000000.
 foreach prelink_lib1 {0x40000000 0x50000000} { with_test_prefix "$prelink_lib1" {
-    set prelink_lib2 [format "0x%x" [expr $prelink_lib1 + 0x01000000]]
+    set prelink_lib2 [format "0x%x" [expr {$prelink_lib1 + 0x01000000}]]
 
     # Library file.
     set binfile_lib1 [standard_output_file ${libname}1-${prelink_lib1}.so]
@@ -64,8 +64,8 @@ foreach prelink_lib1 {0x40000000 0x50000000} { with_test_prefix "$prelink_lib1"
        return -1
     }
 
-    if {[catch "exec prelink -N -r ${prelink_lib1} ${binfile_lib1}" output] != 0
-       || [catch "exec prelink -N -r ${prelink_lib2} ${binfile_lib2}" output] != 0} {
+    if {[catch {exec prelink -N -r ${prelink_lib1} ${binfile_lib1}} output] != 0
+       || [catch {exec prelink -N -r ${prelink_lib2} ${binfile_lib2}} output] != 0} {
        # Maybe we don't have prelink.
        verbose -log "prelink failed: $output"
        untested "could not prelink ${binfile_lib1_test_msg} or ${binfile_lib2_test_msg}."
index 511ef37277128173bd22c9aeb6efc299facc3cae..f9b8856ad69c8798453b51be855be9f95ec37122 100644 (file)
@@ -69,7 +69,7 @@ proc do_test { lib1opts lib2opts lib1first } {
     set lib1 [standard_output_file ${libfile1}.sl]
     set lib2 [standard_output_file ${libfile2}.sl]
 
-    if $lib1first {
+    if {$lib1first} {
        set exec_opts [list debug shlib=${lib1} shlib=${lib2}]
        set expected_file ${libfile1}
     } else {
index e07a1177455bf3672678a355d577f1ccc96de87e..96f5a7c685d1a85c8bcdae48fb9af3cbce0fa114 100644 (file)
@@ -83,7 +83,7 @@ proc test_truncated_comp_dir {} {
 
     # All of these pathname and directory manipulations assume
     # host == build, so do not attempt this set of tests on remote host.
-    if [is_remote host] {
+    if {[is_remote host]} {
         return
     }
 
index 15c0fda8a1a221363a2af03021d06c0dd6b0546a..0ded183358d7710b28d80049da84731cb42e501e 100644 (file)
@@ -41,7 +41,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return 0
 }
 
@@ -140,7 +140,7 @@ gdb_test_multiple "" $test {
 set disasm_after [disassemble "after"]
 
 set test "before/after disassembly matches"
-if ![string compare $disasm_before $disasm_after]  {
+if {![string compare $disasm_before $disasm_after]} {
     pass $test
 } else {
     fail $test
index 158f3f7a0ecba438b718f06490a54df9ce15b4b4..1d2c655f839e4bfc434e39f87f56e33fa3fb1570 100644 (file)
@@ -19,7 +19,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index c487a9ffd96305bea8549dd727002f5686144ac4..4d8efc184f3f47a7d9cfe0af7b838bb24bb3d606 100644 (file)
@@ -60,8 +60,8 @@ proc gdb_count_probes { type provider name { object "" }} {
        }
     }
 
-    if { [expr $no_probes_line && $probe_count > 0] \
-            || [expr !$no_probes_line && $probe_count == 0] } {
+    if { ($no_probes_line && $probe_count > 0) \
+            || (!$no_probes_line && $probe_count == 0) } {
        perror "Mismatch between no probes found line, and probes count"
        return -1
     }
@@ -74,7 +74,7 @@ proc check_for_usable_xmm0_probe { binfile } {
     set binfile [standard_output_file $binfile]
     set command "exec $readelf_program -n $binfile"
     verbose -log "command is $command"
-    set result [catch $command output]
+    set result [catch {{*}$command} output]
     verbose -log "result is $result"
     verbose -log "output is $output"
 
@@ -89,7 +89,7 @@ proc check_for_usable_xmm0_probe { binfile } {
 
     # First, look for the xmmreg probe, and if we find it, grab the
     # argument string.
-    if ![regexp {\n\s+Provider: test\n\s+Name: xmmreg\n[^\n]+\n\s+Arguments: ([^\n]+)\n} $output ignore arguments] {
+    if {![regexp {\n\s+Provider: test\n\s+Name: xmmreg\n[^\n]+\n\s+Arguments: ([^\n]+)\n} $output ignore arguments]} {
        verbose -log "APB: Couldn't find probe at all"
        return false
     }
@@ -98,7 +98,7 @@ proc check_for_usable_xmm0_probe { binfile } {
     verbose -log "APB: arguments: '$arguments'"
 
     # Check the the argument string mentions xmm0.
-    if ![regexp {@%?xmm0} $arguments] {
+    if {![regexp {@%?xmm0} $arguments]} {
        verbose -log "APB: Prove doesn't use xmm0 register"
        return false
     }
@@ -133,7 +133,7 @@ proc stap_test {exec_name {args ""}} {
                "get original address of relocation_marker"]
     }
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
@@ -159,7 +159,7 @@ proc stap_test {exec_name {args ""}} {
            [get_hexadecimal_valueof "&relocation_marker" \
                 "0" "get revised relocation_marker address"]
        set relocation_base \
-          [expr $updated_semaphore_addr_var - $semaphore_addr_var]
+          [expr {$updated_semaphore_addr_var - $semaphore_addr_var}]
        if {$relocation_base != 0} {
           # Checks that GDB doesn't mistakenly relocate and write to null
           # semaphore addresses.  If it were to relocate a zero-valued
@@ -219,7 +219,7 @@ proc stap_test {exec_name {args ""}} {
     "print \$_probe_arg1 for probe ps"
 
     # Check the probe is using the xmm0 register.
-    if [check_for_usable_xmm0_probe $exec_name] {
+    if {[check_for_usable_xmm0_probe $exec_name]} {
 
        delete_breakpoints
        if {[runto "-pstap test:xmmreg"]} {
index 64403a1059860dad539fa44be8651e80b3dad084..80fc55e30750def259534535add229e2926b201c 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 6dfa7bbb2194645dea622e3fc9dca9206877ff10..105157d564448ae05dc1f277a73e6f9250186e12 100644 (file)
@@ -38,7 +38,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 1a919864d434f8a3554faac3da450201a648107a..24e3bf779edb4ba94eeff47e7f2940f8c144cb8e 100644 (file)
@@ -50,7 +50,7 @@ proc test_step_over { displaced } {
     clean_restart
     gdb_load $binfile
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
index 9df716dd994db176dcf2aafe305e35c015a2a43f..e4425a1e97243153e8fa11b43379ae303269f3b2 100644 (file)
@@ -227,7 +227,7 @@ proc step_over_syscall { syscall } {
            lappend options "pthreads"
        }
 
-       if [build_executable ${testfile}.exp ${testfile} ${testfile}.c $options] {
+       if {[build_executable ${testfile}.exp ${testfile} ${testfile}.c $options]} {
            untested "failed to compile"
            return -1
        }
index 4010c76aa026e73d2f565e16c129e4941eb5fb8c..f1f8dc2b4c91018cea207c0e9f60a55c56021f1d 100644 (file)
@@ -19,7 +19,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} $srcfile] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
@@ -27,7 +27,7 @@ gdb_test "step" " in-func .*"
 gdb_test "up" " call-func .*"
 gdb_test_no_output {set $b=$pc}
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 2dde3bbece7cab11edc592251994cdc3b00aceae..b10465fbd33996554fa92fc7296fb860d2503b07 100644 (file)
@@ -21,7 +21,7 @@
 
 standard_testfile
 
-if [build_executable "failed to build" ${testfile} ${srcfile} {debug}] {
+if {[build_executable "failed to build" ${testfile} ${srcfile} {debug}]} {
     return -1
 }
 
@@ -43,7 +43,7 @@ proc test {non_stop displaced always_inserted} {
     gdb_test_no_output "set displaced-stepping $displaced"
     gdb_test_no_output "set breakpoint always-inserted $always_inserted"
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
index 07df2539c459a982fdd79470ff5a1ca17200c333..47e46825d5e3be4d98a698509e0c6bbfac95c249 100644 (file)
@@ -21,7 +21,7 @@ if {[build_executable ${testfile}.exp ${testfile} ${srcfile} {nodebug}] == -1} {
 # We need those symbols global to access them from the .S file.
 set test "strip stub symbols"
 set objcopy_program [gdb_find_objcopy]
-set result [catch "exec $objcopy_program -N symless ${binfile}" output]
+set result [catch {exec $objcopy_program -N symless ${binfile}} output]
 verbose "result is $result"
 verbose "output is $output"
 if {$result != 0} {
@@ -32,7 +32,7 @@ pass $test
 
 clean_restart $testfile
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 39833a30fd8d5a298d7ee3ec6e32b2e40d2968eb..cfcf5118151bd57b8c37e6391784fb621a2ac16d 100644 (file)
@@ -33,7 +33,7 @@ if {![runto_main]} {
 
 # Set a breakpoint at line 45, if stepi then finish fails, we would
 # run to the end of the program, which would mess up the rest of the tests.
-  
+
 # Vanilla step/next
 #
 gdb_test "next" ".*${decimal}.*x = 1;.*" "next 1"
@@ -92,10 +92,10 @@ if { [istarget "ia64-*-*"] || [istarget "mips*-*-*"]} {
 ###
 ### The exact regexps used are "$HERE.*$gdb_prompt $"
 ###                        and "$THERE.*$gdb_prompt $"
-### 
+###
 proc test_i {name command here there} {
     global gdb_prompt
-    
+
     set i 0
     gdb_test_multiple "$command" "$name" {
        -re "$here.*$gdb_prompt $" {
@@ -123,7 +123,7 @@ test_i "stepi to next line" "stepi" \
 # if this passes through a (useless) PLT entry.
 test_i "stepi into function" "stepi" \
        "(.*${decimal}.*callee.*STEPI|.* in callee@plt)" \
-       ".*callee \\(\\) at .*step-test\\.c" 
+       ".*callee \\(\\) at .*step-test\\.c"
 
 # Continue to step until we reach the function's body.  This makes it
 # more likely that we've actually completed the prologue, so "finish"
@@ -134,7 +134,7 @@ test_i "stepi into function's first source line" "stepi" \
        "(${decimal}.*int callee|$pic_thunk_re)" \
        ".*${decimal}.*myglob.*; return 0;"
 
-# Have to be careful here, if the finish does not work, 
+# Have to be careful here, if the finish does not work,
 # then we may run to the end of the program, which
 # will cause erroneous failures in the rest of the tests
 set test "stepi: finish call"
@@ -143,7 +143,7 @@ gdb_test_multiple "finish" "$test" {
        pass "$test"
     }
     -re ".*(Program received|$inferior_exited_re).*$gdb_prompt $" {
-       # Oops... We ran to the end of the program...  Better reset     
+       # Oops... We ran to the end of the program...  Better reset
        if {![runto_main]} {
            return 0
        }
index fa7f7867b9fdcdbe7b663ae5398a98982e8c4875..4850a59c872518368000f5cb53fcd59fc31d7a81 100644 (file)
@@ -75,7 +75,7 @@ proc start_structs_test { types } {
     get_debug_format
 
     # Limit the slow $anychar_re{256} matching for better performance.
-    if $first {
+    if {$first} {
        set first 0
 
        # Verify $anychar_re can match all the values of `char' type.
@@ -215,7 +215,7 @@ proc test_struct_calls { n } {
     # Check that GDB can always extract a struct-return value from an
     # inferior function call.  Since GDB always knows the location of an
     # inferior function call's return value these should never fail
-    
+
     # Implemented by calling the parameterless function "fun$N" and then
     # examining the return value printed by GDB.
 
@@ -364,7 +364,7 @@ proc test_struct_returns { n } {
             pass "${test}"
        }
        -re " = [any $n].*${gdb_prompt} $" {
-           if $return_value_known {
+           if {$return_value_known} {
                # This contradicts the above claim that GDB knew
                # the location of the return value.
                fail "${test}"
@@ -375,7 +375,7 @@ proc test_struct_returns { n } {
            }
        }
        -re ".*${gdb_prompt} $" {
-           if $return_value_unimplemented {
+           if {$return_value_unimplemented} {
                # What a surprise.  The architecture hasn't implemented
                # return_value, and hence has to fail.
                kfail "$test" gdb/1444
@@ -383,8 +383,8 @@ proc test_struct_returns { n } {
                fail "$test"
            }
        }
-    }  
-    
+    }
+
     # Check that a "finish" works.
 
     # This is almost but not quite the same as "call struct funcs".
@@ -425,7 +425,7 @@ proc test_struct_returns { n } {
     set test "value foo<n> finished; ${tests}"
     gdb_test_multiple "p/c" "${test}" {
        -re "[foo ${n}]\[\r\n\]+${gdb_prompt} $" {
-           if $finish_value_known {
+           if {$finish_value_known} {
                pass "${test}"
            } else {
                # This contradicts the above claim that GDB didn't
@@ -435,7 +435,7 @@ proc test_struct_returns { n } {
        }
        -re "[zed ${n}]\[\r\n\]+${gdb_prompt} $" {
            # The value didn't get found.  This is "expected".
-           if $finish_value_known {
+           if {$finish_value_known} {
                # This contradicts the above claim that GDB did
                # know the location of the return-value.
                fail "${test}"
index f377022cc212e38481ad7c3ed32af04db491caaf..f0e8342a45f496ff6c99bae094f27d4022f34c1c 100644 (file)
@@ -31,14 +31,14 @@ gdb_test "break param_reg" \
     "Breakpoint .* at .*" \
     "structs2 breakpoint set"
 
-if [test_compiler_info gcc-3-*] {
+if {[test_compiler_info gcc-3-*]} {
   setup_xfail hppa*-* gcc/15860
 }
 gdb_test "continue" \
     ".*pr_char=120.*pr_uchar=130.*pr_short=32000.*pr_ushort=33000.*bkpt = 1.*" \
     "structs2 continue1"
 
-if [test_compiler_info gcc-3-*] {
+if {[test_compiler_info gcc-3-*]} {
   setup_xfail hppa*-* gcc/15860
 }
 gdb_test "continue" \
index 6ac450f2b7a6de80fb3a8ed6fb1fb118c5d7d104..22cda9d2e7f9aca0bfe9529e851067fb80722b78 100644 (file)
@@ -21,7 +21,7 @@ if { [prepare_for_testing "failed to prepare" "structs3" "" {debug}] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 92b508520de0fe13cef98a589e62141fc6f77d73..222f17ee0969c6ad9e7d79eb90570bf3796c57e5 100644 (file)
@@ -163,7 +163,7 @@ proc run_style_tests { } {
            # - 4 leading spaces
            # - argv string
            # - closing parenthesis
-           set line_len [expr 4 + $argv_len + 1]
+           set line_len [expr {4 + $argv_len + 1}]
 
            if { $argv == "argv=0x0" && $width >= 27 } {
                # Embedded target with no argv support.
@@ -847,14 +847,14 @@ proc previous_line_is_ok { str } {
     # Then compare string lengths to get a count of the '\033'
     # charactes present in STR.
     regsub -all "\033" $str {} stripped
-    set count [expr [string length $str] - [string length $stripped]]
+    set count [expr {[string length $str] - [string length $stripped]}]
 
     # If STR switched styles, then it _must_ switch back again,
     # otherwise the pagination prompt will be in the wrong style.
     # This means that there _must_ be an even number of '\033'
     # characters in STR.  If there is not then we switched style, but
     # failed to switch back.
-    if { [expr $count % 2] != 0 } {
+    if {$count % 2 != 0} {
        return false
     }
 
index c3deaf66c3337aa24d0ef628da54dffae66507a1..84ba82d9b92d463cfece277da09bc28b6dbc90f3 100644 (file)
@@ -16,8 +16,8 @@
 
 standard_testfile symbol-alias.c symbol-alias2.c
 # Clang versions prior to v15 do not emit debug info for aliases.
-set old_clang [expr [test_compiler_info {clang-1[0-4]-*-*}] \
-                || [test_compiler_info {clang-[1-9]-*}]]
+set old_clang [expr {[test_compiler_info {clang-1[0-4]-*-*}] \
+                        || [test_compiler_info {clang-[1-9]-*}]}]
 
 if { [prepare_for_testing "failed to prepare" ${testfile} [list $srcfile $srcfile2]] } {
     return -1
index 34b1db02ce9b2906b47a237b73c017a1ed5518d4..aca9ca19917d6620a89eacf98e939bbc3199c53d 100644 (file)
@@ -37,7 +37,7 @@ clean_restart
 gdb_load $binfile
 gdb_load_shlib $lib1
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 59cd33c527b4d4f1123ca71d8ca00aa713ede1d5..540a48f9805900c6935c503b6df40bc0c0aa9813 100644 (file)
@@ -75,7 +75,7 @@ proc find_env {varname} {
        }
 
        if {[string match "$varname=*" $var]} {
-           set from [expr [string first "=" $var] + 1]
+           set from [expr {[string first "=" $var] + 1}]
            set to [string length $var]
            return [string range $var $from $to]
        }
@@ -95,7 +95,7 @@ proc_with_prefix test_set_unset_env {} {
 
     # First test with no TEST_GDB_VAR.
     with_test_prefix "test1" {
-       if ![run_and_count_vars] {
+       if {![run_and_count_vars]} {
            return
        }
        test_num_test_vars 0 "no TEST_GDB vars"
@@ -106,7 +106,7 @@ proc_with_prefix test_set_unset_env {} {
        gdb_test_no_output "set env TEST_GDB_VAR1 test1" \
            "set TEST_GDB_VAR1"
 
-       if ![run_and_count_vars] {
+       if {![run_and_count_vars]} {
            return
        }
        test_num_test_vars 1 "one TEST_GDB var"
@@ -117,7 +117,7 @@ proc_with_prefix test_set_unset_env {} {
        gdb_test_no_output "set env TEST_GDB_VAR2 test2" \
            "set TEST_GDB_VAR2"
 
-       if ![run_and_count_vars] {
+       if {![run_and_count_vars]} {
            return
        }
 
@@ -130,7 +130,7 @@ proc_with_prefix test_set_unset_env {} {
        gdb_test_no_output "unset env TEST_GDB_VAR1" \
            "unset TEST_GDB_VAR1"
 
-       if ![run_and_count_vars] {
+       if {![run_and_count_vars]} {
            return
        }
 
@@ -145,7 +145,7 @@ proc_with_prefix test_inherit_env_var {} {
 
     # This test assumes that the build's environ (where dejagnu runs)
     # is the same as the host's (where gdb runs) environ.
-    if [is_remote host] {
+    if {[is_remote host]} {
        return
     }
 
@@ -159,7 +159,7 @@ proc_with_prefix test_inherit_env_var {} {
 
        # First test with only inherited TEST_GDB_GLOBAL.
        with_test_prefix "test1" {
-           if ![run_and_count_vars] {
+           if {![run_and_count_vars]} {
                return
            }
 
@@ -179,7 +179,7 @@ proc_with_prefix test_inherit_env_var {} {
            gdb_test_no_output "unset env TEST_GDB_GLOBAL" \
                "unset TEST_GDB_GLOBAL"
 
-           if ![run_and_count_vars] {
+           if {![run_and_count_vars]} {
                return
            }
 
index fc212a92256552fffc6e008cf90203d16f88e50c..a17409fb6b7073513bec3f0e432ef421851ebb17 100644 (file)
@@ -33,7 +33,7 @@ set internal_tls_linux_targets {"x86_64-*-linux*" "aarch64-*-linux*"
 # use of internal TLS support for architectures which don't support
 # it.
 
-if [is_any_target {*}$internal_tls_linux_targets] {
+if {[is_any_target {*}$internal_tls_linux_targets]} {
     set internal_tls_iters { false true }
 } else {
     set internal_tls_iters { false }
@@ -43,7 +43,7 @@ if [is_any_target {*}$internal_tls_linux_targets] {
 # issue gdb_test with command CMD and regular expression RE.
 
 proc gdb_test_with_kfail {cmd re kfail_cond kfail_msg} {
-    if [uplevel 1 [list expr $kfail_cond]] {
+    if {[uplevel 1 [list expr $kfail_cond]]} {
        setup_kfail $kfail_msg *-*-*
     }
     gdb_test $cmd $re
index 1509ec8d445c58f2b0b87db451b55c3263dc0469..9b707993eb0b20e4af59b6c42ab161404738ede6 100644 (file)
@@ -46,7 +46,7 @@ proc gdb_test_with_xfail { cmd re cond} {
            pass $gdb_test_name
        }
        -re -wrap "The inferior has not yet allocated storage for thread-local variables.*" {
-           if [ uplevel 1 [list expr $cond]] {
+           if {[ uplevel 1 [list expr $cond]]} {
                xfail $gdb_test_name
            } else {
                fail $gdb_test_name
@@ -58,11 +58,11 @@ proc gdb_test_with_xfail { cmd re cond} {
 proc do_tests {force_internal_tls} {
     clean_restart
     gdb_load $::binfile
-    if ![runto_main] {
+    if {![runto_main]} {
        return
     }
 
-    if $force_internal_tls {
+    if {$force_internal_tls} {
        gdb_test_no_output "maint set force-internal-tls-address-lookup on"
     }
 
@@ -285,7 +285,7 @@ proc do_tests {force_internal_tls} {
     }
 
     # Finish test early if no core file was made.
-    if !$core_supported {
+    if {!$core_supported} {
        return
     }
 
@@ -298,7 +298,7 @@ proc do_tests {force_internal_tls} {
     }
 
     with_test_prefix "core file" {
-       if $force_internal_tls {
+       if {$force_internal_tls} {
            gdb_test_no_output "maint set force-internal-tls-address-lookup on"
        }
 
index eb3721ee4a059dd2a810e241db4a4be3c7ff8310..14bbfc9040b91b86e2b9b7a009685568fc1f55be 100644 (file)
@@ -28,11 +28,11 @@ set lib3obj [standard_output_file "${testfile}3-lib.so"]
 proc do_tests {force_internal_tls {do_kfail_tls_access 0}} {
     clean_restart
     gdb_load $::binfile
-    if ![runto_main] {
+    if {![runto_main]} {
        return
     }
 
-    if $force_internal_tls {
+    if {$force_internal_tls} {
        gdb_test_no_output "maint set force-internal-tls-address-lookup on"
     }
 
@@ -52,7 +52,7 @@ proc do_tests {force_internal_tls {do_kfail_tls_access 0}} {
        # Also turn off do_kfail_tls_access when connected to a
        # gdbserver and we observe that accessing a TLS variable
        # works.
-       if [target_is_gdbserver] {
+       if {[target_is_gdbserver]} {
            gdb_test_multiple "print tls_main_tbss_1" \
                "Check TLS accessibility when connected to a gdbserver" {
                -re -wrap "= 0" {
@@ -125,7 +125,7 @@ proc do_tests {force_internal_tls {do_kfail_tls_access 0}} {
     }
 
     # Finish test early if no core file was made.
-    if !$core_supported {
+    if {!$core_supported} {
        return
     }
 
@@ -138,7 +138,7 @@ proc do_tests {force_internal_tls {do_kfail_tls_access 0}} {
     }
 
     with_test_prefix "core file" {
-       if $force_internal_tls {
+       if {$force_internal_tls} {
            gdb_test_no_output "maint set force-internal-tls-address-lookup on"
        }
 
index c7b147616dec8b1dcf180d72f5ab1e27dfe51586..fe3ce8098df57011b3e3c183b49a37ad10945d3a 100644 (file)
@@ -20,11 +20,11 @@ standard_testfile
 proc do_tests {force_internal_tls {do_kfail_tls_access 0}} {
     clean_restart
     gdb_load $::binfile
-    if ![runto_main] {
+    if {![runto_main]} {
        return
     }
 
-    if $force_internal_tls {
+    if {$force_internal_tls} {
        gdb_test_no_output "maint set force-internal-tls-address-lookup on"
     }
 
@@ -44,7 +44,7 @@ proc do_tests {force_internal_tls {do_kfail_tls_access 0}} {
        # Also turn off do_kfail_tls_access when connected to a
        # gdbserver and we observe that accessing a TLS variable
        # works.
-       if [target_is_gdbserver] {
+       if {[target_is_gdbserver]} {
            gdb_test_multiple "print tls_tbss_1" "Check TLS accessibility when connected to a gdbserver" {
                -re -wrap "= 0" {
                    set do_kfail_tls_access 0
@@ -105,14 +105,14 @@ proc do_tests {force_internal_tls {do_kfail_tls_access 0}} {
        set binfile_stripped "${::binfile}.stripped"
        set objcopy [gdb_find_objcopy]
        set cmd "$objcopy --strip-debug ${::binfile} $binfile_stripped"
-       if ![catch "exec $cmd" cmd_output] {
+       if {![catch {exec {*}$cmd} cmd_output]} {
            clean_restart
            gdb_load $binfile_stripped
-           if ![runto_main] {
+           if {![runto_main]} {
                return
            }
 
-           if $force_internal_tls {
+           if {$force_internal_tls} {
                gdb_test_no_output "maint set force-internal-tls-address-lookup on"
            }
 
@@ -153,7 +153,7 @@ proc do_tests {force_internal_tls {do_kfail_tls_access 0}} {
     }
 
     # Finish test early if no core file was made.
-    if !$core_supported {
+    if {!$core_supported} {
        return
     }
 
@@ -166,7 +166,7 @@ proc do_tests {force_internal_tls {do_kfail_tls_access 0}} {
     }
 
     with_test_prefix "core file" {
-       if $force_internal_tls {
+       if {$force_internal_tls} {
            gdb_test_no_output "maint set force-internal-tls-address-lookup on"
        }
 
index 995cd4d027a3a8aaea7320ead124c8bc9f2b4265..83d271db5bd26a2e6db29ddc5df06bee1e97b3ab 100644 (file)
@@ -48,4 +48,4 @@ if {[runto_main]} {
 
     gdb_test "step" "nothing \\(\\) at.*"
 }
-remote_exec build "rm -f twice.c" 
+remote_exec build "rm -f twice.c"
index 24742b81db8c6a7a1e5c00530f2e76104726acc4..c758697e5ddda89d9bea2b2b175266333e2adcd2 100644 (file)
@@ -20,7 +20,7 @@ if { [prepare_for_testing "failed to prepare" ui-redirect start.c] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 9d8d097c5adca0ca980f3524e2ea5fc3097f8a0c..bd327a107d3c14acb8af1693dcae06b545b23804 100644 (file)
@@ -22,7 +22,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile nodebug]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return 0
 }
 
index cc28adcea29133ea19b391be90513590adf3c9cf..4456812dadbad13bd12069d9769dbd6d4fc2f37c 100644 (file)
@@ -160,7 +160,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 51601f9cdba770daa6bf89148c4db9f11ee291a4..0e307d38ed4e71453c027a6983f043bc07b4037e 100644 (file)
@@ -27,7 +27,7 @@ lappend srcfile_flags nopie
 
 set ldflags $srcfile_flags
 
-if [info exists COMPILE] {
+if {[info exists COMPILE]} {
     # Make sure that we use .eh_frame info, by generating it
     # using -fasynchronous-unwind-tables.
     if { [gdb_can_simple_compile fasynchronous-unwind-tables \
index c874930942e0c5a993fdd583c2cdd9f0202cd69b..08944f9e7bcd2e58694f08e1193f2cca911297bc 100644 (file)
@@ -24,7 +24,7 @@ lappend srcfile_flags nopie
 set srcfile2_flags $srcfile_flags
 set ldflags $srcfile_flags
 
-if [info exists COMPILE] {
+if {[info exists COMPILE]} {
     standard_testfile unwind-on-each-insn.c unwind-on-each-insn-foo.c
     # When updating the .s file, use these flags to generate the file:
     #lappend srcfile2_flags additional_flags=-save-temps
index ad3b7021b62b19b67e4ab5ef93f44deb4a186f36..0285c54e1347c3aa651050341284ebf1bdf7cc19 100644 (file)
@@ -24,7 +24,7 @@ lappend srcfile_flags nopie
 set srcfile2_flags $srcfile_flags
 set ldflags $srcfile_flags
 
-if [info exists COMPILE] {
+if {[info exists COMPILE]} {
     standard_testfile unwind-on-each-insn.c unwind-on-each-insn-foo.c
     # When updating the .s file, use these flags to generate the file:
     #lappend srcfile2_flags additional_flags=-save-temps
index fe868e539e4b051230d46729ddd4ccaf124858c5..46078481398e03174afcf79cbc039930ae621be2 100644 (file)
@@ -36,7 +36,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} [list $srcfile]] } {
     return -1
 }
 
-if ![runto done] {
+if {![runto done]} {
     return
 }
 
index 11cd49de6e49a21e4fd6bf82eb7a1f400bdce588..3b06c1d0424d5ce68ceb2685829e66c40c26a8c7 100644 (file)
@@ -54,7 +54,7 @@ while {$loop && $continue_count < 100} {
            pass "$test (false warning)"
        }
     }
-    set continue_count [expr $continue_count + 1]
+    set continue_count [expr {$continue_count + 1}]
 }
 
 set test "p gdb_test_infcall ()"
index c3fbbb6fb1bd34434b584ccbb16a4ab54b8842c9..8395b970e3b053c736fdf9f322c9941e11fdf225 100644 (file)
@@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index b17764e690bf8382f4d2aad53b1c3fda7f1fc37d..67949539ea610fdf2798b2e3cc4c736addf5818e 100644 (file)
@@ -27,11 +27,11 @@ if {![runto_main]} {
 
 set target_char_mask [get_valueof "/u" "a.x\[0]" "255" "get target char mask"]
 set target_char_bit 0
-for {set i $target_char_mask} {$i > 0} {set i [expr $i >> 1]} {
+for {set i $target_char_mask} {$i > 0} {set i [expr {$i >> 1}]} {
     incr target_char_bit
 }
 set target_char_rank -1
-for {set i $target_char_bit} {$i > 0} {set i [expr $i >> 1]} {
+for {set i $target_char_bit} {$i > 0} {set i [expr {$i >> 1}]} {
     incr target_char_rank
 }
 
index 534971c6f5f724e51c3c6547ef49e358a84acd5e..d25ae26c6e42355d152ffb8aae3a87abd0eef3d1 100644 (file)
@@ -36,7 +36,7 @@ set allow_float_test [allow_float_test]
 set flags {}
 lappend flags debug
 lappend_include_file flags $srcdir/lib/unbuffer_output.c
-if [support_complex_tests] {
+if {[support_complex_tests]} {
     lappend flags "additional_flags=-DTEST_COMPLEX"
 }
 
@@ -56,7 +56,7 @@ gdb_test_no_output "set print address off"
 gdb_test_no_output "set width 0"
 
 
-if [gdb_skip_stdio_test "varargs.exp"] {
+if {[gdb_skip_stdio_test "varargs.exp"]} {
     # Nothing in this module is testable without printf.
     return
 }
@@ -93,7 +93,7 @@ if {$allow_float_test} {
 
 
 # Test _Complex type here if supported.
-if [support_complex_tests] {
+if {[support_complex_tests]} {
     global gdb_prompt
 
     set test "print find_max_float_real(4, fc1, fc2, fc3, fc4)"
index 4a08de3c25fd3efafa54c29488262c98aa7d2686..a11612398ee0afa5a2b750d359caad3a2b5f4457 100644 (file)
@@ -19,7 +19,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 31190970ac2ffecaf88ccec0ec26b9be82faf6cd..316043d55f64960727f7128afb25db5ce30b056d 100644 (file)
@@ -33,7 +33,7 @@ proc vla_optimized_out {exe_suffix options} {
        return -1
     }
 
-    if ![runto f1] {
+    if {![runto f1]} {
        return
     }
 
index 6db0b9a09a2a06d1cbc541655233ce0230717d06..22ac0a34bdf3573dc2b7780b007efa9059f089b6 100644 (file)
@@ -20,7 +20,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 942d1117105f61c1427b1bc85a39a1b340f15609..158ae356a2c15260983f5083017836cd17a43ccc 100644 (file)
@@ -22,7 +22,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
@@ -31,7 +31,8 @@ gdb_continue_to_breakpoint "vla-filled"
 
 # Check side effects for sizeof argument.
 set sizeof_int [get_sizeof "int" 4]
-set sizeof_vla [ expr "10" * "$sizeof_int" ]
+
+set sizeof_vla [expr {10 * $sizeof_int}]
 
 gdb_test "print sizeof (vla1\[i++\])" " = ${sizeof_int}"
 gdb_test "print i" " = 0" \
index 68f9269878a0f813471dc65865218d9b5a148a11..72af21270fc25cb1ee02ae503ade442607f33c95 100644 (file)
@@ -22,7 +22,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 35aa1cf9549e7300066b51e52febfa38306438df..e85d4154f3434904a87436ff47b52c18f3ecef6c 100644 (file)
@@ -27,7 +27,7 @@
 #           const volatile pointers to const vars
 #           const volatile pointers to volatile vars
 #           ... etc.  (you get the idea)
-# Mostly with char and unsigned char.                    
+# Mostly with char and unsigned char.
 
 #
 # test running programs
@@ -54,7 +54,7 @@ proc local_compiler_xfail_check { } {
     if {[test_compiler_info gcc-2-*]} {
        if { ![test_debug_format "HP"] \
                && ![test_debug_format "DWARF \[0-9\]"] } then {
-           setup_xfail "*-*-*" 
+           setup_xfail "*-*-*"
        }
     }
 }
index 21b60fc879586d2010e2bae7697c0c9fb3cb313d..c789c60f34a7177097365737d60323e6b2c87396 100644 (file)
@@ -27,7 +27,7 @@ if {[prepare_for_testing_full "failed to prepare" \
 # Problem does not occur otherwise.
 gdb_test_no_output "set can-use-hw-watchpoints 0"
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 3013b70f59c8d775a7718ecfca1b7d78f4940027..cdf532fd210b393a09d377872f1bd9983eeb3594 100644 (file)
@@ -22,7 +22,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
 # It is more compatible this way.
 gdb_test_no_output "set can-use-hw-watchpoints 0"
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index ba60c90a0b64da93c05a5c34db573d5ba67f50dd..906654eba494756c72dca724f51b7797dc1a08d7 100644 (file)
@@ -21,7 +21,7 @@ if { [prepare_for_testing "failed to prepare" ${test} ${srcfile}] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 994228fe3070127080801e51ea442bc97f691415..23ef746ca97ea52e31fb4ade1c9874b914388e4c 100644 (file)
@@ -158,7 +158,7 @@ proc valid_addr_p {cmd offset width} {
        # registers to represent the whole unaligned region.  Breakpoint
        # addresses must still be aligned though.
        if {$cmd == "hbreak" } {
-           if { [expr ($offset) % 4] != 0 } {
+           if {$offset % 4 != 0} {
                return 0
            }
        }
@@ -170,20 +170,20 @@ proc valid_addr_p {cmd offset width} {
            }
        } else {
            # Watchpoints can be of length 1, 2, 4 or 8 bytes.
-           if { [expr $width % 2] != 0 } {
+           if { $width % 2 != 0 } {
                return 0
            }
        }
 
-       if { [expr ($offset) % 8] == 0 && $width == 8 } {
+       if {$offset % 8 == 0 && $width == 8} {
            # If WIDTH is 8 byte, the address should be 8-byte aligned.
            return 1
-       } elseif { [expr ($offset) % 4] == 0 } {
+       } elseif {$offset % 4 == 0} {
            return 1
-       } elseif { [expr ($offset) % 4] == 2 && $width == 2 } {
+       } elseif {$offset % 4 == 2 && $width == 2} {
            # Halfword watchpoints and breakpoints.
            return 1
-       } elseif { [expr ($offset) % 4] == 1 && $width == 1 && $cmd != "hbreak" } {
+       } elseif {$offset % 4 == 1 && $width == 1 && $cmd != "hbreak"} {
            # Single byte watchpoints.
            return 1
        } else {
@@ -249,7 +249,7 @@ proc run_watchpoints_tests {hw_wp_p} {
                    for {set x 0} {$x < 4} {incr x} {
 
                        if { ![valid_addr_p $cmd1 $x $width]
-                            || ![valid_addr_p $cmd2 $x+1 $width] } {
+                            || ![valid_addr_p $cmd2 [expr {$x+1}] $width] } {
                            # Skip tests if requested address or length
                            # of breakpoint or watchpoint don't meet
                            # target or kernel requirements.
index 04c4c5273dfb61a4bde88b4439062492ffaf1314..61c1f8cceece9ea7757e714049c96da8c2bd8615 100644 (file)
@@ -22,7 +22,7 @@ set allow_hw_watchpoint_tests_p [allow_hw_watchpoint_tests]
 
 standard_testfile
 
-if [build_executable "failed to prepare" $testfile $srcfile {debug}] {
+if {[build_executable "failed to prepare" $testfile $srcfile {debug}]} {
     return -1
 }
 
@@ -87,7 +87,7 @@ proc test {stop_mode hw} {
     # sufficient time to ever wrap around.)
     gdb_assert {$val1 != $val2} "values are different"
 
-    set wp_str [expr ($hw)?"Hardware watchpoint":"Watchpoint"]
+    set wp_str [expr {($hw)?"Hardware watchpoint":"Watchpoint"}]
 
     # Now set a watchpoint, while the inferior is running.  Since
     # we're watching a global, and we can read global memory while the
@@ -130,7 +130,7 @@ foreach hw {0 1} {
        continue
     }
     foreach stop_mode {all-stop non-stop} {
-       set wp_type [expr ($hw)?"hardware":"software"]
+       set wp_type [expr {($hw)?"hardware":"software"}]
        with_test_prefix "$stop_mode: $wp_type" {
            test $stop_mode $hw
        }
index 85b1eb7a9a2d455d88e7d1eeedea293817be8e50..13dcfbad0b5dc5376ca7bf0eefe86d97cb8c8d15 100644 (file)
@@ -24,7 +24,7 @@ if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
@@ -43,14 +43,14 @@ if {[istarget "s390*-*-*"]} {
 
 foreach wpsize $sizes {
     for {set wpoffset 0} {$wpoffset < 8 / $wpsize} {incr wpoffset} {
-       set wpstart [expr $wpoffset * $wpsize]
-       set wpend [expr ($wpoffset + 1) * $wpsize]
+       set wpstart [expr {$wpoffset * $wpsize}]
+       set wpend [expr {($wpoffset + 1) * $wpsize}]
        set wpendaligned $alignedend($wpend)
        foreach rdsize $sizes {
            for {set rdoffset 0} {$rdoffset < 8 / $rdsize} {incr rdoffset} {
-               set rdstart [expr $rdoffset * $rdsize]
-               set rdend [expr ($rdoffset + 1) * $rdsize]
-               set expect_hit [expr max ($wpstart, $rdstart) < min ($wpend, $rdend)]
+               set rdstart [expr {$rdoffset * $rdsize}]
+               set rdend [expr {($rdoffset + 1) * $rdsize}]
+               set expect_hit [expr {max ($wpstart, $rdstart) < min ($wpend, $rdend)}]
                set test "$rwatch data.u.size$wpsize\[$wpoffset\]"
                set wpnum ""
                gdb_test_multiple $test $test {
@@ -88,7 +88,7 @@ foreach wpsize $sizes {
                    if {$expect_hit == 0 && $rdstart < $wpendaligned} {
                        setup_xfail external/20207 "aarch64*-*-linux*"
                    }
-                   if {!$expect_hit && [expr max ($wpstart / 8, $rdstart / 8) < min (($wpend + 7) / 8, ($rdend + 7) / 8)]} {
+                   if {!$expect_hit && max ($wpstart / 8, $rdstart / 8) < min (($wpend + 7) / 8, ($rdend + 7) / 8)} {
                        setup_xfail breakpoints/23131 "powerpc*-*-*"
                    }
                    fail $test
@@ -139,7 +139,7 @@ foreach_with_prefix wpcount {4 7} {
        }
     }
     set test "wpcount($wpcount)"
-    if {!$wpoffset_to_wpnum([expr $wpcount - 1])} {
+    if {!$wpoffset_to_wpnum([expr {$wpcount - 1}])} {
        untested $test
        continue
     }
@@ -168,7 +168,7 @@ proc size8twice { function cmd offset index } {
        "Breakpoint $::decimal at $::hex" "$bp_src_string"
 
     # Set a hardware watchpoint.
-    set watch_index [expr $offset + $index]
+    set watch_index [expr {$offset + $index}]
     set test "$cmd data.u.size8twice\[$watch_index\]"
     set wpnum 0
     gdb_test_multiple $test "" {
index fba8ac6ed507edb50b78c97381113047f684ff85..7a5a96aac586adc8b9059ef659b104a14ad12098 100644 (file)
@@ -55,23 +55,23 @@ proc initialize {} {
     global decimal
     global srcfile
 
-    if [gdb_test "break marker1" "Breakpoint 1 at $hex: file .*$srcfile, line $decimal.*" "set breakpoint at marker1" ] { 
+    if {[gdb_test "break marker1" "Breakpoint 1 at $hex: file .*$srcfile, line $decimal.*" "set breakpoint at marker1" ]} {
       return 0
     }
 
 
-    if [gdb_test "break marker2" "Breakpoint 2 at $hex: file .*$srcfile, line $decimal.*" "set breakpoint at marker2" ] { 
+    if {[gdb_test "break marker2" "Breakpoint 2 at $hex: file .*$srcfile, line $decimal.*" "set breakpoint at marker2" ]} {
       return 0
     }
 
 
-    if [gdb_test "info break" "1\[ \]*breakpoint.*marker1.*\r\n2\[ \]*breakpoint.*marker2.*" "info break" ] {
+    if {[gdb_test "info break" "1\[ \]*breakpoint.*marker1.*\r\n2\[ \]*breakpoint.*marker2.*" "info break" ]} {
       return 0
     }
 
     gdb_test "watch ival3" ".*\[Ww\]atchpoint 3: ival3.*" "set watchpoint on ival3"
 
-    if [gdb_test "info watch" "3\[ \]*.*watchpoint.*ival3" "watchpoint found in watchpoint/breakpoint table" ] { 
+    if {[gdb_test "info watch" "3\[ \]*.*watchpoint.*ival3" "watchpoint found in watchpoint/breakpoint table" ]} {
       return 0
     }
 
@@ -80,7 +80,7 @@ proc initialize {} {
     # to use it.  This allows the test program to run at full speed until
     # we get to the first marker function.
 
-    if [gdb_test_no_output "disable 3" "disable watchpoint" ] {
+    if {[gdb_test_no_output "disable 3" "disable watchpoint" ]} {
       return 0
     }
 
@@ -99,8 +99,8 @@ proc test_simple_watchpoint {} {
 
     # Ensure that the watchpoint is disabled when we startup.
 
-    if [gdb_test_no_output "disable 3" \
-           "disable watchpoint in test_simple_watchpoint" ] {
+    if {[gdb_test_no_output "disable 3" \
+            "disable watchpoint in test_simple_watchpoint" ]} {
       return 0
     }
 
@@ -121,7 +121,7 @@ proc test_simple_watchpoint {} {
 
     # After reaching the marker function, enable the watchpoint.
 
-    if [gdb_test_no_output "enable 3" "enable watchpoint" ] {
+    if {[gdb_test_no_output "enable 3" "enable watchpoint" ]} {
       return
     }
 
@@ -165,7 +165,7 @@ Continuing.*\[Ww\]atchpoint.*ival3.*Old value = -1.*New value = 0.*ival3 = count
 
     # Check that the hit count is reported correctly
     gdb_test "info break" ".*watchpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+ival3\r\n\[ \t]+breakpoint already hit 3 times.*" "watchpoint hit count is 3"
-    
+
     # Continue until the next change, from 2 to 3.
     gdb_test "cont" "Continuing.*\[Ww\]atchpoint.*ival3.*Old value = 2.*New value = 3.*ival3 = count; ival4 = count;.*" "watchpoint hit, fourth time"
 
@@ -188,14 +188,14 @@ Continuing.*\[Ww\]atchpoint.*ival3.*Old value = -1.*New value = 0.*ival3 = count
 
     # Disable the watchpoint so we run at full speed until we exit.
 
-    if [gdb_test_no_output "disable 3" "watchpoint disabled" ] {
+    if {[gdb_test_no_output "disable 3" "watchpoint disabled" ]} {
       return
     }
 
 
     # Run until process exits.
 
-    if [target_info exists gdb,noresults] { return }
+    if {[target_info exists gdb,noresults]} { return }
 
     gdb_continue_to_end "continue to exit in test_simple_watchpoint"
 }
@@ -213,8 +213,8 @@ proc test_disabling_watchpoints {} {
 
     # Ensure that the watchpoint is disabled when we startup.
 
-    if [gdb_test_no_output "disable 3" \
-           "disable watchpoint in test_disabling_watchpoints" ] {
+    if {[gdb_test_no_output "disable 3" \
+            "disable watchpoint in test_disabling_watchpoints" ]} {
       return 0
     }
 
@@ -236,7 +236,7 @@ proc test_disabling_watchpoints {} {
 
     # After reaching the marker function, enable the watchpoint.
 
-    if [gdb_test_no_output "enable 3" "watchpoint enabled" ] {
+    if {[gdb_test_no_output "enable 3" "watchpoint enabled" ]} {
       return
     }
 
@@ -245,14 +245,14 @@ proc test_disabling_watchpoints {} {
     # Don't check the old value, because on VxWorks the variable value
     # will not have been reinitialized.
     gdb_test "cont" "Continuing.*\[Ww\]atchpoint.*ival3.*Old value = .*New value = 0.*ival3 = count; ival4 = count;.*" "watchpoint hit in test_disabling_watchpoints, first time"
-    
+
     # Continue until the next change, from 0 to 1.
     gdb_test "cont" "Continuing.*\[Ww\]atchpoint.*ival3.*Old value = 0.*New value = 1.*ival3 = count; ival4 = count;.*" "watchpoint hit in test_disabling_watchpoints, second time"
-    
+
     # Disable the watchpoint but leave breakpoints
 
-    if [gdb_test_no_output "disable 3" \
-           "disable watchpoint #2 in test_disabling_watchpoints" ] {
+    if {[gdb_test_no_output "disable 3" \
+            "disable watchpoint #2 in test_disabling_watchpoints" ]} {
       return 0
     }
 
@@ -265,8 +265,8 @@ proc test_disabling_watchpoints {} {
     # Make sure we hit no more watchpoints.
     gdb_test "cont" "Continuing.*Breakpoint.*marker2 \\(\\).*" \
        "disabled watchpoint skipped"
-    
-    if [target_info exists gdb,noresults] { return }
+
+    if {[target_info exists gdb,noresults]} { return }
 
     gdb_continue_to_end "continue to exit in test_disabling_watchpoints"
 }
@@ -286,7 +286,7 @@ proc test_stepping {} {
        gdb_test "p func1 ()" "= 73" \
            "calling function with watchpoint enabled"
 
-       # 
+       #
        # "finish" brings us back to main.
        # On some targets (e.g. alpha) gdb will stop from the finish in midline
        # of the marker1 call. This is due to register restoring code on
@@ -357,7 +357,7 @@ proc test_watchpoint_triggered_in_syscall {} {
     global gdb_prompt
 
     # These tests won't work without printf support.
-    if [gdb_skip_stdio_test "watchpoints triggered in syscall"] {
+    if {[gdb_skip_stdio_test "watchpoints triggered in syscall"]} {
        return
     }
     # Run until we get to the first marker function.
@@ -391,10 +391,10 @@ proc test_watchpoint_triggered_in_syscall {} {
 
        set test "sent 123"
        gdb_test_multiple "123" $test {
-           -re ".*\[Ww\]atchpoint.*buf\\\[0\\\].*Old value = 0.*New value = 49\[^\n\]*\n" { set x [expr $x+1] ; exp_continue }
-           -re ".*\[Ww\]atchpoint.*buf\\\[1\\\].*Old value = 0.*New value = 50\[^\n\]*\n" { set x [expr $x+1] ; exp_continue }
-           -re ".*\[Ww\]atchpoint.*buf\\\[2\\\].*Old value = 0.*New value = 51\[^\n\]*\n" { set x [expr $x+1] ; exp_continue }
-           -re ".*\[Ww\]atchpoint.*buf\\\[3\\\].*Old value = 0.*New value = 10\[^\n\]*\n" { set x [expr $x+1] ; exp_continue }
+           -re ".*\[Ww\]atchpoint.*buf\\\[0\\\].*Old value = 0.*New value = 49\[^\n\]*\n" { set x [expr {$x+1}] ; exp_continue }
+           -re ".*\[Ww\]atchpoint.*buf\\\[1\\\].*Old value = 0.*New value = 50\[^\n\]*\n" { set x [expr {$x+1}] ; exp_continue }
+           -re ".*\[Ww\]atchpoint.*buf\\\[2\\\].*Old value = 0.*New value = 51\[^\n\]*\n" { set x [expr {$x+1}] ; exp_continue }
+           -re ".*\[Ww\]atchpoint.*buf\\\[3\\\].*Old value = 0.*New value = 10\[^\n\]*\n" { set x [expr {$x+1}] ; exp_continue }
            -re ".*$gdb_prompt $" { pass $test }
        }
 
@@ -402,27 +402,27 @@ proc test_watchpoint_triggered_in_syscall {} {
        # should have printed.
        set test "print buf\[0\]"
        gdb_test_multiple $test $test {
-           -re ".*= 49.*$gdb_prompt $" { set y [expr $y+1]; pass $test }
+           -re ".*= 49.*$gdb_prompt $" { set y [expr {$y+1}]; pass $test }
            -re ".*= 0.*$gdb_prompt $" { $test }
        }
        set test "print buf\[1\]"
        gdb_test_multiple $test $test {
-           -re ".*= 50.*$gdb_prompt $" { set y [expr $y+1]; pass $test }
+           -re ".*= 50.*$gdb_prompt $" { set y [expr {$y+1}]; pass $test }
            -re ".*= 0.*$gdb_prompt $" { pass $test }
        }
        set test "print buf\[2\]"
        gdb_test_multiple $test $test {
-           -re ".*= 51.*$gdb_prompt $" { set y [expr $y+1]; pass $test }
+           -re ".*= 51.*$gdb_prompt $" { set y [expr {$y+1}]; pass $test }
            -re ".*= 0.*$gdb_prompt $" { pass $test }
        }
        set test "print buf\[3\]"
        gdb_test_multiple $test $test {
-           -re ".*= 10.*$gdb_prompt $" { set y [expr $y+1]; pass $test }
+           -re ".*= 10.*$gdb_prompt $" { set y [expr {$y+1}]; pass $test }
            -re ".*= 0.*$gdb_prompt $" { pass $test }
        }
 
        # Did we find what we were looking for?  If not, flunk it.
-       if {[expr $x==$y]} { pass $testname } else { fail "$testname (only triggered $x watchpoints, expected $y)"}
+       if {$x==$y} { pass $testname } else { fail "$testname (only triggered $x watchpoints, expected $y)"}
 
        # Continue until we hit the finishing marker function.
        # Make sure we hit no more watchpoints.
@@ -432,7 +432,7 @@ proc test_watchpoint_triggered_in_syscall {} {
        # Disable everything so we can finish the program at full speed
        gdb_test_no_output "disable" "disable in test_watchpoint_triggered_in_syscall"
 
-       if [target_info exists gdb,noresults] { return }
+       if {[target_info exists gdb,noresults]} { return }
 
        gdb_continue_to_end "continue to exit in test_watchpoint_triggered_in_syscall"
     }
@@ -567,7 +567,7 @@ proc test_complex_watchpoint {} {
        # Disable everything so we can finish the program at full speed
        gdb_test_no_output "disable" "disable in test_complex_watchpoint, second time"
 
-       if [target_info exists gdb,noresults] { return }
+       if {[target_info exists gdb,noresults]} { return }
 
        gdb_continue_to_end "continue to exit in test_complex_watchpoint"
     }
@@ -941,7 +941,7 @@ proc test_watch_register_location {} {
 # Start with a fresh gdb.
 
 set prev_timeout $timeout
-set timeout 600        
+set timeout 600
 verbose "Timeout now 600 sec.\n"
 
 test_no_hw_watchpoints
@@ -964,7 +964,7 @@ proc do_tests {} {
 
        test_disabling_watchpoints
 
-       if ![target_info exists gdb,cannot_call_functions] {
+       if {![target_info exists gdb,cannot_call_functions]} {
            test_stepping
        }
     }
@@ -978,9 +978,9 @@ proc do_tests {} {
            "disable fast watches, 2"
     }
 
-    # Only enabled for some targets merely because it has not been tested 
+    # Only enabled for some targets merely because it has not been tested
     # elsewhere.
-    # On sparc-sun-sunos4.1.3, GDB was running all the way to the marker4 
+    # On sparc-sun-sunos4.1.3, GDB was running all the way to the marker4
     # breakpoint before stopping for the watchpoint.  I don't know why.
     if {[istarget "hppa*-*-*"]} {
        test_watchpoint_triggered_in_syscall
index d8e4d63a57c0caf9f15089068ed10197151b83f3..0d213151bb75881843bc0db1e9068c366675b472 100644 (file)
@@ -94,13 +94,13 @@ with_test_prefix "before inferior start" {
     gdb_test "info break" ".*watchpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+ival1\r\n\[ \t]+breakpoint already hit 3 times.*" "watchpoint ival1 hit count is 3"
     # Disable ival1 watchpoint
     gdb_test_no_output "disable 2" ""
+
     # Continue until the next change, from 1 to 2.
     gdb_test "cont" "Continuing.*\[Ww\]atchpoint.*ival3.*Old value = 1.*New value = 2.*ival3 = count; ival4 = count;.*" "watchpoint hit, third time"
 
     # Check that the hit count is reported correctly
     gdb_test "info break" ".*watchpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+ival3\r\n\[ \t]+breakpoint already hit 3 times.*" "watchpoint hit count is 3"
-    
+
     # Continue until the next change, from 2 to 3.
     gdb_test "cont" "Continuing.*\[Ww\]atchpoint.*ival3.*Old value = 2.*New value = 3.*ival3 = count; ival4 = count;.*" "watchpoint hit, fourth time"
 
index 7b2ff0e0a85a3cffc80aba74470e7cc7377726a2..ffcfc4431075da4a24e82182e2a751b078c6f335 100644 (file)
@@ -23,7 +23,7 @@
 # computing the value, but just the type
 # of the result. It goes through the evaluate_subexp_standard
 # with the EVAL_AVOID_SIDE_EFFECTS flag rather than EVAL_NORMAL
-# 
+#
 
 #
 # test running programs
index 3709cff9204e46ebbc15148f7e9041a5b98a57ed..744c6ee999e7d0cfbf99f4039625c2e05ed3715f 100644 (file)
@@ -30,7 +30,7 @@ standard_testfile
 proc prepare {lang} {
     global srcfile testfile
 
-    if [target_info exists no_long_long] {
+    if {[target_info exists no_long_long]} {
        set options [list debug additional_flags=-DNO_LONG_LONG]
     } else {
        set options [list debug]
index 10f5320d5917af2200b0b31b344df932e78784ca..5fa29af4c65194fb22956ba9243b5bc1b70745d9 100644 (file)
@@ -19,7 +19,7 @@
 # test running programs
 #
 
-if [target_info exists no_long_long] {
+if {[target_info exists no_long_long]} {
     set exec_opts [list debug additional_flags=-DNO_LONG_LONG]
 } else {
     set exec_opts [list debug]
@@ -122,7 +122,7 @@ proc do_test {dir options} {
        "whatis unsigned long"
 
 
-    if ![target_info exists no_long_long] {
+    if {![target_info exists no_long_long]} {
        gdb_test "whatis v_unsigned_long_long" \
            "type = (unsigned long long|long long unsigned int)" \
            "whatis unsigned long long"
@@ -192,7 +192,7 @@ proc do_test {dir options} {
        "type = (unsigned (int|long|long int)|long unsigned int) \\\[2\\\]" \
        "whatis unsigned long array"
 
-    if ![target_info exists no_long_long] {
+    if {![target_info exists no_long_long]} {
        gdb_test "whatis v_unsigned_long_long_array" \
            "type = (unsigned long long|long long unsigned int) \\\[2\\\]" \
            "whatis unsigned long long array"
@@ -260,7 +260,7 @@ proc do_test {dir options} {
        "type = (unsigned (int|long|long int)|long unsigned int) \\*" \
        "whatis unsigned long pointer"
 
-    if ![target_info exists no_long_long] {
+    if {![target_info exists no_long_long]} {
        gdb_test "whatis v_long_long_pointer" \
            "type = long long(| int) \\*" \
            "whatis long long pointer"
@@ -464,7 +464,7 @@ proc do_test {dir options} {
            "type = (unsigned (int|long|long int)|long unsigned int) \\($void\\)" \
            "whatis unsigned long function"
 
-       if ![target_info exists no_long_long] {
+       if {![target_info exists no_long_long]} {
            gdb_test "whatis v_long_long_func" \
                "type = long long(| int) \\($void\\)" \
                "whatis long long function"
index d766e5d3b8f490e46efc3d53b3b15377687cf8f4..eb1c85a5160e0f49e1b7a67d3266ad02f3889ca5 100644 (file)
@@ -214,7 +214,7 @@ with_test_prefix "run control" {
     clean_restart
     gdb_load $binfile
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return
     }
 
index 2ba212310600106816eccc9cb0131dd929820f97..f76358863fbe2e6a00db13bf2c4484c63d570185 100644 (file)
@@ -30,11 +30,11 @@ proc fill_line { width } {
 
     # Take into account that the prompt also takes space.
     set prefix [string length "(gdb) "]
-    set start [expr $prefix + 1]
+    set start [expr {$prefix + 1}]
 
     # Print chars.
     for { set i $start } { $i <= $width } { incr i } {
-       set c [expr $i % 10]
+       set c [expr {$i % 10}]
        send_gdb $c
        append res $c
     }
@@ -93,7 +93,7 @@ proc test_wrap { width_auto_detected } {
     if { $wrap_mode == $wrap_mode_terminal } {
        gdb_assert { $gdb_width == $readline_width }
     } elseif { $wrap_mode == $wrap_mode_readline } {
-       gdb_assert { $gdb_width == [expr $readline_width + 1] }
+       gdb_assert { $gdb_width == [expr {$readline_width + 1}] }
     } else {
        set have_wrap 0
     }
index fc4e9d5517de200617d226e313e786ad42dd07b7..56efd291bd9c6edf41b72bcd9523fa6a6b654b75 100644 (file)
@@ -42,7 +42,7 @@ if {[gdb_compile \
 
 clean_restart ${main_testfile}
 
-if ![runto opaque_routine] {
+if {![runto opaque_routine]} {
     untested "could not run to opaque_routine"
     return -1
 }