[binutils-gdb] [gdb/testsuite, tclint] Fix gdb.base
Tom de Vries
vries@sourceware.org
Tue Sep 30 19:33:25 GMT 2025
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=738dcb95cce28f54d9de7e45e94515b64a0c6f36
commit 738dcb95cce28f54d9de7e45e94515b64a0c6f36
Author: Tom de Vries <tdevries@suse.de>
Date: Tue Sep 30 21:32:50 2025 +0200
[gdb/testsuite, tclint] Fix gdb.base
Running tclint on the test-cases in gdb.base shows a few problems.
Fix these.
Diff:
---
gdb/tclint.toml | 1 -
gdb/testsuite/gdb.base/a2-run.exp | 2 +-
gdb/testsuite/gdb.base/access-mem-running.exp | 4 +-
.../gdb.base/advance-until-multiple-locations.exp | 12 +-
gdb/testsuite/gdb.base/advance.exp | 2 +-
gdb/testsuite/gdb.base/all-architectures.exp.tcl | 8 +-
gdb/testsuite/gdb.base/all-bin.exp | 2 +-
gdb/testsuite/gdb.base/annota1.exp | 12 +-
gdb/testsuite/gdb.base/annota3.exp | 10 +-
gdb/testsuite/gdb.base/args.exp | 4 +-
gdb/testsuite/gdb.base/argv0-symlink.exp | 6 +-
gdb/testsuite/gdb.base/arithmet.exp | 4 +-
gdb/testsuite/gdb.base/asmlabel.exp | 2 +-
gdb/testsuite/gdb.base/assign.exp | 2 +-
gdb/testsuite/gdb.base/async.exp | 2 +-
gdb/testsuite/gdb.base/attach-pie-misread.exp | 18 +-
gdb/testsuite/gdb.base/attach-pie-noexec.exp | 2 +-
gdb/testsuite/gdb.base/attach.exp | 36 ++--
gdb/testsuite/gdb.base/auxv.exp | 2 +-
gdb/testsuite/gdb.base/basic-edit-cmd.exp | 2 +-
gdb/testsuite/gdb.base/batch-exit-status.exp | 2 +-
.../gdb.base/batch-preserve-term-settings.exp | 24 +--
gdb/testsuite/gdb.base/bfd-errors.exp | 28 +--
gdb/testsuite/gdb.base/bfp-test.exp | 2 +-
gdb/testsuite/gdb.base/bg-execution-repeat.exp | 2 +-
gdb/testsuite/gdb.base/bigcore.exp | 4 +-
gdb/testsuite/gdb.base/bitfields.exp | 2 +-
gdb/testsuite/gdb.base/bitfields2.exp | 8 +-
gdb/testsuite/gdb.base/bitops.exp | 2 +-
gdb/testsuite/gdb.base/bitshift.exp | 1 +
gdb/testsuite/gdb.base/bp-permanent.exp | 6 +-
gdb/testsuite/gdb.base/branch-to-self.exp | 4 +-
gdb/testsuite/gdb.base/break-caller-line.exp | 2 +-
gdb/testsuite/gdb.base/break-entry.exp | 2 +-
gdb/testsuite/gdb.base/break-idempotent.exp | 2 +-
gdb/testsuite/gdb.base/break-interp.exp | 42 ++---
.../gdb.base/break-main-file-remove-fail.exp | 4 +-
gdb/testsuite/gdb.base/break.exp | 2 +-
gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp | 4 +-
gdb/testsuite/gdb.base/breakpoint-shadow.exp | 4 +-
gdb/testsuite/gdb.base/bt-on-fatal-signal.exp | 2 +-
gdb/testsuite/gdb.base/call-ar-st.exp | 38 ++--
gdb/testsuite/gdb.base/call-rt-st.exp | 18 +-
gdb/testsuite/gdb.base/call-sc.exp | 18 +-
gdb/testsuite/gdb.base/call-strs.exp | 20 +--
gdb/testsuite/gdb.base/callfuncs.exp | 36 ++--
gdb/testsuite/gdb.base/cast-indirection.exp | 2 +-
gdb/testsuite/gdb.base/catch-fork-kill.exp | 2 +-
.../gdb.base/catch-gdb-caused-signals.exp | 4 +-
gdb/testsuite/gdb.base/catch-syscall.exp | 2 +-
gdb/testsuite/gdb.base/charset.exp | 8 +-
gdb/testsuite/gdb.base/chng-syms.exp | 16 +-
gdb/testsuite/gdb.base/code-expr.exp | 2 +-
gdb/testsuite/gdb.base/commands.exp | 10 +-
gdb/testsuite/gdb.base/compare-sections.exp | 2 +-
gdb/testsuite/gdb.base/completion.exp | 4 +-
gdb/testsuite/gdb.base/comprdebug.exp | 2 +-
gdb/testsuite/gdb.base/cond-eval-mode.exp | 2 +-
gdb/testsuite/gdb.base/cond-expr.exp | 2 +-
gdb/testsuite/gdb.base/condbreak-bad.exp | 2 +-
gdb/testsuite/gdb.base/condbreak.exp | 8 +-
gdb/testsuite/gdb.base/consecutive-step-over.exp | 2 +-
gdb/testsuite/gdb.base/constvars.exp | 4 +-
.../gdb.base/continue-after-aborted-step-over.exp | 4 +-
.../gdb.base/continue-all-already-running.exp | 2 +-
.../gdb.base/coredump-filter-build-id.exp | 2 +-
gdb/testsuite/gdb.base/corefile-buildid.exp | 2 +-
gdb/testsuite/gdb.base/corefile-exec-context.exp | 2 +-
gdb/testsuite/gdb.base/corefile.exp | 4 +-
gdb/testsuite/gdb.base/ctf-ptype.exp | 2 +-
gdb/testsuite/gdb.base/ctxobj.exp | 2 +-
gdb/testsuite/gdb.base/dcache-flush.exp | 2 +-
gdb/testsuite/gdb.base/dcache-line-read-error.exp | 4 +-
gdb/testsuite/gdb.base/debug-expr.exp | 2 +-
gdb/testsuite/gdb.base/debug-frame.exp | 2 +-
gdb/testsuite/gdb.base/default.exp | 54 +++---
gdb/testsuite/gdb.base/detach-sysroot-target.exp | 2 +-
gdb/testsuite/gdb.base/disasm-end-cu.exp | 2 +-
gdb/testsuite/gdb.base/disasm-optim.exp | 2 +-
gdb/testsuite/gdb.base/displaced-step-closure.exp | 2 +-
gdb/testsuite/gdb.base/display.exp | 4 +-
gdb/testsuite/gdb.base/dlmopen.exp | 2 +-
gdb/testsuite/gdb.base/dprintf-bp-same-addr.exp | 6 +-
gdb/testsuite/gdb.base/dprintf-detach.exp | 6 +-
gdb/testsuite/gdb.base/dprintf-next.exp | 6 +-
gdb/testsuite/gdb.base/dprintf-non-stop.exp | 6 +-
gdb/testsuite/gdb.base/dprintf.exp | 12 +-
gdb/testsuite/gdb.base/dtrace-probe.exp | 8 +-
gdb/testsuite/gdb.base/dump.exp | 16 +-
gdb/testsuite/gdb.base/dup-sect.exp | 4 +-
gdb/testsuite/gdb.base/ena-dis-br.exp | 2 +-
gdb/testsuite/gdb.base/endianity.exp | 4 +-
gdb/testsuite/gdb.base/ending-run.exp | 24 +--
gdb/testsuite/gdb.base/errno.exp | 10 +-
gdb/testsuite/gdb.base/eu-strip-infcall.exp | 2 +-
gdb/testsuite/gdb.base/eval-avoid-side-effects.exp | 2 +-
gdb/testsuite/gdb.base/eval-skip.exp | 2 +-
gdb/testsuite/gdb.base/examine-backward.exp | 4 +-
gdb/testsuite/gdb.base/execution-termios.exp | 4 +-
gdb/testsuite/gdb.base/expand-psymtabs.exp | 2 +-
gdb/testsuite/gdb.base/exprs.exp | 10 +-
gdb/testsuite/gdb.base/fileio.exp | 8 +-
gdb/testsuite/gdb.base/filename-completion.exp | 6 +-
gdb/testsuite/gdb.base/find-unmapped.exp | 2 +-
gdb/testsuite/gdb.base/find.exp | 2 +-
gdb/testsuite/gdb.base/finish-pretty.exp | 2 +-
gdb/testsuite/gdb.base/foll-fork.exp | 4 +-
gdb/testsuite/gdb.base/foll-vfork.exp | 2 +-
.../gdb.base/fork-print-inferior-events.exp | 2 +-
gdb/testsuite/gdb.base/fortran-sym-case.exp | 2 +-
gdb/testsuite/gdb.base/frame-selection.exp | 2 +-
gdb/testsuite/gdb.base/fullname.exp | 2 +-
gdb/testsuite/gdb.base/fullpath-expand.exp | 2 +-
gdb/testsuite/gdb.base/func-ptr.exp | 2 +-
gdb/testsuite/gdb.base/funcargs.exp | 14 +-
gdb/testsuite/gdb.base/gcore-memory-usage.exp | 4 +-
gdb/testsuite/gdb.base/gcore-relro-pie.exp | 4 +-
gdb/testsuite/gdb.base/gcore-relro.exp | 2 +-
gdb/testsuite/gdb.base/gcore-tls-pie.exp | 4 +-
gdb/testsuite/gdb.base/gcore.exp | 12 +-
gdb/testsuite/gdb.base/gdb-sigterm.exp | 4 +-
gdb/testsuite/gdb.base/gdb1555.exp | 8 +-
gdb/testsuite/gdb.base/gdb1821.exp | 4 +-
gdb/testsuite/gdb.base/gnu-debugdata.exp | 2 +-
gdb/testsuite/gdb.base/hbreak-unmapped.exp | 2 +-
gdb/testsuite/gdb.base/hbreak.exp | 2 +-
gdb/testsuite/gdb.base/hbreak2.exp | 2 +-
gdb/testsuite/gdb.base/huge.exp | 6 +-
.../gdb.base/hw-sw-break-same-address.exp | 2 +-
gdb/testsuite/gdb.base/included.exp | 2 +-
gdb/testsuite/gdb.base/index-cache.exp | 4 +-
.../gdb.base/infcall-nested-structs.exp.tcl | 6 +-
gdb/testsuite/gdb.base/inferior-args.exp | 4 +-
gdb/testsuite/gdb.base/inferior-died.exp | 2 +-
gdb/testsuite/gdb.base/info-macros.exp | 2 +-
gdb/testsuite/gdb.base/info-os.exp | 2 +-
gdb/testsuite/gdb.base/info-shared.exp | 2 +-
gdb/testsuite/gdb.base/info_sources.exp | 2 +-
gdb/testsuite/gdb.base/info_sources_2.exp | 4 +-
.../gdb.base/infoline-reloc-main-from-zero.exp | 2 +-
gdb/testsuite/gdb.base/interrupt-daemon.exp | 2 +-
gdb/testsuite/gdb.base/interrupt-noterm.exp | 6 +-
gdb/testsuite/gdb.base/jit-bfd-name.exp | 8 +-
gdb/testsuite/gdb.base/jit-elf-so.exp | 4 +-
gdb/testsuite/gdb.base/jit-elf.exp | 2 +-
gdb/testsuite/gdb.base/jit-reader-simple.exp | 6 +-
gdb/testsuite/gdb.base/kill-after-signal.exp | 4 +-
.../gdb.base/kill-detach-inferiors-cmd.exp | 2 +-
gdb/testsuite/gdb.base/killed-outside.exp | 2 +-
gdb/testsuite/gdb.base/langs.exp | 6 +-
gdb/testsuite/gdb.base/ldbl_e308.exp | 2 +-
gdb/testsuite/gdb.base/limited-length.exp | 2 +-
gdb/testsuite/gdb.base/line-symtabs.exp | 2 +-
gdb/testsuite/gdb.base/lineinc.exp | 10 +-
gdb/testsuite/gdb.base/list-ambiguous.exp | 4 +-
gdb/testsuite/gdb.base/list.exp | 30 ++--
gdb/testsuite/gdb.base/load-command.exp | 6 +-
gdb/testsuite/gdb.base/logical.exp | 2 +-
gdb/testsuite/gdb.base/long-inferior-output.exp | 2 +-
gdb/testsuite/gdb.base/long_long.exp | 4 +-
gdb/testsuite/gdb.base/macscp.exp | 16 +-
gdb/testsuite/gdb.base/maint.exp | 18 +-
gdb/testsuite/gdb.base/memops-watchpoint.exp | 2 +-
gdb/testsuite/gdb.base/memtag.exp | 2 +-
gdb/testsuite/gdb.base/miscexprs.exp | 4 +-
gdb/testsuite/gdb.base/morestack.exp | 2 +-
gdb/testsuite/gdb.base/moribund-step.exp | 2 +-
gdb/testsuite/gdb.base/msym-bp-shl.exp | 2 +-
gdb/testsuite/gdb.base/msym-bp.exp | 2 +-
gdb/testsuite/gdb.base/multi-forks.exp | 8 +-
gdb/testsuite/gdb.base/nested-addr.exp | 2 +-
gdb/testsuite/gdb.base/nested-subp1.exp | 4 +-
gdb/testsuite/gdb.base/nested-subp2.exp | 4 +-
gdb/testsuite/gdb.base/nested-subp3.exp | 4 +-
gdb/testsuite/gdb.base/new-ui.exp | 6 +-
gdb/testsuite/gdb.base/nodebug.exp | 20 +--
gdb/testsuite/gdb.base/noreturn-finish.exp | 2 +-
gdb/testsuite/gdb.base/noreturn-return.exp | 2 +-
gdb/testsuite/gdb.base/nostdlib.exp | 4 +-
gdb/testsuite/gdb.base/offsets.exp | 2 +-
gdb/testsuite/gdb.base/opaque.exp | 4 +-
gdb/testsuite/gdb.base/options.exp | 6 +-
gdb/testsuite/gdb.base/overlays.exp | 22 +--
.../gdb.base/paginate-execution-startup.exp | 4 +-
gdb/testsuite/gdb.base/parse_number.exp | 18 +-
gdb/testsuite/gdb.base/pending.exp | 6 +-
gdb/testsuite/gdb.base/pie-execl.exp | 4 +-
gdb/testsuite/gdb.base/pie-fork.exp | 4 +-
gdb/testsuite/gdb.base/pointers.exp | 20 +--
gdb/testsuite/gdb.base/pr10179.exp | 2 +-
gdb/testsuite/gdb.base/prelink.exp | 10 +-
gdb/testsuite/gdb.base/pretty-array.exp | 2 +-
gdb/testsuite/gdb.base/pretty-print.exp | 2 +-
gdb/testsuite/gdb.base/print-file-var.exp | 4 +-
gdb/testsuite/gdb.base/print-internal-string.exp | 2 +-
gdb/testsuite/gdb.base/print-symbol-loading.exp | 4 +-
gdb/testsuite/gdb.base/printcmds.exp | 24 +--
gdb/testsuite/gdb.base/ptr-typedef.exp | 2 +-
gdb/testsuite/gdb.base/ptype.exp | 32 ++--
gdb/testsuite/gdb.base/radix.exp | 18 +-
gdb/testsuite/gdb.base/randomize.exp | 4 +-
gdb/testsuite/gdb.base/range-stepping.exp | 6 +-
gdb/testsuite/gdb.base/recpar.exp | 2 +-
gdb/testsuite/gdb.base/recurse.exp | 8 +-
gdb/testsuite/gdb.base/reggroups.exp | 2 +-
gdb/testsuite/gdb.base/relational.exp | 2 +-
gdb/testsuite/gdb.base/relocate.exp | 6 +-
gdb/testsuite/gdb.base/remote.exp | 2 +-
gdb/testsuite/gdb.base/reread.exp | 4 +-
gdb/testsuite/gdb.base/restore.exp | 6 +-
gdb/testsuite/gdb.base/return.exp | 4 +-
gdb/testsuite/gdb.base/rtld-step.exp | 2 +-
gdb/testsuite/gdb.base/run-after-attach.exp | 2 +-
gdb/testsuite/gdb.base/save-bp.exp | 4 +-
gdb/testsuite/gdb.base/savedregs.exp | 4 +-
gdb/testsuite/gdb.base/scope.exp | 4 +-
gdb/testsuite/gdb.base/sepdebug.exp | 10 +-
gdb/testsuite/gdb.base/sepsymtab.exp | 2 +-
gdb/testsuite/gdb.base/setshow.exp | 2 +-
gdb/testsuite/gdb.base/setvar.exp | 196 ++++++++++-----------
gdb/testsuite/gdb.base/shlib-call.exp | 8 +-
gdb/testsuite/gdb.base/shlib-unload.exp | 2 +-
gdb/testsuite/gdb.base/shreloc.exp | 12 +-
gdb/testsuite/gdb.base/sigbpt.exp | 2 +-
gdb/testsuite/gdb.base/siginfo-infcall.exp | 2 +-
gdb/testsuite/gdb.base/signals-state-child.exp | 2 +-
gdb/testsuite/gdb.base/signals.exp | 4 +-
gdb/testsuite/gdb.base/signest.exp | 2 +-
gdb/testsuite/gdb.base/sizeof.exp | 2 +-
gdb/testsuite/gdb.base/skip-inline.exp | 8 +-
gdb/testsuite/gdb.base/skip-solib.exp | 4 +-
gdb/testsuite/gdb.base/skip.exp | 22 +--
gdb/testsuite/gdb.base/skipcxx.exp | 2 +-
gdb/testsuite/gdb.base/solib-corrupted.exp | 2 +-
gdb/testsuite/gdb.base/solib-nodir.exp | 2 +-
gdb/testsuite/gdb.base/solib-overlap.exp | 6 +-
gdb/testsuite/gdb.base/solib-weak.exp | 2 +-
gdb/testsuite/gdb.base/source-dir.exp | 2 +-
gdb/testsuite/gdb.base/sss-bp-on-user-bp-2.exp | 4 +-
gdb/testsuite/gdb.base/stale-infcall.exp | 2 +-
gdb/testsuite/gdb.base/stap-probe.exp | 16 +-
gdb/testsuite/gdb.base/step-into-other-file.exp | 2 +-
gdb/testsuite/gdb.base/step-over-exit.exp | 2 +-
gdb/testsuite/gdb.base/step-over-no-symbols.exp | 2 +-
gdb/testsuite/gdb.base/step-over-syscall.exp | 2 +-
gdb/testsuite/gdb.base/step-resume-infcall.exp | 4 +-
.../gdb.base/step-sw-breakpoint-adjust-pc.exp | 4 +-
gdb/testsuite/gdb.base/step-symless.exp | 4 +-
gdb/testsuite/gdb.base/step-test.exp | 12 +-
gdb/testsuite/gdb.base/structs.exp | 16 +-
gdb/testsuite/gdb.base/structs2.exp | 4 +-
gdb/testsuite/gdb.base/structs3.exp | 2 +-
gdb/testsuite/gdb.base/style.exp | 6 +-
gdb/testsuite/gdb.base/symbol-alias.exp | 4 +-
gdb/testsuite/gdb.base/symtab-search-order.exp | 2 +-
gdb/testsuite/gdb.base/testenv.exp | 16 +-
gdb/testsuite/gdb.base/tls-common.exp.tcl | 4 +-
gdb/testsuite/gdb.base/tls-dlobj.exp | 10 +-
gdb/testsuite/gdb.base/tls-multiobj.exp | 10 +-
gdb/testsuite/gdb.base/tls-nothreads.exp | 16 +-
gdb/testsuite/gdb.base/twice.exp | 2 +-
gdb/testsuite/gdb.base/ui-redirect.exp | 2 +-
gdb/testsuite/gdb.base/until-nodebug.exp | 2 +-
gdb/testsuite/gdb.base/until-trailing-insns.exp | 2 +-
.../gdb.base/unwind-on-each-insn-amd64-2.exp | 2 +-
.../gdb.base/unwind-on-each-insn-amd64.exp | 2 +-
.../gdb.base/unwind-on-each-insn-i386.exp | 2 +-
gdb/testsuite/gdb.base/utf8-identifiers.exp | 2 +-
gdb/testsuite/gdb.base/valgrind-infcall.exp | 2 +-
gdb/testsuite/gdb.base/value-double-free.exp | 2 +-
.../gdb.base/value-history-unavailable.exp | 4 +-
gdb/testsuite/gdb.base/varargs.exp | 6 +-
gdb/testsuite/gdb.base/vla-datatypes.exp | 2 +-
gdb/testsuite/gdb.base/vla-optimized-out.exp | 2 +-
gdb/testsuite/gdb.base/vla-ptr.exp | 2 +-
gdb/testsuite/gdb.base/vla-sideeffect.exp | 5 +-
gdb/testsuite/gdb.base/vla-struct-fields.exp | 2 +-
gdb/testsuite/gdb.base/volatile.exp | 4 +-
gdb/testsuite/gdb.base/watchpoint-cond-gone.exp | 2 +-
gdb/testsuite/gdb.base/watchpoint-delete.exp | 2 +-
gdb/testsuite/gdb.base/watchpoint-hw-hit-once.exp | 2 +-
gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp | 14 +-
gdb/testsuite/gdb.base/watchpoint-running.exp | 6 +-
gdb/testsuite/gdb.base/watchpoint-unaligned.exp | 18 +-
gdb/testsuite/gdb.base/watchpoint.exp | 74 ++++----
gdb/testsuite/gdb.base/watchpoints.exp | 4 +-
gdb/testsuite/gdb.base/whatis-exp.exp | 2 +-
gdb/testsuite/gdb.base/whatis-ptype-typedefs.exp | 2 +-
gdb/testsuite/gdb.base/whatis.exp | 10 +-
gdb/testsuite/gdb.base/with.exp | 2 +-
gdb/testsuite/gdb.base/wrap-line.exp | 6 +-
gdb/testsuite/gdb.base/wrong_frame_bt_full.exp | 2 +-
292 files changed, 979 insertions(+), 976 deletions(-)
diff --git a/gdb/tclint.toml b/gdb/tclint.toml
index f063e3d2078..2db6b42eb4f 100644
--- a/gdb/tclint.toml
+++ b/gdb/tclint.toml
@@ -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.
]
diff --git a/gdb/testsuite/gdb.base/a2-run.exp b/gdb/testsuite/gdb.base/a2-run.exp
index 966e12a6f05..0df755883c9 100644
--- a/gdb/testsuite/gdb.base/a2-run.exp
+++ b/gdb/testsuite/gdb.base/a2-run.exp
@@ -155,7 +155,7 @@ gdb_test_stdio "" "usage: factorial <number>" "" "run after setting args to nil
# work with stub targets, where GDB connects to debug an already started
# process.
-if [use_gdb_stub] {
+if {[use_gdb_stub]} {
verbose "Skipping rest of a2-run.exp because target is a stub."
return
}
diff --git a/gdb/testsuite/gdb.base/access-mem-running.exp b/gdb/testsuite/gdb.base/access-mem-running.exp
index 280e89b3a44..ca30ec28d47 100644
--- a/gdb/testsuite/gdb.base/access-mem-running.exp
+++ b/gdb/testsuite/gdb.base/access-mem-running.exp
@@ -36,7 +36,7 @@ proc test { non_stop } {
gdb_load $binfile
}
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
@@ -114,7 +114,7 @@ proc test { non_stop } {
}
foreach non_stop { "off" "on" } {
- set stop_mode [expr ($non_stop=="off")?"all-stop":"non-stop"]
+ set stop_mode [expr {($non_stop=="off")?"all-stop":"non-stop"}]
with_test_prefix "$stop_mode" {
test $non_stop
}
diff --git a/gdb/testsuite/gdb.base/advance-until-multiple-locations.exp b/gdb/testsuite/gdb.base/advance-until-multiple-locations.exp
index 768500cca96..86b8e0d1d93 100644
--- a/gdb/testsuite/gdb.base/advance-until-multiple-locations.exp
+++ b/gdb/testsuite/gdb.base/advance-until-multiple-locations.exp
@@ -33,14 +33,14 @@ set lineno [gdb_get_line_number "multiple locations here"]
proc_with_prefix until_advance_lineno_from_inlined {cmd} {
global lineno
- if ![runto test] {
+ if {![runto test]} {
return
}
gdb_breakpoint $lineno
gdb_continue_to_breakpoint "break here"
- set lineno2 [expr $lineno + 1]
+ set lineno2 [expr {$lineno + 1}]
gdb_test "$cmd $lineno2" \
"inline_func .* at .*:$lineno2.*return i.*" \
@@ -53,7 +53,7 @@ proc_with_prefix until_advance_lineno_from_inlined {cmd} {
proc_with_prefix until_advance_lineno_from_non_inlined {cmd} {
global lineno
- if ![runto test] {
+ if {![runto test]} {
return
}
@@ -68,7 +68,7 @@ proc_with_prefix until_advance_lineno_from_non_inlined {cmd} {
proc_with_prefix until_advance_inline_func {cmd} {
global lineno
- if ![runto test] {
+ if {![runto test]} {
return
}
@@ -83,7 +83,7 @@ proc_with_prefix until_advance_inline_func {cmd} {
proc_with_prefix advance_overload {} {
global lineno
- if ![runto test] {
+ if {![runto test]} {
return
}
@@ -117,7 +117,7 @@ proc_with_prefix advance_overload {} {
proc_with_prefix until_overload {} {
global lineno
- if ![runto test] {
+ if {![runto test]} {
return
}
diff --git a/gdb/testsuite/gdb.base/advance.exp b/gdb/testsuite/gdb.base/advance.exp
index d4e23ee94c9..2051e9fb55c 100644
--- a/gdb/testsuite/gdb.base/advance.exp
+++ b/gdb/testsuite/gdb.base/advance.exp
@@ -63,7 +63,7 @@ gdb_test "continue" \
".*Breakpoint ${decimal}, main.*func3.*break here.*" \
"continue to call to func3 in main"
-# Verify that "advance <funcname>" when funcname is called as parameter to
+# Verify that "advance <funcname>" when funcname is called as parameter to
# another function works.
#
gdb_test "advance foo" \
diff --git a/gdb/testsuite/gdb.base/all-architectures.exp.tcl b/gdb/testsuite/gdb.base/all-architectures.exp.tcl
index 767b02daac3..5892ab7e1da 100644
--- a/gdb/testsuite/gdb.base/all-architectures.exp.tcl
+++ b/gdb/testsuite/gdb.base/all-architectures.exp.tcl
@@ -187,7 +187,7 @@ proc gdb_test_no_output_osabi {cmd test} {
set num_slices 8
set num_archs [llength $supported_archs]
-set archs_per_slice [expr (($num_archs + $num_slices - 1) / $num_slices)]
+set archs_per_slice [expr {(($num_archs + $num_slices - 1) / $num_slices)}]
with_test_prefix "tests" {
foreach_with_prefix osabi $supported_osabis {
@@ -201,10 +201,10 @@ with_test_prefix "tests" {
incr arch_count
# Skip architectures outside our slice.
- if {$arch_count < [expr $test_slice * $archs_per_slice]} {
+ if {$arch_count < $test_slice * $archs_per_slice} {
continue
}
- if {$arch_count >= [expr ($test_slice + 1) * $archs_per_slice]} {
+ if {$arch_count >= ($test_slice + 1) * $archs_per_slice} {
continue
}
@@ -312,7 +312,7 @@ with_test_prefix "tests" {
foreach v $options {
with_test_prefix "$var=$v" {
gdb_test_no_output_osabi "$cmd $v" "$cmd"
- run_axis $all_axes [expr $cur_axis + 1] $arch
+ run_axis $all_axes [expr {$cur_axis + 1}] $arch
}
}
}
diff --git a/gdb/testsuite/gdb.base/all-bin.exp b/gdb/testsuite/gdb.base/all-bin.exp
index 847bcb93c0b..d910965f7e9 100644
--- a/gdb/testsuite/gdb.base/all-bin.exp
+++ b/gdb/testsuite/gdb.base/all-bin.exp
@@ -19,7 +19,7 @@
#
# tests for arithmetic, logical and relational operators
# with mixed types
-#
+#
diff --git a/gdb/testsuite/gdb.base/annota1.exp b/gdb/testsuite/gdb.base/annota1.exp
index 744d8252b4b..0da5a09930a 100644
--- a/gdb/testsuite/gdb.base/annota1.exp
+++ b/gdb/testsuite/gdb.base/annota1.exp
@@ -60,7 +60,7 @@ set old_gdb_prompt $gdb_prompt
set gdb_prompt "\r\n\032\032pre-prompt\r\n$gdb_prompt \r\n\032\032prompt\r\n"
#
-# Escape all the characters in the path that need it. For instance
+# Escape all the characters in the path that need it. For instance
# the directory name could contain '+'.
#
set escapedsrcfile [string_to_regexp ${srcdir}/${subdir}/${srcfile}]
@@ -244,7 +244,7 @@ gdb_test_multiple "break handle_USR1" "break handle_USR1" {
}
#
-# break at printf. When we are stopped at printf, we can test
+# break at printf. When we are stopped at printf, we can test
#
gdb_test_multiple "break printf" "break printf" {
-re "\r\n\032\032post-prompt\r\nBreakpoint.*at $hex.*\032\032breakpoints-invalid\r\n.*$gdb_prompt$" {
@@ -336,14 +336,14 @@ gdb_test_multiple "backtrace" "backtrace from shlibrary" {
#
-# test printing a frame with some arguments:
+# test printing a frame with some arguments:
# annotate-arg-begin
# annotate-arg-name-end
# annotate-arg-value
# annotate-arg-end
#
-if [target_info exists gdb,nosignals] {
+if {[target_info exists gdb,nosignals]} {
unsupported "send SIGUSR1"
unsupported "backtrace @ signal handler"
} else {
@@ -507,10 +507,10 @@ gdb_test_multiple "info inferior 1" "get inferior pid" {
# annotate-signal-name-end
# annotate-signal-string
# annotate-signal-string-end
-# FIXME: annotate-signal not tested (requires that the inferior be
+# FIXME: annotate-signal not tested (requires that the inferior be
# stopped by a "random" signal)
-if [target_info exists gdb,nosignals] {
+if {[target_info exists gdb,nosignals]} {
unsupported "signal sent"
} else {
gdb_test_multiple "signal SIGTRAP" "signal sent" {
diff --git a/gdb/testsuite/gdb.base/annota3.exp b/gdb/testsuite/gdb.base/annota3.exp
index e8ac3053370..9d94be90aff 100644
--- a/gdb/testsuite/gdb.base/annota3.exp
+++ b/gdb/testsuite/gdb.base/annota3.exp
@@ -85,7 +85,7 @@ gdb_test_multiple "end" "end if construct" {
#
# info break:
#
-send_gdb "info break\n"
+send_gdb "info break\n"
gdb_expect_list "breakpoint info" "$gdb_prompt$" [concat {
"\r\n\032\032post-prompt\r\n"
"Num Type Disp Enb Address +What\r\n" } [list \
@@ -114,7 +114,7 @@ gdb_expect_list "run until main breakpoint" "$gdb_prompt$" [concat {
# We don't care about the annotated output for this operation, it is the same as
# the one produced by run above
#
-send_gdb "next\n"
+send_gdb "next\n"
gdb_expect_list "go after array init line" "$gdb_prompt$" {
"\r\n\032\032post-prompt\r\n"
"\r\n\032\032starting\r\n"
@@ -183,10 +183,10 @@ gdb_expect_list "backtrace from shlibrary" "$gdb_prompt$" {
#
-# test printing a frame with some arguments:
+# test printing a frame with some arguments:
#
-if [target_info exists gdb,nosignals] {
+if {[target_info exists gdb,nosignals]} {
unsupported "send SIGUSR1"
unsupported "backtrace @ signal handler"
} else {
@@ -345,7 +345,7 @@ gdb_test_multiple "info inferior 1" "$test" {
# Send a signal that is not handled
-if [target_info exists gdb,nosignals] {
+if {[target_info exists gdb,nosignals]} {
unsupported "signal sent"
} else {
send_gdb "signal SIGTRAP\n"
diff --git a/gdb/testsuite/gdb.base/args.exp b/gdb/testsuite/gdb.base/args.exp
index 39300594773..990f3a11057 100644
--- a/gdb/testsuite/gdb.base/args.exp
+++ b/gdb/testsuite/gdb.base/args.exp
@@ -115,7 +115,7 @@ proc args_test { name arglist {re_esc_list {}} {re_no_esc_list {}} } {
set re_list $re_no_esc_list
}
- set expected_len [expr 1 + [llength $re_list]]
+ set expected_len [expr {1 + [llength $re_list]}]
gdb_test "print argc" \
"\\\$$::decimal = $expected_len" "argc for $name"
@@ -144,7 +144,7 @@ proc args_test { name arglist {re_esc_list {}} {re_no_esc_list {}} } {
gdb_test "print argv\[$i\]" \
"\\\$$::decimal = $::hex \"$arg\"" \
"argv\[$i\] for $name"
- set i [expr $i + 1]
+ set i [expr {$i + 1}]
}
}
}
diff --git a/gdb/testsuite/gdb.base/argv0-symlink.exp b/gdb/testsuite/gdb.base/argv0-symlink.exp
index daabe740f1d..6edaea86112 100644
--- a/gdb/testsuite/gdb.base/argv0-symlink.exp
+++ b/gdb/testsuite/gdb.base/argv0-symlink.exp
@@ -17,7 +17,7 @@
# command expanding symlinks in the name of the program being run.
# This test uses pathnames on build to create symbolic links on host and
# expects the test program running on target to see those symbolic links.
-# Therefore, it can't work reliably on anything other than configurations
+# Therefore, it can't work reliably on anything other than configurations
# where build/host/target are all the same.
require isnative
@@ -47,7 +47,7 @@ with_test_prefix "file symlink" {
clean_restart "$filelink"
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
@@ -87,7 +87,7 @@ with_test_prefix "dir symlink" {
clean_restart "$dirlink/$filelink"
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
diff --git a/gdb/testsuite/gdb.base/arithmet.exp b/gdb/testsuite/gdb.base/arithmet.exp
index 9f9234bf4c2..4e0ea123858 100644
--- a/gdb/testsuite/gdb.base/arithmet.exp
+++ b/gdb/testsuite/gdb.base/arithmet.exp
@@ -20,7 +20,7 @@
#
# tests for correctness of arithmetic operators, associativity and precedence
# with integer type variables
-#
+#
#
# test running programs
@@ -54,7 +54,7 @@ gdb_test "print x" "14"
gdb_test "print y" "2"
gdb_test "print z" "2"
gdb_test "print w" "3"
-
+
gdb_test "print x+y" "16"
gdb_test "print x-y" "12"
gdb_test "print x*y" "28"
diff --git a/gdb/testsuite/gdb.base/asmlabel.exp b/gdb/testsuite/gdb.base/asmlabel.exp
index c4a3f0c0804..6a4d2a2ca53 100644
--- a/gdb/testsuite/gdb.base/asmlabel.exp
+++ b/gdb/testsuite/gdb.base/asmlabel.exp
@@ -37,7 +37,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return 0
}
diff --git a/gdb/testsuite/gdb.base/assign.exp b/gdb/testsuite/gdb.base/assign.exp
index aaee7962380..b96588c99de 100644
--- a/gdb/testsuite/gdb.base/assign.exp
+++ b/gdb/testsuite/gdb.base/assign.exp
@@ -19,7 +19,7 @@
#
# tests for all the assignemnt operators
# with mixed types and with int type variables
-#
+#
#
# test running programs
diff --git a/gdb/testsuite/gdb.base/async.exp b/gdb/testsuite/gdb.base/async.exp
index cae10f79a75..2f3ee9f809e 100644
--- a/gdb/testsuite/gdb.base/async.exp
+++ b/gdb/testsuite/gdb.base/async.exp
@@ -109,7 +109,7 @@ gdb_test_multiple {x/2i $pc} "$test" {
}
}
set next_insn_is_stmt \
- [expr [lsearch -regexp $is_stmt 0x0*$next_insn_addr] != -1]
+ [expr {[lsearch -regexp $is_stmt 0x0*$next_insn_addr] != -1}]
if { $next_insn_is_stmt } {
set prefix ""
diff --git a/gdb/testsuite/gdb.base/attach-pie-misread.exp b/gdb/testsuite/gdb.base/attach-pie-misread.exp
index 04fe9517871..5f85d00549f 100644
--- a/gdb/testsuite/gdb.base/attach-pie-misread.exp
+++ b/gdb/testsuite/gdb.base/attach-pie-misread.exp
@@ -39,18 +39,18 @@ proc read_phdr {binfile test} {
set readelf_program [gdb_find_readelf]
set command "exec $readelf_program -Wl $binfile"
verbose -log "command is $command"
- set result [catch $command output]
+ set result [catch {{*}$command} output]
verbose -log "result is $result"
verbose -log "output is $output"
if {$result != 0} {
fail $test
return
}
- if ![regexp {\nProgram Headers:\n *Type [^\n]* Align\n(.*?)\n\n} $output trash phdr] {
+ if {![regexp {\nProgram Headers:\n *Type [^\n]* Align\n(.*?)\n\n} $output trash phdr]} {
fail "$test (no Program Headers)"
return
}
- if ![regexp -line {^ *DYNAMIC +0x[0-9a-f]+ +(0x[0-9a-f]+) } $phdr trash dynamic_vaddr] {
+ if {![regexp -line {^ *DYNAMIC +0x[0-9a-f]+ +(0x[0-9a-f]+) } $phdr trash dynamic_vaddr]} {
fail "$test (no DYNAMIC found)"
return
}
@@ -74,7 +74,7 @@ set phdr [read_phdr $binfile "readelf initial scan"]
set dynamic_vaddr [lindex $phdr 0]
set align_max [lindex $phdr 1]
-set stub_size [format 0x%x [expr "2 * $align_max - ($dynamic_vaddr & ($align_max - 1))"]]
+set stub_size [format 0x%x [expr {2 * $align_max - ($dynamic_vaddr & ($align_max - 1))}]]
verbose -log "stub_size is $stub_size"
# On x86_64 it is commonly about 4MB.
@@ -86,7 +86,7 @@ if {$stub_size > 25000000} {
set test "generate stub"
set command "exec $binfile $stub_size >$genfile"
verbose -log "command is $command"
-set result [catch $command output]
+set result [catch {{*}$command} output]
verbose -log "result is $result"
verbose -log "output is $output"
if {$result == 0} {
@@ -109,14 +109,14 @@ file delete -- $genfile
set phdr [read_phdr $binfile "readelf rebuilt with stub_size"]
set dynamic_vaddr_prelinkno [lindex $phdr 0]
-if ![prelink_yes $prelink_args] {
+if {![prelink_yes $prelink_args]} {
return -1
}
set phdr [read_phdr $binfile "readelf with prelink -R"]
set dynamic_vaddr_prelinkyes [lindex $phdr 0]
-set first_offset [format 0x%x [expr $dynamic_vaddr_prelinkyes - $dynamic_vaddr_prelinkno]]
+set first_offset [format 0x%x [expr {$dynamic_vaddr_prelinkyes - $dynamic_vaddr_prelinkno}]]
verbose -log "first_offset is $first_offset"
set test "first offset is non-zero"
@@ -156,7 +156,7 @@ gdb_expect {
foreach align_mult {1 2} { with_test_prefix "shift-by-$align_mult" {
# FIXME: We believe there is enough room under FIRST_OFFSET.
- set shifted_offset [format 0x%x [expr "$first_offset - $align_mult * $align_max"]]
+ set shifted_offset [format 0x%x [expr {$first_offset - $align_mult * $align_max}]]
verbose -log "shifted_offset is $shifted_offset"
# For normal prelink (prelink_yes call), we need to supply $prelink_args.
@@ -165,7 +165,7 @@ foreach align_mult {1 2} { with_test_prefix "shift-by-$align_mult" {
# as the libraries would also get relocated.
set command "exec /usr/sbin/prelink -q -N --no-exec-shield -r $shifted_offset $binfile"
verbose -log "command is $command"
- set result [catch $command output]
+ set result [catch {{*}$command} output]
verbose -log "result is $result"
verbose -log "output is $output"
diff --git a/gdb/testsuite/gdb.base/attach-pie-noexec.exp b/gdb/testsuite/gdb.base/attach-pie-noexec.exp
index 877cb4a6c77..58f1890e1bb 100644
--- a/gdb/testsuite/gdb.base/attach-pie-noexec.exp
+++ b/gdb/testsuite/gdb.base/attach-pie-noexec.exp
@@ -30,7 +30,7 @@ gdb_test_multiple $test $test {
pass $test
}
}
-if ![runto_main] {
+if {![runto_main]} {
return 0
}
set test "sanity check info shared"
diff --git a/gdb/testsuite/gdb.base/attach.exp b/gdb/testsuite/gdb.base/attach.exp
index d0a29f2954d..c4e27a10f17 100644
--- a/gdb/testsuite/gdb.base/attach.exp
+++ b/gdb/testsuite/gdb.base/attach.exp
@@ -84,7 +84,7 @@ proc_with_prefix do_attach_failure_tests {} {
}
-re "Attaching to.*, process .*couldn't open /proc file.*$gdb_prompt $" {
# Response expected from /proc-based systems.
- pass "$test"
+ pass "$test"
}
-re "Can't attach to process..*$gdb_prompt $" {
# Response expected on Cygwin
@@ -105,7 +105,7 @@ proc_with_prefix do_attach_failure_tests {} {
}
-re "Attaching to.*, process .*couldn't open /proc file.*$gdb_prompt $" {
# Response expected from /proc-based systems.
- pass "$test"
+ pass "$test"
}
-re "Can't attach to process..*$gdb_prompt $" {
# Response expected on Cygwin
@@ -157,7 +157,7 @@ proc_with_prefix do_attach_failure_tests {} {
pass "$test"
}
}
-
+
# Verify that we can't double attach to the process.
set test "first attach"
@@ -242,7 +242,7 @@ proc_with_prefix do_attach_tests {} {
# (Actually, the test system appears to do this automatically for
# us. So, we must also be prepared to be asked if we want to
# discard an existing set of symbols.)
-
+
set test "set file, before attach1"
gdb_test_multiple "file $binfile" "$test" {
-re "Load new symbol table from.*y or n. $" {
@@ -267,25 +267,25 @@ proc_with_prefix do_attach_tests {} {
# Verify that we can "see" the variable "should_exit" in the
# program, and that it is zero.
-
+
gdb_test "print should_exit" " = 0" "after attach1, print should_exit"
# Detach the process.
-
+
gdb_test "detach" \
"Detaching from program: .*$escapedbinfile, process $testpid\r\n\\\[Inferior $decimal \\(.*\\) detached\\\]" \
"attach1 detach"
# Wait a bit for gdb to finish detaching
-
+
exec sleep 5
# Purge the symbols from gdb's brain. (We want to be certain the
# next attach, which won't be preceded by a "file" command, is
# really getting the executable file without our help.)
-
+
set old_timeout $timeout
- set timeout 15
+ set timeout 15
set test "attach1, purging symbols after detach"
gdb_test_multiple "file" "$test" {
-re "No executable file now.*Discard symbol table.*y or n. $" {
@@ -296,7 +296,7 @@ proc_with_prefix do_attach_tests {} {
# Verify that we can attach to the process just by giving the
# process ID.
-
+
set test "attach2, with no file"
set found_exec_file 0
gdb_test_multiple "attach $testpid" "$test" {
@@ -356,7 +356,7 @@ proc_with_prefix do_attach_tests {} {
# Verify that we can attach to the process, and find its a.out
# when we're cd'd to some directory that doesn't contain the
# a.out. (We use the source path set by the "dir" command.)
-
+
gdb_test "dir [standard_output_file {}]" "Source directories searched: .*" \
"set source path"
@@ -389,7 +389,7 @@ proc_with_prefix do_attach_tests {} {
"$test" \
"Kill the program being debugged.*y or n. $" \
"y"
-
+
# Another "don't leave a process around"
kill_wait_spawned_process $test_spawn_id
}
@@ -406,7 +406,7 @@ proc_with_prefix do_call_attach_tests {} {
set testpid [spawn_id_get_pid $test_spawn_id]
# Attach
-
+
gdb_test "file $binfile2" ".*" "load file"
set test "attach call"
gdb_test_multiple "attach $testpid" "$test" {
@@ -422,7 +422,7 @@ proc_with_prefix do_call_attach_tests {} {
}
# See if other registers are problems
-
+
set test "info other register"
gdb_test_multiple "i r r3" "$test" {
-re "warning: reading register.*$gdb_prompt $" {
@@ -434,12 +434,12 @@ proc_with_prefix do_call_attach_tests {} {
}
# Get rid of the process
-
+
gdb_test "p should_exit = 1"
gdb_continue_to_end
-
+
# Be paranoid
-
+
kill_wait_spawned_process $test_spawn_id
}
@@ -591,7 +591,7 @@ proc_with_prefix do_attach_exec_mismatch_handling_tests {} {
gdb_test "y" "Reading symbols from .*attach.*" $gdb_test_name
}
}
-
+
gdb_test "detach" "Detaching from program: .* detached\\\]" "$test detach attach initial exec-file"
diff --git a/gdb/testsuite/gdb.base/auxv.exp b/gdb/testsuite/gdb.base/auxv.exp
index 38efa457cbf..0bb4c36abbf 100644
--- a/gdb/testsuite/gdb.base/auxv.exp
+++ b/gdb/testsuite/gdb.base/auxv.exp
@@ -37,7 +37,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \
# Make it the working directory for the inferior.
set coredir [standard_output_file coredir.[getpid]]
file mkdir $coredir
-set core_works [expr [isnative] && ! [is_remote target]]
+set core_works [expr {[isnative] && ! [is_remote target]}]
# Run GDB on the test program up to where it will dump core.
diff --git a/gdb/testsuite/gdb.base/basic-edit-cmd.exp b/gdb/testsuite/gdb.base/basic-edit-cmd.exp
index 7ad8ab926cd..ad5c9a5626a 100644
--- a/gdb/testsuite/gdb.base/basic-edit-cmd.exp
+++ b/gdb/testsuite/gdb.base/basic-edit-cmd.exp
@@ -42,7 +42,7 @@ if {![runto_main]} {
# Are we using DWARF debug format?
get_debug_format
-set non_dwarf [expr ! [test_debug_format "DWARF \[0-9\]"]]
+set non_dwarf [expr {! [test_debug_format "DWARF \[0-9\]"]}]
# Find line numbers for use in tests.
set line_0 [gdb_get_line_number "prologue location"]
diff --git a/gdb/testsuite/gdb.base/batch-exit-status.exp b/gdb/testsuite/gdb.base/batch-exit-status.exp
index a2c3dea91c6..86e5fdd7fa0 100644
--- a/gdb/testsuite/gdb.base/batch-exit-status.exp
+++ b/gdb/testsuite/gdb.base/batch-exit-status.exp
@@ -29,7 +29,7 @@ proc _test_exit_status {expect_status cmdline_opts {re ""}} {
return
}
- set has_re [expr ![string equal $re ""]]
+ set has_re [expr {![string equal $re ""]}]
if { ! $has_re } {
set re "\$FOOBAR^"
}
diff --git a/gdb/testsuite/gdb.base/batch-preserve-term-settings.exp b/gdb/testsuite/gdb.base/batch-preserve-term-settings.exp
index 8995997890f..52b546cd46d 100644
--- a/gdb/testsuite/gdb.base/batch-preserve-term-settings.exp
+++ b/gdb/testsuite/gdb.base/batch-preserve-term-settings.exp
@@ -23,7 +23,7 @@ if {[build_executable "failed to prepare" $testfile $srcfile debug] == -1} {
}
set file_arg $binfile
-if [is_remote host] {
+if {[is_remote host]} {
set file_arg [remote_download host $file_arg]
}
@@ -46,11 +46,11 @@ proc spawn_shell {} {
# Try to match:
# PS1="gdb-subshell$ "^M
- # $ gdb-subshell$
+ # $ gdb-subshell$
# or:
# PS1="gdb-subshell$ "^M
# sh-4.4$ PS1="gdb-subshell$ "^M
- # gdb-subshell$
+ # gdb-subshell$
set gotit 0
set test "spawn shell"
gdb_expect {
@@ -88,7 +88,7 @@ proc exit_shell {} {
pass "$test"
}
}
- if ![is_remote host] {
+ if {![is_remote host]} {
remote_close host
}
}
@@ -131,7 +131,7 @@ proc test_terminal_settings_preserved {} {
global gdb_prompt
global shell_prompt_re
- if ![spawn_shell] {
+ if {![spawn_shell]} {
return
}
@@ -176,7 +176,7 @@ proc test_terminal_settings_preserved {} {
}
set test "terminal settings preserved"
- if $stty_supported {
+ if {$stty_supported} {
run_stty "stty after" stty_after
gdb_assert [string equal $stty_before $stty_after] $test
@@ -224,7 +224,7 @@ proc test_terminal_settings_preserved_after_cli_exit { cmds } {
global gdb_prompt
global shell_prompt_re
- if ![spawn_shell] {
+ if {![spawn_shell]} {
return
}
@@ -263,7 +263,7 @@ proc test_terminal_settings_preserved_after_cli_exit { cmds } {
send_quit_command "quit gdb"
set test "terminal settings preserved"
- if $stty_supported {
+ if {$stty_supported} {
run_stty "stty after" stty_after
gdb_assert [string equal $stty_before $stty_after] $test
@@ -286,11 +286,11 @@ proc test_terminal_settings_preserved_after_sigterm { } {
# On Windows, GDB's "shell" command spawns cmd.exe, which does not
# understand PPID. So we're out of luck even if the test harness
# uses a remote_exec shell with a working "kill" command.
- if [ishost *-*-mingw*] {
+ if {[ishost *-*-mingw*]} {
return
}
- if ![spawn_shell] {
+ if {![spawn_shell]} {
return
}
@@ -347,13 +347,13 @@ proc test_terminal_settings_preserved_after_sigterm { } {
}
}
- if !$gdb_killed {
+ if {!$gdb_killed} {
send_quit_command "quit gdb"
}
}
set test "terminal settings preserved"
- if $stty_supported {
+ if {$stty_supported} {
run_stty "stty after" stty_after
gdb_assert [string equal $stty_before $stty_after] $test
diff --git a/gdb/testsuite/gdb.base/bfd-errors.exp b/gdb/testsuite/gdb.base/bfd-errors.exp
index 8e51f09a98e..f29824791c3 100644
--- a/gdb/testsuite/gdb.base/bfd-errors.exp
+++ b/gdb/testsuite/gdb.base/bfd-errors.exp
@@ -39,7 +39,7 @@
#
# This test then loads the shared library's symbol table (and other
# debug info) using the 'add-symbol-file' command. While doing this,
-# the test observes and records the BFD errors that were output.
+# the test observes and records the BFD errors that were output.
# Finally, data collected while adding the shared library symbols are
# examined to make sure that identical messages were suppressed while
# also making sure that at least two messages have been printed.
@@ -87,10 +87,10 @@ close $solib_fp
set objcopy_program [gdb_find_objcopy]
# Extract the .dynsym and .dynstr section from the shared object.
-if { [catch "exec $objcopy_program \
- --dump-section .dynsym=${binfile_lib}.dynsym \
- --dump-section .dynstr=${binfile_lib}.dynstr \
- ${binfile_lib}" output] } {
+if { [catch {exec $objcopy_program \
+ --dump-section .dynsym=${binfile_lib}.dynsym \
+ --dump-section .dynstr=${binfile_lib}.dynstr \
+ ${binfile_lib}} output] } {
untested "failed objcopy dump-section"
verbose -log "objcopy output: $output"
return -1
@@ -119,29 +119,29 @@ if { $is_elf64 } {
} else {
set sz 16
}
-set cnt [expr $dynsym_len / $sz]
+set cnt [expr {$dynsym_len / $sz}]
# Create 32-bit patterns (bad offsets) to write into the st_name area.
if { $is_big_endian } {
- set pat(0) [binary format I [expr $dynstr_len + 1000]]
- set pat(1) [binary format I [expr $dynstr_len + 2000]]
+ set pat(0) [binary format I [expr {$dynstr_len + 1000}]]
+ set pat(1) [binary format I [expr {$dynstr_len + 2000}]]
} else {
- set pat(0) [binary format i [expr $dynstr_len + 1000]]
- set pat(1) [binary format i [expr $dynstr_len + 2000]]
+ set pat(0) [binary format i [expr {$dynstr_len + 1000}]]
+ set pat(1) [binary format i [expr {$dynstr_len + 2000}]]
}
# Mangle st_name for the symbols following the first (STN_UNDEF) entry.
while { [incr cnt -1] > 0 } {
seek $dynsym_fp [incr off $sz]
- puts $dynsym_fp $pat([expr $cnt % 2])
+ puts $dynsym_fp $pat([expr {$cnt % 2}])
}
close $dynsym_fp
# Replace .dynsym section in shared object with the mangled version.
-if { [catch "exec $objcopy_program \
- --update-section .dynsym=${binfile_lib}.dynsym \
- ${binfile_lib}" output] } {
+if { [catch {exec $objcopy_program \
+ --update-section .dynsym=${binfile_lib}.dynsym \
+ ${binfile_lib}} output] } {
untested "failed objcopy update-section"
verbose -log "objcopy output: $output"
return -1
diff --git a/gdb/testsuite/gdb.base/bfp-test.exp b/gdb/testsuite/gdb.base/bfp-test.exp
index 53d274fb719..1251868e111 100644
--- a/gdb/testsuite/gdb.base/bfp-test.exp
+++ b/gdb/testsuite/gdb.base/bfp-test.exp
@@ -39,7 +39,7 @@ gdb_test "print b32" ".*1 = 1\.5.*" "the original value of b32 is 1.5"
gdb_test "print b64" ".*2 = 2\.25.*" "the original value of b64 is 2.25"
gdb_test "print b128" ".*3 = 3\.375.*" "the original value of b128 is 3.375"
-# Test that gdb could correctly recognize float constant expression with a suffix.
+# Test that gdb could correctly recognize float constant expression with a suffix.
gdb_test "print b32=-1.5f" ".*4 = -1\.5.*" "try to change b32 to -1.5 with 'print b32=-1.5f'"
gdb_test "print b64=-2.25f" ".*5 = -2\.25.*" "try to change b64 to -2.25 with 'print b64=-2.25f'"
gdb_test "print b128=-3.375l" ".*6 = -3\.375.*" "try to change b128 to -3.375 with 'print b128=-3.375l'"
diff --git a/gdb/testsuite/gdb.base/bg-execution-repeat.exp b/gdb/testsuite/gdb.base/bg-execution-repeat.exp
index e7bdf4935c9..923092b9ba1 100644
--- a/gdb/testsuite/gdb.base/bg-execution-repeat.exp
+++ b/gdb/testsuite/gdb.base/bg-execution-repeat.exp
@@ -36,7 +36,7 @@ proc test {continue_cmd} {
clean_restart
gdb_load $binfile
- if ![runto_main] {
+ if {![runto_main]} {
return
}
diff --git a/gdb/testsuite/gdb.base/bigcore.exp b/gdb/testsuite/gdb.base/bigcore.exp
index f917eb82487..7066a636eb3 100644
--- a/gdb/testsuite/gdb.base/bigcore.exp
+++ b/gdb/testsuite/gdb.base/bigcore.exp
@@ -28,8 +28,8 @@ require isnative
# I/O bandwidth.
if { [istarget "*-*-*bsd*"]
- || [istarget "*-*-solaris*"]
- || [istarget "*-*-darwin*"]
+ || [istarget "*-*-solaris*"]
+ || [istarget "*-*-darwin*"]
|| [istarget "*-*-cygwin*"] } {
untested "kernel lacks sparse corefile support (PR gdb/1551)"
return
diff --git a/gdb/testsuite/gdb.base/bitfields.exp b/gdb/testsuite/gdb.base/bitfields.exp
index c463865a3ff..9a5eaff0878 100644
--- a/gdb/testsuite/gdb.base/bitfields.exp
+++ b/gdb/testsuite/gdb.base/bitfields.exp
@@ -165,7 +165,7 @@ proc bitfield_at_offset {} {
global srcfile
gdb_breakpoint break5
- if [gdb_test "cont" "Break.*break5 \\(\\) at .*$srcfile:$decimal.*" "continuing to break5"] {
+ if {[gdb_test "cont" "Break.*break5 \\(\\) at .*$srcfile:$decimal.*" "continuing to break5"]} {
return
}
diff --git a/gdb/testsuite/gdb.base/bitfields2.exp b/gdb/testsuite/gdb.base/bitfields2.exp
index 3e981dd92e1..124f9c29107 100644
--- a/gdb/testsuite/gdb.base/bitfields2.exp
+++ b/gdb/testsuite/gdb.base/bitfields2.exp
@@ -13,11 +13,11 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# This file was adapted from bitfields.exp by Paul Hilfinger
+# This file was adapted from bitfields.exp by Paul Hilfinger
# (Hilfinger@gnat.com)
#
-# Tests for bit-fields that do not fit in type (unsigned) int, but do fit
+# Tests for bit-fields that do not fit in type (unsigned) int, but do fit
# in type (unsigned) long long. We perform essentially the same tests as
# in bitfields.c, which considers only bit-fields that are <= 9 bits long.
#
@@ -33,7 +33,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
set has_signed_bitfields 1
#
-# Continue to expected breakpoint at FUNCTION. Append TAG to make pass/fail
+# Continue to expected breakpoint at FUNCTION. Append TAG to make pass/fail
# messages (to make them unique). Suppress tests on failure.
#
proc continue_test { function tag } {
@@ -54,7 +54,7 @@ proc start_test { function } {
gdb_breakpoint $function
continue_test $function "#0"
}
-
+
#
# Test bitfield locating and uniqueness.
diff --git a/gdb/testsuite/gdb.base/bitops.exp b/gdb/testsuite/gdb.base/bitops.exp
index 6bd867547f2..0bf6b20f30c 100644
--- a/gdb/testsuite/gdb.base/bitops.exp
+++ b/gdb/testsuite/gdb.base/bitops.exp
@@ -20,7 +20,7 @@
# tests expressions with bitwise operators, and some
# logical operators
# Does not use a target program
-#
+#
#
diff --git a/gdb/testsuite/gdb.base/bitshift.exp b/gdb/testsuite/gdb.base/bitshift.exp
index 8cc25144075..1e308f29455 100644
--- a/gdb/testsuite/gdb.base/bitshift.exp
+++ b/gdb/testsuite/gdb.base/bitshift.exp
@@ -158,6 +158,7 @@ foreach signed {0 1} {
set sign_prefix "u"
}
foreach bits {8 16 32 64} {
+ # tclint-disable-next-line command-args
proc make_${sign_prefix}int${bits} {lang val} \
"make_val_cast \$lang $signed $bits \$val"
}
diff --git a/gdb/testsuite/gdb.base/bp-permanent.exp b/gdb/testsuite/gdb.base/bp-permanent.exp
index 3ae5efe109f..df511269643 100644
--- a/gdb/testsuite/gdb.base/bp-permanent.exp
+++ b/gdb/testsuite/gdb.base/bp-permanent.exp
@@ -103,7 +103,7 @@ proc test {always_inserted sw_watchpoint} {
# We now have the breakpoint instruction stored in 'buffer'. Poke it
# to memory manually.
- set count [expr $address_after_bp - $address_bp]
+ set count [expr {$address_after_bp - $address_bp}]
for {set i 0} {$i < $count} {incr i} {
set test "p /x addr_bp\[$i\] = buffer\[$i\]"
gdb_test_multiple $test $test {
@@ -216,7 +216,7 @@ proc test {always_inserted sw_watchpoint} {
gdb_test "next" "after next .*"
}
- if ![target_info exists gdb,nosignals] {
+ if {![target_info exists gdb,nosignals]} {
with_test_prefix "continue trips on nested permanent bp" {
delete_breakpoints
@@ -242,7 +242,7 @@ proc test {always_inserted sw_watchpoint} {
gdb_test "p counter" " = 2"
}
- if [can_single_step_to_signal_handler] {
+ if {[can_single_step_to_signal_handler]} {
with_test_prefix "stepi signal with handler" {
delete_breakpoints
diff --git a/gdb/testsuite/gdb.base/branch-to-self.exp b/gdb/testsuite/gdb.base/branch-to-self.exp
index 8f8e8ad4491..3f09786bd65 100644
--- a/gdb/testsuite/gdb.base/branch-to-self.exp
+++ b/gdb/testsuite/gdb.base/branch-to-self.exp
@@ -27,7 +27,7 @@ with_test_prefix "single-step" {
global testfile
clean_restart ${testfile}
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
set line_num [gdb_get_line_number "loop-line" ${testfile}.c]
@@ -60,7 +60,7 @@ with_test_prefix "break-cond" {
clean_restart ${testfile}
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
diff --git a/gdb/testsuite/gdb.base/break-caller-line.exp b/gdb/testsuite/gdb.base/break-caller-line.exp
index bc3604ed738..9925a1dc8a2 100644
--- a/gdb/testsuite/gdb.base/break-caller-line.exp
+++ b/gdb/testsuite/gdb.base/break-caller-line.exp
@@ -19,7 +19,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile}] } {
return -1
}
-if ![runto callee] {
+if {![runto callee]} {
return 0
}
diff --git a/gdb/testsuite/gdb.base/break-entry.exp b/gdb/testsuite/gdb.base/break-entry.exp
index 4ea1158a8b2..584ddafd3a7 100644
--- a/gdb/testsuite/gdb.base/break-entry.exp
+++ b/gdb/testsuite/gdb.base/break-entry.exp
@@ -56,7 +56,7 @@ if {[istarget powerpc64-*] && [is_lp64_target]} {
}
}
-if ![runto "*$entry"] {
+if {![runto "*$entry"]} {
return
}
gdb_test {p/x $pc} " = $entry"
diff --git a/gdb/testsuite/gdb.base/break-idempotent.exp b/gdb/testsuite/gdb.base/break-idempotent.exp
index 3b32c89772d..842ce42dc59 100644
--- a/gdb/testsuite/gdb.base/break-idempotent.exp
+++ b/gdb/testsuite/gdb.base/break-idempotent.exp
@@ -165,7 +165,7 @@ foreach_with_prefix pie { "nopie" "pie" } {
continue
}
- if [is_remote host] {
+ if {[is_remote host]} {
set arg [remote_download host $binfile]
if { $arg == "" } {
untested "download failed"
diff --git a/gdb/testsuite/gdb.base/break-interp.exp b/gdb/testsuite/gdb.base/break-interp.exp
index 038c3ea4427..f06c15f23be 100644
--- a/gdb/testsuite/gdb.base/break-interp.exp
+++ b/gdb/testsuite/gdb.base/break-interp.exp
@@ -49,19 +49,19 @@ proc system_debug_get {exec} {
# isfile returns 1 even for symlinks to files.
set retval $debug_root/$exec_build_id_debug
- if [file isfile $retval] {
+ if {[file isfile $retval]} {
return $retval
}
set retval $exec_dir/$debug_base
- if [file isfile $retval] {
+ if {[file isfile $retval]} {
return $retval
}
set retval $exec_dir/.debug/$debug_base
- if [file isfile $retval] {
+ if {[file isfile $retval]} {
return $retval
}
set retval $debug_root/$exec_dir/$debug_base
- if [file isfile $retval] {
+ if {[file isfile $retval]} {
return $retval
}
return ""
@@ -108,7 +108,7 @@ proc strip_debug {dest} {
set strip_program [transform strip]
set command "exec $strip_program --strip-debug $dest"
verbose -log "command is $command"
- if [catch $command] {
+ if {[catch {{*}$command}]} {
fail $test
return 0
} else {
@@ -186,7 +186,7 @@ proc reach_1 {func command displacement} {
}
}
}
- if ![regexp {^(NONE|FOUND-.*)$} $displacement] {
+ if {![regexp {^(NONE|FOUND-.*)$} $displacement]} {
fail $test_displacement
}
@@ -257,7 +257,7 @@ proc test_core {file displacement} {
pass $test
}
}
- if ![regexp {^(NONE|FOUND-.*)$} $displacement] {
+ if {![regexp {^(NONE|FOUND-.*)$} $displacement]} {
fail $test_displacement
}
gdb_test_no_output "set verbose off"
@@ -308,7 +308,7 @@ proc test_attach_gdb {file pid displacement prefix} {
pass $test
}
}
- if ![regexp {^(NONE|FOUND-.*)$} $displacement] {
+ if {![regexp {^(NONE|FOUND-.*)$} $displacement]} {
fail $test_displacement
}
gdb_test_no_output "set verbose off"
@@ -381,7 +381,7 @@ proc test_attach {file displacement {relink_args ""}} {
# `libfunc' is present in the backtrace and therefore the
# displacement has been guessed right.
- if [prelink$relink $relink_args [file tail $exec]] {
+ if {[prelink$relink $relink_args [file tail $exec]]} {
# /proc/PID/exe cannot be loaded as it is "EXECNAME (deleted)".
test_attach_gdb $exec $pid $displacement "attach-relink$relink"
}
@@ -411,7 +411,7 @@ proc test_ld {file ifmain trynosym displacement} {
# prevents that from happening. So turn it off.
gdb_test "set disable-randomization off"
- if $ifmain {
+ if {$ifmain} {
gdb_test_no_output "set args segv"
} else {
global binfile_test
@@ -450,7 +450,7 @@ proc test_ld {file ifmain trynosym displacement} {
gdb_test_no_output "set verbose on"
}
- if $ifmain {
+ if {$ifmain} {
reach "main" continue "NONE"
reach "libfunc" continue "NONE"
@@ -467,13 +467,13 @@ proc test_ld {file ifmain trynosym displacement} {
reach $solib_bp "run" $displacement 2
gdb_test_no_output "set verbose off"
- if $ifmain {
+ if {$ifmain} {
test_core $file $displacement
test_attach $file $displacement
}
- if !$trynosym {
+ if {!$trynosym} {
return
}
@@ -494,7 +494,7 @@ proc test_ld {file ifmain trynosym displacement} {
set escapedfile [string_to_regexp $file]
gdb_test "exec-file $file" "exec-file $escapedfile" "load"
- if $ifmain {
+ if {$ifmain} {
reach $solib_bp run $displacement 3
set entrynohex ""
@@ -550,7 +550,7 @@ proc test_ld {file ifmain trynosym displacement} {
pass $test
}
}
- if ![regexp {^(NONE|FOUND-.*)$} $displacement] {
+ if {![regexp {^(NONE|FOUND-.*)$} $displacement]} {
fail $test_displacement
}
}
@@ -589,7 +589,7 @@ foreach_with_prefix ldprelink {NO YES} {
file_copy $interp_system $interp
# Never call strip-debug before unprelink:
# prelink: ...: Section .note.gnu.build-id created after prelinking
- if ![prelinkNO $interp] {
+ if {![prelinkNO $interp]} {
continue
}
strip_debug $interp
@@ -605,7 +605,7 @@ foreach_with_prefix ldprelink {NO YES} {
set test "eu-unstrip unprelinked:[file tail $interp_system] + [file tail $interp_system_debug] to [file tail $interp]"
set command "exec eu-unstrip -o $interp $interp ${interp}.debug"
verbose -log "command is $command"
- if [catch $command] {
+ if {[catch {{*}$command}]} {
setup_xfail *-*-*
fail $test
continue
@@ -615,7 +615,7 @@ foreach_with_prefix ldprelink {NO YES} {
} elseif {$ldsepdebug == "SEP" && $interp_system_debug == ""} {
file_copy $interp_system $interp
# eu-unstrip: DWARF data in '...' not adjusted for prelinking bias; consider prelink -u
- if ![prelinkNO $interp] {
+ if {![prelinkNO $interp]} {
continue
}
gdb_gnu_strip_debug $interp
@@ -625,14 +625,14 @@ foreach_with_prefix ldprelink {NO YES} {
}
if {$ldsepdebug == "SEP"} {
- if ![prelinkNO "${interp}.debug"] {
+ if {![prelinkNO "${interp}.debug"]} {
continue
}
} else {
file delete "${interp}.debug"
}
- if ![prelink$ldprelink $interp "[file tail $interp], second time"] {
+ if {![prelink$ldprelink $interp "[file tail $interp], second time"]} {
continue
}
@@ -647,7 +647,7 @@ foreach_with_prefix ldprelink {NO YES} {
}
test_ld $interp 0 [expr {$ldsepdebug == "NO"}] $displacement
- if ![file_copy $interp $interp_saved] {
+ if {![file_copy $interp $interp_saved]} {
continue
}
diff --git a/gdb/testsuite/gdb.base/break-main-file-remove-fail.exp b/gdb/testsuite/gdb.base/break-main-file-remove-fail.exp
index 19b2446a6dc..4dd88cdc8f6 100644
--- a/gdb/testsuite/gdb.base/break-main-file-remove-fail.exp
+++ b/gdb/testsuite/gdb.base/break-main-file-remove-fail.exp
@@ -55,7 +55,7 @@ proc test_remove_bp { initial_load } {
gdb_reload
}
- if ![runto start] {
+ if {![runto start]} {
return
}
@@ -86,7 +86,7 @@ proc test_remove_bp { initial_load } {
# remove the memory breakpoint afterwards should fail, and GDB
# should warn the user about it.
set pagesize [get_integer_valueof "pg_size" 0]
- set align_addr [expr $bp_addr - $bp_addr % $pagesize]
+ set align_addr [expr {$bp_addr - $bp_addr % $pagesize}]
set munmap_prototype "int (*) (void *, size_t)"
set munmap_expr "(($munmap_prototype) munmap) ($align_addr, $pagesize)"
diff --git a/gdb/testsuite/gdb.base/break.exp b/gdb/testsuite/gdb.base/break.exp
index 1eec9849055..e1f4860b57a 100644
--- a/gdb/testsuite/gdb.base/break.exp
+++ b/gdb/testsuite/gdb.base/break.exp
@@ -765,7 +765,7 @@ proc_with_prefix test_next_with_recursion {} {
delete_breakpoints
- if [istarget "mips*tx39-*"] {
+ if {[istarget "mips*tx39-*"]} {
set timeout 60
}
# We used to set timeout here for all other targets as well. This
diff --git a/gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp b/gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp
index 4b060b8dcd2..7c6b1cb2216 100644
--- a/gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp
+++ b/gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp
@@ -25,7 +25,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
@@ -139,7 +139,7 @@ proc get_next_insn {} {
set hw_step [probe_target_hardware_step]
-if ![get_function_bounds "main" main_lo main_hi] {
+if {![get_function_bounds "main" main_lo main_hi]} {
# Can't do the following tests if main's bounds are unknown.
return -1
}
diff --git a/gdb/testsuite/gdb.base/breakpoint-shadow.exp b/gdb/testsuite/gdb.base/breakpoint-shadow.exp
index a662016e2ac..8e74ec24cec 100644
--- a/gdb/testsuite/gdb.base/breakpoint-shadow.exp
+++ b/gdb/testsuite/gdb.base/breakpoint-shadow.exp
@@ -20,7 +20,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
}
# We need to start the inferior to place the breakpoints in the memory at all.
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
@@ -51,7 +51,7 @@ proc test_disassembly {test} {
gdb_test_multiple "disass main" $test {
-re $match {
set got $expect_out(1,string)
- if [string equal -nocase $orig $got] {
+ if {[string equal -nocase $orig $got]} {
pass $test
} else {
fail $test
diff --git a/gdb/testsuite/gdb.base/bt-on-fatal-signal.exp b/gdb/testsuite/gdb.base/bt-on-fatal-signal.exp
index 63428a1c93d..1ef977469fe 100644
--- a/gdb/testsuite/gdb.base/bt-on-fatal-signal.exp
+++ b/gdb/testsuite/gdb.base/bt-on-fatal-signal.exp
@@ -126,7 +126,7 @@ foreach test_data {{SEGV "Segmentation fault"} \
gdb_assert { $saw_fatal_msg }
gdb_assert { $saw_bt_start }
gdb_assert { $saw_bt_end }
- gdb_assert { [expr $internal_error_msg_count == 2] }
+ gdb_assert { [expr {$internal_error_msg_count == 2}] }
}
-re "$gdb_prompt $" {
# GDB should terminate, we should never get back to
diff --git a/gdb/testsuite/gdb.base/call-ar-st.exp b/gdb/testsuite/gdb.base/call-ar-st.exp
index 8b27d8d3723..fd1f1a09bd9 100644
--- a/gdb/testsuite/gdb.base/call-ar-st.exp
+++ b/gdb/testsuite/gdb.base/call-ar-st.exp
@@ -38,7 +38,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} {
set oldtimeout $timeout
-set timeout [expr "$timeout + 60"]
+set timeout [expr {$timeout + 60}]
gdb_test_no_output "set print sevenbit-strings"
gdb_test_no_output "set print address off"
@@ -86,7 +86,7 @@ set array_c_re \
"aZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ" \
"aZaZaZaZaZaZaZaZaZa"]
-if ![gdb_skip_stdio_test "print_char_array(char_array)"] {
+if {![gdb_skip_stdio_test "print_char_array(char_array)"]} {
gdb_test_stdio "print print_char_array(char_array)" $array_c_re
}
@@ -95,7 +95,7 @@ gdb_test "tbreak $stop_line" \
"Temporary breakpoint.*file.*$srcfile, line $stop_line.*" \
"tbreakpoint at tbreak2"
-if ![gdb_skip_stdio_test "continue to tbreak2"] {
+if {![gdb_skip_stdio_test "continue to tbreak2"]} {
set gdb_re \
[multi_line \
"main.*at.*:\[0-9\]+" \
@@ -106,7 +106,7 @@ if ![gdb_skip_stdio_test "continue to tbreak2"] {
}
# I am disabling this test, because it takes too long. I verified by
-# hand that it works, feel free to check for yourself.
+# hand that it works, feel free to check for yourself.
#call print_all_arrays(integer_array, char_array, float_array, double_array)
#send_gdb "print print_all_arrays(integer_array, char_array, float_array, double_array)\n"
#gdb_expect {
@@ -165,7 +165,7 @@ gdb_test "step" \
"step inside print_all_arrays"
#step -over
-if ![gdb_skip_stdio_test "next over print_int_array in print_all_arrays"] {
+if {![gdb_skip_stdio_test "next over print_int_array in print_all_arrays"]} {
set stop_line [gdb_get_line_number "-next1-"]
gdb_test_stdio "next" \
"array_i :" \
@@ -214,7 +214,7 @@ if {$allow_float_test && \
#call sum_array_print(10, *list1, *list2, *list3, *list4)
-if ![gdb_skip_stdio_test "print sum_array_print(...)"] {
+if {![gdb_skip_stdio_test "print sum_array_print(...)"]} {
gdb_test_stdio "print sum_array_print(10, *list1, *list2, *list3, *list4)" \
[multi_line \
@@ -239,7 +239,7 @@ if ![gdb_skip_stdio_test "print sum_array_print(...)"] {
#step over
set stop_line [gdb_get_line_number "-next2-"]
-if ![gdb_skip_stdio_test "next to next2"] {
+if {![gdb_skip_stdio_test "next to next2"]} {
gdb_test_stdio "next" \
"BYE BYE FOR NOW" \
"$stop_line.*printf\\(.VERY GREEN GRASS.n.\\);.*" \
@@ -250,7 +250,7 @@ if ![gdb_skip_stdio_test "next to next2"] {
#call print_array_rep(\*list1, \*list2, \*list3)
-if ![gdb_skip_stdio_test "print print_array_rep(...)"] {
+if {![gdb_skip_stdio_test "print print_array_rep(...)"]} {
gdb_test_stdio "print print_array_rep(\*list1, \*list2, \*list3)" \
"Contents of linked list3:"
}
@@ -300,7 +300,7 @@ gdb_test "tbreak $stop_line" \
"Temporary breakpoint.* file .*$srcfile, line $stop_line.*" \
"tbreakpoint at tbreak6"
-if ![gdb_skip_stdio_test "continuing to tbreak6"] {
+if {![gdb_skip_stdio_test "continuing to tbreak6"]} {
gdb_test_stdio "continue" \
"Sum of 4 arrays.*Contents of linked list1.*Contents of two_floats_t" \
"main \\(\\) at .*$srcfile:$stop_line.*c = 0.*" \
@@ -309,8 +309,8 @@ if ![gdb_skip_stdio_test "continuing to tbreak6"] {
gdb_test "continue" ".*" ""
}
-#call print_small_structs(*struct1, *struct2, *struct3, *struct4,
-# *flags, *flags_combo, *three_char, *five_char,
+#call print_small_structs(*struct1, *struct2, *struct3, *struct4,
+# *flags, *flags_combo, *three_char, *five_char,
# *int_char_combo, *d1, *d2, *d3, *f1, *f2, *f3)
if {$allow_float_test && \
@@ -373,7 +373,7 @@ gdb_test "print compute_with_small_structs(20)" \
"\[0-9\]+ = void"
-#call print_ten_doubles(123.456, 123.456, -0.12, -1.23, 343434.8, 89.098,
+#call print_ten_doubles(123.456, 123.456, -0.12, -1.23, 343434.8, 89.098,
# 3.14, -5678.12345, -0.11111111, 216.97065)
if {$allow_float_test && \
@@ -422,8 +422,8 @@ if {$allow_float_test} {
set ws "\[\n\r\t \]+"
-#call print_small_structs(struct1, struct2, struct3, struct4, flags,
-# flags_combo, three_char, five_char, int_char_combo,
+#call print_small_structs(struct1, struct2, struct3, struct4, flags,
+# flags_combo, three_char, five_char, int_char_combo,
# d1, d2, d3, f1, f2, f3)
if {$allow_float_test && \
@@ -495,7 +495,7 @@ gdb_test "tbreak $stop_line" \
"Temporary breakpoint.* file .*$srcfile, line $stop_line.*" \
"tbreakpoint at tbreak8"
-if ![gdb_skip_stdio_test "continuing to tbreak8"] {
+if {![gdb_skip_stdio_test "continuing to tbreak8"]} {
gdb_test_stdio "continue" \
"Contents of two_floats_t:" \
".*main \\(\\) at.*$srcfile:$stop_line.*$stop_line.*init_bit_flags_combo\\(flags_combo, \\(unsigned\\)1, \\(unsigned\\)0, .y.,.*" \
@@ -511,7 +511,7 @@ gdb_test "step" \
"step into init_bit_flags_combo"
#call print_bit_flags_combo(*bit_flags_combo)
-if ![gdb_skip_stdio_test "continuing at step3"] {
+if {![gdb_skip_stdio_test "continuing at step3"]} {
gdb_test_stdio "print print_bit_flags_combo(*bit_flags_combo)" \
"alpha.*gamma.*epsilon.*ch1: y.*ch2: n"
}
@@ -600,14 +600,14 @@ gdb_test continue "Continuing\\..*main \\(\\) at .*$srcfile:$stop_line\[ \t\n\r\
#call sum_struct_print(10, *struct1, *struct2, *struct3, *struct4)
-if ![gdb_skip_stdio_test "print sum_struct_print(...)"] {
+if {![gdb_skip_stdio_test "print sum_struct_print(...)"]} {
gdb_test_stdio "print sum_struct_print(10,*struct1,*struct2,*struct3,*struct4)" \
"Sum of the 4 struct values and seed :\[ \t\n\r\]+218"
}
#call print_struct_rep(*struct1, *struct2, *struct3)
-if ![gdb_skip_stdio_test "print print_struct_rep(...)"] {
+if {![gdb_skip_stdio_test "print print_struct_rep(...)"]} {
gdb_test_stdio "print print_struct_rep(*struct1, *struct2, *struct3)" \
[multi_line \
"Contents of struct1: " \
@@ -622,7 +622,7 @@ if ![gdb_skip_stdio_test "print print_struct_rep(...)"] {
]
}
-if ![gdb_skip_stdio_test "print print_one_large_struct(...)"] {
+if {![gdb_skip_stdio_test "print print_one_large_struct(...)"]} {
gdb_test_stdio "print print_one_large_struct(*list1)" \
" 4 1"
}
diff --git a/gdb/testsuite/gdb.base/call-rt-st.exp b/gdb/testsuite/gdb.base/call-rt-st.exp
index 511e209a060..4ce686b6759 100644
--- a/gdb/testsuite/gdb.base/call-rt-st.exp
+++ b/gdb/testsuite/gdb.base/call-rt-st.exp
@@ -109,13 +109,13 @@ proc print_struct_call { expr inf_result gdb_result } {
}
-if ![gdb_skip_stdio_test "print print_struct_rep(*struct1)"] {
+if {![gdb_skip_stdio_test "print print_struct_rep(*struct1)"]} {
print_struct_call "print_struct_rep(*struct1)" \
".*Contents of struct1:\[ \t\n\r\]+22\[ \t\]+0\[ \t\n\r\]+" \
".\[0-9\]+ = \\{value = 5, head = 0\\}"
}
-if ![gdb_skip_stdio_test "print print_one_large_struct(...)"] {
+if {![gdb_skip_stdio_test "print print_one_large_struct(...)"]} {
print_struct_call "print_one_large_struct(*list1)" \
".*\[ \t\]+4\[ \t\]+1\[ \r\n\]+" \
".\[0-9\]+ = \\{next_index = \\{1, 2, 3, 4, 5, 6, 7, 8, 9, 10\\}, values = \\{4, 6, 8, 10, 12, 14, 16, 18, 20, 22\\}, head = 0\\}"
@@ -135,43 +135,43 @@ if {$allow_float_test && \
".\[0-9\]+ = \\{float1 = -2\\.34500003, float2 = 1\\}"
}
-if ![gdb_skip_stdio_test "print print_bit_flags_char(*cflags)"] {
+if {![gdb_skip_stdio_test "print print_bit_flags_char(*cflags)"]} {
print_struct_call "print_bit_flags_char(*cflags)" \
".*alpha\[ \r\n\]+gamma\[ \r\n\]+epsilon\[ \r\n\]+" \
".\[0-9\]+ = \\{alpha = 1 '\\\\001', beta = 0 '\\\\000', gamma = 1 '\\\\001', delta = 0 '\\\\000', epsilon = 1 '\\\\001', omega = 0 '\\\\000'\\}"
}
-if ![gdb_skip_stdio_test "print print_bit_flags_short(*sflags)"] {
+if {![gdb_skip_stdio_test "print print_bit_flags_short(*sflags)"]} {
print_struct_call "print_bit_flags_short(*sflags)" \
".*alpha\[ \r\n\]+gamma\[ \r\n\]+epsilon\[ \r\n\]+" \
".\[0-9\]+ = \\{alpha = 1, beta = 0, gamma = 1, delta = 0, epsilon = 1, omega = 0\\}"
}
-if ![gdb_skip_stdio_test "print print_bit_flags(*flags)"] {
+if {![gdb_skip_stdio_test "print print_bit_flags(*flags)"]} {
print_struct_call "print_bit_flags(*flags)" \
".*alpha\[ \r\n\]+gamma\[ \r\n\]+epsilon\[ \r\n\]+" \
".\[0-9\]+ = \\{alpha = 1, beta = 0, gamma = 1, delta = 0, epsilon = 1, omega = 0\\}"
}
-if ![gdb_skip_stdio_test "print print_bit_flags_combo(*flags_combo)"] {
+if {![gdb_skip_stdio_test "print print_bit_flags_combo(*flags_combo)"]} {
print_struct_call "print_bit_flags_combo(*flags_combo)" \
".*alpha\[ \r\n\]+gamma\[ \r\n\]+epsilon\[ \r\n\]+ch1: y\[ \t\]+ch2: n\[ \r\n\]+" \
".\[0-9\]+ = \\{alpha = 1, beta = 0, ch1 = 121 'y', gamma = 1, delta = 0, ch2 = 110 'n', epsilon = 1, omega = 0\\}"
}
-if ![gdb_skip_stdio_test "print print_three_chars(*three_chars)"] {
+if {![gdb_skip_stdio_test "print print_three_chars(*three_chars)"]} {
print_struct_call "print_three_chars(*three_char)" \
".*Contents of three_char_t:\[ \r\n\]+x\[ \t\]+y\[ \t\]+z\[ \r\n\]+" \
".\[0-9\]+ = \\{ch1 = 120 'x', ch2 = 121 'y', ch3 = 122 'z'\\}"
}
-if ![gdb_skip_stdio_test "print print_five_chars(*five_chars)"] {
+if {![gdb_skip_stdio_test "print print_five_chars(*five_chars)"]} {
print_struct_call "print_five_chars(*five_char)" \
".*Contents of five_char_t:\[ \r\n\]+h\[ \t\]+e\[ \t\]+l\[ \t\]+l\[ \t\]+o\[ \r\n\]+" \
".\[0-9\]+ = \\{ch1 = 104 'h', ch2 = 101 'e', ch3 = 108 'l', ch4 = 108 'l', ch5 = 111 'o'\\}"
}
-if ![gdb_skip_stdio_test "print print_int_char_combo(*int_char_combo)"] {
+if {![gdb_skip_stdio_test "print print_int_char_combo(*int_char_combo)"]} {
print_struct_call "print_int_char_combo(*int_char_combo)" \
".*Contents of int_char_combo_t:\[ \r\n\]+13\[ \t\]+!\[ \r\n\]+" \
".\[0-9\]+ = \\{int1 = 13, ch1 = 33 '!'\\}"
diff --git a/gdb/testsuite/gdb.base/call-sc.exp b/gdb/testsuite/gdb.base/call-sc.exp
index f67670dccc5..ff4e7ac92d8 100644
--- a/gdb/testsuite/gdb.base/call-sc.exp
+++ b/gdb/testsuite/gdb.base/call-sc.exp
@@ -107,7 +107,7 @@ proc test_scalar_calls { } {
# Check that GDB can always extract a scalar-return value from an
# inferior function call. Since GDB always knows the location of
# an inferior function call's return value these should never fail
-
+
# Implemented by calling the parameterless function "fun" and then
# examining the return value printed by GDB.
@@ -250,7 +250,7 @@ proc test_scalar_returns { } {
set test "value foo returned; ${tests}"
gdb_test_multiple "p/c L" "${test}" {
-re " = 49 '1'.*${gdb_prompt} $" {
- if $return_value_unknown {
+ if {$return_value_unknown} {
# This contradicts the above claim that GDB didn't
# know the location of the return-value.
fail "${test}"
@@ -259,7 +259,7 @@ proc test_scalar_returns { } {
}
}
-re " = 90 .*${gdb_prompt} $" {
- if $return_value_unknown {
+ if {$return_value_unknown} {
# The struct return case. Since any modification
# would be by reference, and that can't happen, the
# value should be unmodified and hence Z is expected.
@@ -272,7 +272,7 @@ proc test_scalar_returns { } {
}
}
-re " = 57 .*${gdb_prompt} $" {
- if $return_value_unknown {
+ if {$return_value_unknown} {
# The struct return case.
# The return value is stored on the stack, and since GDB
# didn't override it, it still has value that was stored
@@ -285,7 +285,7 @@ proc test_scalar_returns { } {
}
}
-re ".*${gdb_prompt} $" {
- if $return_value_unimplemented {
+ if {$return_value_unimplemented} {
# What a surprise. The architecture hasn't implemented
# return_value, and hence has to fail.
kfail "$test" gdb/1444
@@ -293,8 +293,8 @@ proc test_scalar_returns { } {
fail "$test"
}
}
- }
-
+ }
+
# Check that a "finish" works.
# This is almost but not quite the same as "call struct funcs".
@@ -334,7 +334,7 @@ proc test_scalar_returns { } {
set test "value foo finished; ${tests}"
gdb_test_multiple "p/c" "${test}" {
-re " = 49 '1'\[\r\n\]+${gdb_prompt} $" {
- if $finish_value_unknown {
+ if {$finish_value_unknown} {
# This contradicts the above claim that GDB didn't
# know the location of the return-value.
fail "${test}"
@@ -344,7 +344,7 @@ proc test_scalar_returns { } {
}
-re " = 90 'Z'\[\r\n\]+${gdb_prompt} $" {
# The value didn't get found. This is "expected".
- if $finish_value_unknown {
+ if {$finish_value_unknown} {
pass "${test}"
} else {
# This contradicts the above claim that GDB did
diff --git a/gdb/testsuite/gdb.base/call-strs.exp b/gdb/testsuite/gdb.base/call-strs.exp
index 43e4712f86d..02eecb699ac 100644
--- a/gdb/testsuite/gdb.base/call-strs.exp
+++ b/gdb/testsuite/gdb.base/call-strs.exp
@@ -67,70 +67,70 @@ gdb_test "print s" \
" = \"test string\".*"
#print str_func1(s)
-if ![gdb_skip_stdio_test "print str_func1(s)"] {
+if {![gdb_skip_stdio_test "print str_func1(s)"]} {
gdb_test_stdio "print str_func1(s)" \
"first string arg is: test string" \
"\"test string\".*"
}
#print str_func1("test string")
-if ![gdb_skip_stdio_test "print str_func1(teststring)"] {
+if {![gdb_skip_stdio_test "print str_func1(teststring)"]} {
gdb_test_stdio "print str_func1(\"test string\")" \
"first string arg is: test string" \
"\"test string\".*"
}
#call str_func1(s)
-if ![gdb_skip_stdio_test "call str_func1(s)"] {
+if {![gdb_skip_stdio_test "call str_func1(s)"]} {
gdb_test_stdio "call str_func1(s)" \
"first string arg is: test string" \
"\"test string\".*"
}
#call str_func1("test string")
-if ![gdb_skip_stdio_test "call str_func1 (...)"] {
+if {![gdb_skip_stdio_test "call str_func1 (...)"]} {
gdb_test_stdio "call str_func1(\"test string\")" \
"first string arg is: test string" \
"\"test string\".*"
}
#print str_func1(buf)
-if ![gdb_skip_stdio_test "print str_func1(buf)"] {
+if {![gdb_skip_stdio_test "print str_func1(buf)"]} {
gdb_test_stdio "print str_func1(buf)" \
"first string arg is: test string" \
"\"test string\".*"
}
#call str_func1(buf)
-if ![gdb_skip_stdio_test "call str_func1(buf)"] {
+if {![gdb_skip_stdio_test "call str_func1(buf)"]} {
gdb_test_stdio "call str_func1(buf)" \
"first string arg is: test string" \
"\"test string\".*"
}
#print str_func("a","b","c","d","e","f","g")
-if ![gdb_skip_stdio_test "print str_func(a,b,c,d,e,f,g)"] {
+if {![gdb_skip_stdio_test "print str_func(a,b,c,d,e,f,g)"]} {
gdb_test_stdio "print str_func(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\")" \
"first string arg is: a\[ \t\r\n\]+second string arg is: b\[ \t\r\n\]+third string arg is: c\[ \t\r\n\]+fourth string arg is: d\[ \t\r\n\]+fifth string arg is: e\[ \t\r\n\]+sixth string arg is: f\[ \t\r\n\]+seventh string arg is: g\[ \t\r\n\]+" \
"= \"abcdefg\".*"
}
#call str_func("a","b","c","d","e","f","g")
-if ![gdb_skip_stdio_test "call str_func(a,b,c,d,e,f,g)"] {
+if {![gdb_skip_stdio_test "call str_func(a,b,c,d,e,f,g)"]} {
gdb_test_stdio "call str_func(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\")" \
"first string arg is: a\[ \t\r\n\]+second string arg is: b\[ \t\r\n\]+third string arg is: c\[ \t\r\n\]+fourth string arg is: d\[ \t\r\n\]+fifth string arg is: e\[ \t\r\n\]+sixth string arg is: f\[ \t\r\n\]+seventh string arg is: g\[ \t\r\n\]+" \
"= \"abcdefg\".*"
}
#print str_func(s,s,s,s,s,s,s)
-if ![gdb_skip_stdio_test "print str_func(s,s,s,s,s,s,s,s)"] {
+if {![gdb_skip_stdio_test "print str_func(s,s,s,s,s,s,s,s)"]} {
gdb_test_stdio "print str_func(s,s,s,s,s,s,s)" \
"first string arg is: test string\[ \t\r\n\]+second string arg is: test string\[ \t\r\n\]+third string arg is: test string\[ \t\r\n\]+fourth string arg is: test string\[ \t\r\n\]+fifth string arg is: test string\[ \t\r\n\]+sixth string arg is: test string\[ \t\r\n\]+seventh string arg is: test string\[ \t\r\n\]+" \
"\"test stringtest stringtest stringtest stringtest stringtest stringtest string\".*"
}
#call str_func(s,s,s,s,s,s,s)
-if ![gdb_skip_stdio_test "call str_func(s,s,s,s,s,s,s,s)"] {
+if {![gdb_skip_stdio_test "call str_func(s,s,s,s,s,s,s,s)"]} {
gdb_test_stdio "call str_func(s,s,s,s,s,s,s)" \
"first string arg is: test string\[ \t\r\n\]+second string arg is: test string\[ \t\r\n\]+third string arg is: test string\[ \t\r\n\]+fourth string arg is: test string\[ \t\r\n\]+fifth string arg is: test string\[ \t\r\n\]+sixth string arg is: test string\[ \t\r\n\]+seventh string arg is: test string\[ \t\r\n\]+" \
"\"test stringtest stringtest stringtest stringtest stringtest stringtest string\".*"
diff --git a/gdb/testsuite/gdb.base/callfuncs.exp b/gdb/testsuite/gdb.base/callfuncs.exp
index 0e1997af17b..59306d47a4e 100644
--- a/gdb/testsuite/gdb.base/callfuncs.exp
+++ b/gdb/testsuite/gdb.base/callfuncs.exp
@@ -21,7 +21,7 @@ standard_testfile
# We still want to test non-prototype functions for now, which is why
# we disable compilers warning about them.
set compile_flags {debug additional_flags=-Wno-deprecated-non-prototype}
-if [support_complex_tests] {
+if {[support_complex_tests]} {
lappend compile_flags "additional_flags=-DTEST_COMPLEX"
}
@@ -132,7 +132,7 @@ proc do_function_calls {prototypes} {
gdb_test "p t_int_double(99, 99.0)" " = 1"
}
- if [support_complex_tests] {
+ if {[support_complex_tests]} {
gdb_test "p t_float_complex_values(fc1, fc2)" " = 1"
gdb_test "p t_float_complex_values(fc3, fc4)" " = 0"
@@ -221,7 +221,7 @@ proc do_function_calls {prototypes} {
"call inferior func with struct - returns double"
}
- if [support_complex_tests] {
+ if {[support_complex_tests]} {
gdb_test "p t_structs_fc(struct_val1)" ".*= 3 \\+ 3i" \
"call inferior func with struct - returns float _Complex"
@@ -257,7 +257,7 @@ proc fetch_all_registers {test} {
exp_continue
}
-re "^bspstore\[ \t\]+\[^\r\n\]+\r\n" {
- if [istarget "ia64-*-*"] {
+ if {[istarget "ia64-*-*"]} {
# Filter out bspstore which is specially tied to bsp,
# giving spurious differences.
} else {
@@ -266,7 +266,7 @@ proc fetch_all_registers {test} {
exp_continue
}
-re "^pstate\[ \t\]+\[^\r\n\]+\r\n" {
- if [istarget "sparc64-*-linux-gnu"] {
+ if {[istarget "sparc64-*-linux-gnu"]} {
# Filter out the pstate register, since in sparc64
# targets the Linux kernel disables pstate.PEF when
# returning from traps, giving spurious differences.
@@ -276,7 +276,7 @@ proc fetch_all_registers {test} {
exp_continue
}
-re "^last_break\[ \t\]+\[^\r\n\]+\r\n" {
- if [istarget "s390*-*-*"] {
+ if {[istarget "s390*-*-*"]} {
# Filter out last_break which is read-only,
# giving spurious differences.
} else {
@@ -285,7 +285,7 @@ proc fetch_all_registers {test} {
exp_continue
}
-re "^\(?:cycle\|instret\)\[ \t\]+\[^\r\n\]+\r\n" {
- if [istarget "riscv*-*-*"] {
+ if {[istarget "riscv*-*-*"]} {
# Filter out the cycle counter and instructions
# retired counter CSRs which are read-only, giving
# spurious differences.
@@ -386,9 +386,9 @@ proc perform_all_tests {prototypes} {
"The program being debugged stopped while.*" \
"stop at breakpoint in call dummy function"
gdb_test "continue" "Continuing.*" "continue from call dummy breakpoint"
- if ![gdb_test "bt 2" \
- "#0 main.*" \
- "bt after continuing from call dummy breakpoint"] then {
+ if {![gdb_test "bt 2" \
+ "#0 main.*" \
+ "bt after continuing from call dummy breakpoint"]} then {
set new_reg_content [fetch_all_registers \
"register contents after stop in call dummy"]
if {$old_reg_content == $new_reg_content} {
@@ -412,9 +412,9 @@ proc perform_all_tests {prototypes} {
gdb_test "finish" \
"Value returned is .* = 9" \
"finish from call dummy breakpoint returns correct value"
- if ![gdb_test "bt 2" \
- "#0 main.*" \
- "bt after finishing from call dummy breakpoint"] then {
+ if {![gdb_test "bt 2" \
+ "#0 main.*" \
+ "bt after finishing from call dummy breakpoint"]} then {
set new_reg_content [fetch_all_registers \
"register contents after finish in call dummy"]
if {$old_reg_content == $new_reg_content} {
@@ -435,11 +435,11 @@ proc perform_all_tests {prototypes} {
# with a value, make sure we are back at main with the same register contents.
gdb_test "print add(4,5)" "The program being debugged stopped while.*" \
"call function causing a breakpoint and then do a return"
- if ![gdb_test "return 7" \
- "#0 main.*" \
- "back at main after return from call dummy breakpoint" \
- "Make add return now. .y or n.*" \
- "y"] then {
+ if {![gdb_test "return 7" \
+ "#0 main.*" \
+ "back at main after return from call dummy breakpoint" \
+ "Make add return now. .y or n.*" \
+ "y"]} then {
set new_reg_content [fetch_all_registers \
"register contents after return in call dummy"]
if {$old_reg_content == $new_reg_content} {
diff --git a/gdb/testsuite/gdb.base/cast-indirection.exp b/gdb/testsuite/gdb.base/cast-indirection.exp
index ce828db1676..198b0aa19fa 100644
--- a/gdb/testsuite/gdb.base/cast-indirection.exp
+++ b/gdb/testsuite/gdb.base/cast-indirection.exp
@@ -22,7 +22,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile \
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
diff --git a/gdb/testsuite/gdb.base/catch-fork-kill.exp b/gdb/testsuite/gdb.base/catch-fork-kill.exp
index 224a8dfec89..e851d66e767 100644
--- a/gdb/testsuite/gdb.base/catch-fork-kill.exp
+++ b/gdb/testsuite/gdb.base/catch-fork-kill.exp
@@ -59,7 +59,7 @@ proc do_test {fork_kind exit_kind} {
with_test_prefix "$fork_kind" {
clean_restart $testfile
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
diff --git a/gdb/testsuite/gdb.base/catch-gdb-caused-signals.exp b/gdb/testsuite/gdb.base/catch-gdb-caused-signals.exp
index aa629727d5d..862cae4074f 100644
--- a/gdb/testsuite/gdb.base/catch-gdb-caused-signals.exp
+++ b/gdb/testsuite/gdb.base/catch-gdb-caused-signals.exp
@@ -36,7 +36,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} {
return -1
}
-if ![runto_main] {
+if {![runto_main]} {
return -1
}
@@ -47,7 +47,7 @@ gdb_test "handle SIGILL nostop noprint" \
gdb_test "print return_one()" " = 1"
-if ![target_info exists gdb,noinferiorio] {
+if {![target_info exists gdb,noinferiorio]} {
# Clean up the breakpoint state.
delete_breakpoints
diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp
index 9c5839c2991..0a1a4f3ca55 100644
--- a/gdb/testsuite/gdb.base/catch-syscall.exp
+++ b/gdb/testsuite/gdb.base/catch-syscall.exp
@@ -348,7 +348,7 @@ proc test_catch_syscall_execve {} {
# Check for entry/return across the execve, making sure that the
# syscall_state isn't lost when turning into a new process.
insert_catch_syscall_with_arg "execve"
- if [check_continue "execve"] {
+ if {[check_continue "execve"]} {
# The check_continue test generates an XFAIL on Powerpc. In
# that case, gdb is already at main so don't do the continue.
diff --git a/gdb/testsuite/gdb.base/charset.exp b/gdb/testsuite/gdb.base/charset.exp
index 75fb9f09d0c..80fbf4adfc2 100644
--- a/gdb/testsuite/gdb.base/charset.exp
+++ b/gdb/testsuite/gdb.base/charset.exp
@@ -391,7 +391,7 @@ foreach target_charset $charset_subset {
set var_name [string tolower "${target_charset}_string"]
regsub -all -- "\[^a-z0-9_\]" $var_name "_" var_name
}
-
+
# Compute a regexp matching the results we expect. This is static,
# but it's easier than writing it out.
regsub -all "." "abfnrtv" "(\\\\&|x)" escapes
@@ -492,7 +492,7 @@ foreach target_charset $charset_subset {
}
}
- # Try printing a character escape that doesn't exist. We should
+ # Try printing a character escape that doesn't exist. We should
# get the unescaped character, in the target character set.
gdb_test "print $L'\\q'" " = \[0-9-\]+ $L'q'" \
"print escape that doesn't exist in $target_charset"
@@ -549,7 +549,7 @@ if {$wchar_ok} {
set ucs2_ok [expr {[get_sizeof char16_t 99] == 2}]
-if ![valid_host_charset "UTF-16"] {
+if {![valid_host_charset "UTF-16"]} {
verbose -log "Disabling UTF-16 tests."
set ucs2_ok 0
}
@@ -640,4 +640,4 @@ foreach name {short int long} {
}
-gdb_exit
+gdb_exit
diff --git a/gdb/testsuite/gdb.base/chng-syms.exp b/gdb/testsuite/gdb.base/chng-syms.exp
index dbc523d2caf..0f7be07c3dc 100644
--- a/gdb/testsuite/gdb.base/chng-syms.exp
+++ b/gdb/testsuite/gdb.base/chng-syms.exp
@@ -15,8 +15,8 @@
# Author: Paul N. Hilfinger (Hilfinger@gnat.com)
-# Test that GDB cleans up properly after errors that result when a
-# breakpoint is reset.
+# Test that GDB cleans up properly after errors that result when a
+# breakpoint is reset.
standard_testfile .c
@@ -45,21 +45,21 @@ gdb_test "break stop_here if (var1 == 42)" \
gdb_run_cmd
expect_to_stop_here "first time"
-
+
gdb_continue_to_end "breakpoint first time through"
# Now we recompile the executable, but without a variable named "var1", first
# waiting to insure that even on fast machines, the file modification times
-# are distinct. This will force GDB to reload the file on the
-# next "run" command, causing an error when GDB tries to tries to reset
+# are distinct. This will force GDB to reload the file on the
+# next "run" command, causing an error when GDB tries to tries to reset
# the breakpoint.
sleep 2
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DVARIABLE=var2}] != "" } {
-# Complication: Since GDB generally holds an open file descriptor on the
-# executable at this point, there are some systems in which the
-# re-compilation will fail. In such cases, we'll consider the test
+# Complication: Since GDB generally holds an open file descriptor on the
+# executable at this point, there are some systems in which the
+# re-compilation will fail. In such cases, we'll consider the test
# (vacuously) passed providing that re-running it succeeds as before.
gdb_run_cmd
diff --git a/gdb/testsuite/gdb.base/code-expr.exp b/gdb/testsuite/gdb.base/code-expr.exp
index 8af2ee69c23..38f238cd1f5 100644
--- a/gdb/testsuite/gdb.base/code-expr.exp
+++ b/gdb/testsuite/gdb.base/code-expr.exp
@@ -275,7 +275,7 @@ gdb_test "whatis (enum misordered @data) v_misordered" \
"type = @data enum misordered" \
"(enum misordered @data)"
-#
+#
# Pointers
#
diff --git a/gdb/testsuite/gdb.base/commands.exp b/gdb/testsuite/gdb.base/commands.exp
index aa5ed56b947..c21be235491 100644
--- a/gdb/testsuite/gdb.base/commands.exp
+++ b/gdb/testsuite/gdb.base/commands.exp
@@ -255,7 +255,7 @@ proc_with_prefix infrun_breakpoint_command_test {} {
delete_breakpoints
gdb_test "break factorial if value == 5" "Breakpoint.*at.*"
-# infrun_breakpoint_command_test - This test was broken into two parts
+# infrun_breakpoint_command_test - This test was broken into two parts
# to get around a synchronization problem in expect.
# part1: issue the gdb command "commands"
# part2: send the list of commands
@@ -547,7 +547,7 @@ proc_with_prefix user_defined_command_manyargs_test {} {
set expected "nargs=$nargs:"
for {set i 1} {$i <= $nargs} {incr i} {
- append expected " " [expr 2 * $i]
+ append expected " " [expr {2 * $i}]
}
gdb_test $cmd $expected "execute command"
@@ -658,7 +658,7 @@ proc_with_prefix test_command_prompt_position {} {
gdb_test_multiple "printf \"Now the value is %d\\n\", value" $test {
-re "^printf.*value\r\n>$" {
gdb_test_multiple "end" $test {
- -re "^end\r\n$gdb_prompt $" {
+ -re "^end\r\n$gdb_prompt $" {
pass $test
}
}
@@ -681,7 +681,7 @@ proc_with_prefix deprecated_command_test {} {
gdb_test "p 5" ".\[0-9\]* = 5.*" "deprecated warning goes away /1/"
gdb_test_no_output "maintenance deprecate p \"new_p\"" "maintenance deprecate p \"new_p\" /2/"
- gdb_test_no_output "maintenance deprecate print \"new_print\""
+ gdb_test_no_output "maintenance deprecate print \"new_print\""
gdb_test "p 5" \
"Warning: command 'print' \\(p\\) is deprecated.*Use 'new_print'.*" \
"both alias and command are deprecated"
@@ -751,7 +751,7 @@ proc_with_prefix bp_deleted_in_command_test {} {
# one command that deletes this breakpoint.
gdb_test "break factorial" \
"Breakpoint \[0-9\]+ at .*: file .*run.c, line \[0-9\]+\."
-
+
gdb_test_multiple "commands" "begin commands" {
-re "Type commands for breakpoint.*>$" {
pass "begin commands"
diff --git a/gdb/testsuite/gdb.base/compare-sections.exp b/gdb/testsuite/gdb.base/compare-sections.exp
index 981fa7b0af4..b95149e5aab 100644
--- a/gdb/testsuite/gdb.base/compare-sections.exp
+++ b/gdb/testsuite/gdb.base/compare-sections.exp
@@ -136,7 +136,7 @@ with_test_prefix "read-only" {
}
# Come up with different value.
- set patch [expr 255 - $orig]
+ set patch [expr {255 - $orig}]
# Write PATCH to memory.
set written -1
diff --git a/gdb/testsuite/gdb.base/completion.exp b/gdb/testsuite/gdb.base/completion.exp
index ca37559e89c..59a6c57140b 100644
--- a/gdb/testsuite/gdb.base/completion.exp
+++ b/gdb/testsuite/gdb.base/completion.exp
@@ -20,7 +20,7 @@
#
# tests for command completion
#
-# Here are some useful test cases for completion.
+# Here are some useful test cases for completion.
# They should be tested with both M-? and TAB.
#
# "show output-" "radix"
@@ -676,7 +676,7 @@ with_cwd $srcdir {
}
# If the directory name contains a '+' we must escape it, adding a backslash.
-# If not, the test below will fail because it will interpret the '+' as a
+# If not, the test below will fail because it will interpret the '+' as a
# regexp operator. We use string_to_regexp for this purpose.
gdb_test "cd ${fullsrcdir}" \
diff --git a/gdb/testsuite/gdb.base/comprdebug.exp b/gdb/testsuite/gdb.base/comprdebug.exp
index 686178ddadb..d8859c58e32 100644
--- a/gdb/testsuite/gdb.base/comprdebug.exp
+++ b/gdb/testsuite/gdb.base/comprdebug.exp
@@ -25,7 +25,7 @@ if {[gdb_compile $srcdir/$subdir/$srcfile $ofile \
set objcopy_program [gdb_find_objcopy]
set cmd "$objcopy_program --compress-debug-sections $ofile"
verbose "invoking $cmd"
-set result [catch "exec $cmd" output]
+set result [catch {exec {*}$cmd} output]
verbose "result is $result"
verbose "output is $output"
diff --git a/gdb/testsuite/gdb.base/cond-eval-mode.exp b/gdb/testsuite/gdb.base/cond-eval-mode.exp
index ea436833c1d..9f49801d890 100644
--- a/gdb/testsuite/gdb.base/cond-eval-mode.exp
+++ b/gdb/testsuite/gdb.base/cond-eval-mode.exp
@@ -58,7 +58,7 @@ gdb_test_multiple $test_target $test_target {
# We now know that the target supports target-side conditional
# evaluation. Now make sure we can force-disable the
# ConditionalBreakpoints RSP feature.
-if [gdb_protocol_is_remote] {
+if {[gdb_protocol_is_remote]} {
gdb_test \
"set remote conditional-breakpoints-packet off" \
"Support for the 'ConditionalBreakpoints' packet on the current remote target is set to \"off\"."
diff --git a/gdb/testsuite/gdb.base/cond-expr.exp b/gdb/testsuite/gdb.base/cond-expr.exp
index 20809378b02..31c2545b9b7 100644
--- a/gdb/testsuite/gdb.base/cond-expr.exp
+++ b/gdb/testsuite/gdb.base/cond-expr.exp
@@ -18,7 +18,7 @@
# This file is part of the gdb testsuite
#
-# test of evaluation of conditional expressions, with constants and
+# test of evaluation of conditional expressions, with constants and
# variables. Using the print and the whatis command
# written with the only purpose in mind to cover the holes in the
# eval.c file
diff --git a/gdb/testsuite/gdb.base/condbreak-bad.exp b/gdb/testsuite/gdb.base/condbreak-bad.exp
index 19c16dc3c52..578478da7ca 100644
--- a/gdb/testsuite/gdb.base/condbreak-bad.exp
+++ b/gdb/testsuite/gdb.base/condbreak-bad.exp
@@ -94,7 +94,7 @@ with_test_prefix "with continue 2" {
set bpnum [get_integer_valueof "\$bpnum" 0 "get bpnum"]
gdb_test_no_output "cond $bpnum a == 999"
-
+
gdb_test "cond $bpnum gibberish" \
"No symbol \"gibberish\" in current context." \
"attempt a bad condition"
diff --git a/gdb/testsuite/gdb.base/condbreak.exp b/gdb/testsuite/gdb.base/condbreak.exp
index 81b1a36aa22..6392dbccac1 100644
--- a/gdb/testsuite/gdb.base/condbreak.exp
+++ b/gdb/testsuite/gdb.base/condbreak.exp
@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# This test was written by Rich Title.
+# This test was written by Rich Title.
# Purpose is to test conditional breakpoints.
# Modeled after "break.exp".
@@ -42,7 +42,7 @@ gdb_test "break -q main" \
"Breakpoint.*at.* file .*$srcfile, line.*" \
"breakpoint function"
-#
+#
# test conditional break at function
#
gdb_test "break marker1 if 1==1" \
@@ -58,7 +58,7 @@ gdb_test "break $srcfile:$bp_location1 if 1==1" \
gdb_test_no_output "delete 3"
-#
+#
# test conditional break at function
#
gdb_test "break marker1 if (1==1)" \
@@ -139,7 +139,7 @@ gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.
# user instruction, GDB's search finds the second line entry, decides
# that the PC is indeed at the beginning of a source line, and doesn't
# print an address in the breakpoint hit message.
-#
+#
# GCC's Dwarf2 writer, on the other hand, squeezes out duplicate line
# entries, so GDB considers the source line to begin at the start of
# the function's prologue. Thus, if the program stops at the
diff --git a/gdb/testsuite/gdb.base/consecutive-step-over.exp b/gdb/testsuite/gdb.base/consecutive-step-over.exp
index 11164788638..65379cc89ce 100644
--- a/gdb/testsuite/gdb.base/consecutive-step-over.exp
+++ b/gdb/testsuite/gdb.base/consecutive-step-over.exp
@@ -39,7 +39,7 @@ set n_insns 3
# Extract addresses of a few consecutive instructions.
set test "get breakpoint addresses"
-if { [gdb_test_multiple "x /[expr $n_insns + 1]i \$pc" $test {
+if { [gdb_test_multiple "x /[expr {$n_insns + 1}]i \$pc" $test {
-re "=> $hex${up_to_nl} ($hex)${up_to_nl} ($hex)${up_to_nl} ($hex)${up_to_nl}$gdb_prompt $" {
for {set i 1} {$i <= $n_insns} {incr i} {
set bp_addrs($i) $expect_out($i,string)
diff --git a/gdb/testsuite/gdb.base/constvars.exp b/gdb/testsuite/gdb.base/constvars.exp
index dcc8d1b7790..4abd745d76b 100644
--- a/gdb/testsuite/gdb.base/constvars.exp
+++ b/gdb/testsuite/gdb.base/constvars.exp
@@ -54,7 +54,7 @@ proc local_compiler_xfail_check { } {
if {[test_compiler_info gcc-2-*]} {
if { ![test_debug_format "HP"] \
&& ![test_debug_format "DWARF \[0-9\]"] } then {
- setup_xfail "*-*-*"
+ setup_xfail "*-*-*"
}
}
}
@@ -69,7 +69,7 @@ proc local_compiler_xfail_check_2 { } {
}
}
-gdb_test "break marker1" "Breakpoint $decimal at .*"
+gdb_test "break marker1" "Breakpoint $decimal at .*"
gdb_test_multiple "cont" "up from marker1" {
-re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
diff --git a/gdb/testsuite/gdb.base/continue-after-aborted-step-over.exp b/gdb/testsuite/gdb.base/continue-after-aborted-step-over.exp
index 8ba1f61fc2a..2bac0007e26 100644
--- a/gdb/testsuite/gdb.base/continue-after-aborted-step-over.exp
+++ b/gdb/testsuite/gdb.base/continue-after-aborted-step-over.exp
@@ -51,7 +51,7 @@ proc do_test {displaced breakpoint_always_inserted} {
gdb_test_no_output "set displaced-stepping $displaced"
gdb_test_no_output "set breakpoint always-inserted $breakpoint_always_inserted"
- if ![runto_main] {
+ if {![runto_main]} {
return -1
}
@@ -59,7 +59,7 @@ proc do_test {displaced breakpoint_always_inserted} {
# any kind of breakpoint insertion failure. If we can examine
# what's at memory address 0, it is possible that we could also
# execute it.
- if [is_address_zero_readable] {
+ if {[is_address_zero_readable]} {
untested "memory at address 0 is possibly executable"
return
}
diff --git a/gdb/testsuite/gdb.base/continue-all-already-running.exp b/gdb/testsuite/gdb.base/continue-all-already-running.exp
index 5d59f8ddcef..a3e8c276c40 100644
--- a/gdb/testsuite/gdb.base/continue-all-already-running.exp
+++ b/gdb/testsuite/gdb.base/continue-all-already-running.exp
@@ -25,7 +25,7 @@ save_vars { GDBFLAGS } {
}
}
-if ![runto_main] {
+if {![runto_main]} {
return
}
diff --git a/gdb/testsuite/gdb.base/coredump-filter-build-id.exp b/gdb/testsuite/gdb.base/coredump-filter-build-id.exp
index eb5b4895b82..75ba07d5fcc 100644
--- a/gdb/testsuite/gdb.base/coredump-filter-build-id.exp
+++ b/gdb/testsuite/gdb.base/coredump-filter-build-id.exp
@@ -48,7 +48,7 @@ if { ![gdb_gcore_cmd "$corefilename" "save corefile"] } {
# Determine if GDB dumped the mapping containing the build-id. This
# is done by invoking an external program (eu-unstrip).
-if { [catch "exec [gdb_find_eu-unstrip] -n --core $corefilename" output] == 0 } {
+if { [catch {exec [gdb_find_eu-unstrip] -n --core $corefilename} output] == 0 } {
set line [lindex [split $out[...]
[diff truncated at 100000 bytes]
More information about the Gdb-cvs
mailing list