From 202beb3feebd44fbc1979d9fdb4d74c44e16a417 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Fri, 5 Sep 2025 15:36:23 +0200 Subject: [PATCH] [gdb/testsuite] Fix clean_restart in gdb.base, part 1 Run: ... $ find gdb/testsuite/gdb.base/ -name *.exp* \ | xargs sed -i 's/^\([ \t]*\)clean_restart $binfile$/\1clean_restart\n\1gdb_load $binfile/' $ find gdb/testsuite/gdb.base/ -name *.exp* \ | xargs sed -i 's/^\([ \t]*\)clean_restart ${binfile}$/\1clean_restart\n\1gdb_load $binfile/' $ find gdb/testsuite/gdb.base/ -name *.exp* \ | xargs sed -i 's/^\([ \t]*\)clean_restart $::binfile$/\1clean_restart\n\1gdb_load $::binfile/' $ find gdb/testsuite/gdb.base/ -name *.exp* \ | xargs sed -i 's/^\([ \t]*\)clean_restart ${::binfile}$/\1clean_restart\n\1gdb_load $::binfile/' ... Revert the change in test-case gdb.base/foll-vfork.exp, which does 'set binfile $testfile'. Tested on x86_64-linux. The only modified test-case I was not able to test is gdb.base/dtrace-probe.exp (filed PR testsuite/33379 about this). The change in the test-case is trivial though. --- gdb/testsuite/gdb.base/access-mem-running.exp | 3 ++- gdb/testsuite/gdb.base/annota1.exp | 3 ++- gdb/testsuite/gdb.base/args.exp | 3 ++- gdb/testsuite/gdb.base/arrayidx.exp | 3 ++- gdb/testsuite/gdb.base/assign.exp | 3 ++- gdb/testsuite/gdb.base/attach-fail-twice.exp | 3 ++- gdb/testsuite/gdb.base/attach-non-pgrp-leader.exp | 6 ++++-- gdb/testsuite/gdb.base/attach-wait-input.exp | 3 ++- gdb/testsuite/gdb.base/attach.exp | 9 ++++++--- gdb/testsuite/gdb.base/auxv.exp | 3 ++- gdb/testsuite/gdb.base/basic-edit-cmd.exp | 3 ++- gdb/testsuite/gdb.base/bfp-test.exp | 3 ++- gdb/testsuite/gdb.base/bg-exec-sigint-bp-cond.exp | 3 ++- gdb/testsuite/gdb.base/bg-execution-repeat.exp | 3 ++- gdb/testsuite/gdb.base/bigcore.exp | 3 ++- gdb/testsuite/gdb.base/bitfields2.exp | 3 ++- .../gdb.base/bp-cmds-continue-ctrl-c.exp | 6 ++++-- gdb/testsuite/gdb.base/bp-cond-failure.exp | 3 ++- gdb/testsuite/gdb.base/bp-disabled-by-cond.exp | 3 ++- gdb/testsuite/gdb.base/bp-permanent.exp | 3 ++- gdb/testsuite/gdb.base/bt-on-fatal-signal.exp | 3 ++- gdb/testsuite/gdb.base/bt-selected-frame.exp | 3 ++- gdb/testsuite/gdb.base/call-rt-st.exp | 3 ++- gdb/testsuite/gdb.base/call-signal-resume.exp | 3 ++- gdb/testsuite/gdb.base/callexit.exp | 3 ++- gdb/testsuite/gdb.base/catch-syscall.exp | 12 ++++++++---- gdb/testsuite/gdb.base/checkpoint.exp | 6 ++++-- gdb/testsuite/gdb.base/chng-syms.exp | 3 ++- gdb/testsuite/gdb.base/clear_non_user_bp.exp | 3 ++- gdb/testsuite/gdb.base/code-expr.exp | 3 ++- gdb/testsuite/gdb.base/cond-expr.exp | 3 ++- .../gdb.base/condbreak-multi-context.exp | 15 ++++++++++----- gdb/testsuite/gdb.base/constvars.exp | 3 ++- .../gdb.base/continue-after-aborted-step-over.exp | 3 ++- gdb/testsuite/gdb.base/corefile-exec-context.exp | 9 ++++++--- gdb/testsuite/gdb.base/corefile-shmem-zero-id.exp | 6 ++++-- gdb/testsuite/gdb.base/corefile.exp | 12 ++++++++---- gdb/testsuite/gdb.base/corefile2.exp | 6 ++++-- gdb/testsuite/gdb.base/corefile3.exp | 3 ++- gdb/testsuite/gdb.base/default-args.exp | 3 ++- gdb/testsuite/gdb.base/detach-while-running.exp | 3 ++- gdb/testsuite/gdb.base/detach.exp | 3 ++- gdb/testsuite/gdb.base/dfp-test.exp | 3 ++- gdb/testsuite/gdb.base/display.exp | 3 ++- gdb/testsuite/gdb.base/dlmopen-ns-ids.exp | 12 ++++++++---- gdb/testsuite/gdb.base/dlmopen.exp | 12 ++++++++---- gdb/testsuite/gdb.base/dprintf-bp-same-addr.exp | 3 ++- gdb/testsuite/gdb.base/dprintf-detach.exp | 6 ++++-- .../gdb.base/dprintf-execution-x-script.exp | 3 ++- gdb/testsuite/gdb.base/dprintf-pending.exp | 3 ++- gdb/testsuite/gdb.base/dprintf.exp | 3 ++- gdb/testsuite/gdb.base/dso2dso.exp | 3 ++- gdb/testsuite/gdb.base/dtrace-probe.exp | 3 ++- gdb/testsuite/gdb.base/dump.exp | 3 ++- gdb/testsuite/gdb.base/duplicate-bp.exp | 3 ++- gdb/testsuite/gdb.base/eh_return.exp | 3 ++- gdb/testsuite/gdb.base/errno.exp | 6 ++++-- gdb/testsuite/gdb.base/eval-skip.exp | 3 ++- gdb/testsuite/gdb.base/exe-lock.exp | 3 ++- gdb/testsuite/gdb.base/exec-invalid-sysroot.exp | 3 ++- gdb/testsuite/gdb.base/exprs.exp | 3 ++- gdb/testsuite/gdb.base/fileio.exp | 3 ++- gdb/testsuite/gdb.base/find.exp | 3 ++- gdb/testsuite/gdb.base/fixsection.exp | 3 ++- gdb/testsuite/gdb.base/float128.exp | 3 ++- gdb/testsuite/gdb.base/floatn.exp | 3 ++- .../fork-no-detach-follow-child-dlopen.exp | 3 ++- .../gdb.base/fork-print-inferior-events.exp | 3 ++- gdb/testsuite/gdb.base/frame-args.exp | 3 ++- gdb/testsuite/gdb.base/frame-info-consistent.exp | 3 ++- gdb/testsuite/gdb.base/frame-view.exp | 3 ++- gdb/testsuite/gdb.base/fullname.exp | 9 ++++++--- gdb/testsuite/gdb.base/gcore-buffer-overflow.exp | 3 ++- gdb/testsuite/gdb.base/gcore-relro-pie.exp | 3 ++- gdb/testsuite/gdb.base/gcore-relro.exp | 6 ++++-- gdb/testsuite/gdb.base/gcore-tls-pie.exp | 3 ++- gdb/testsuite/gdb.base/gcore.exp | 3 ++- gdb/testsuite/gdb.base/gdb1250.exp | 3 ++- gdb/testsuite/gdb.base/gdb1555.exp | 3 ++- gdb/testsuite/gdb.base/gdbindex-stabs.exp | 3 ++- .../gdb.base/global-var-nested-by-dso.exp | 3 ++- gdb/testsuite/gdb.base/gnu_vector.exp | 3 ++- gdb/testsuite/gdb.base/hashline1.exp | 3 ++- gdb/testsuite/gdb.base/hashline2.exp | 3 ++- gdb/testsuite/gdb.base/hashline3.exp | 3 ++- .../gdb.base/hbreak-in-shr-unsupported.exp | 3 ++- gdb/testsuite/gdb.base/hook-stop.exp | 3 ++- gdb/testsuite/gdb.base/huge.exp | 3 ++- gdb/testsuite/gdb.base/infcall-exec.exp | 3 ++- gdb/testsuite/gdb.base/infcall-failure.exp | 3 ++- .../gdb.base/infcall-nested-structs.exp.tcl | 3 ++- gdb/testsuite/gdb.base/infcall-timeout.exp | 3 ++- gdb/testsuite/gdb.base/inferior-args.exp | 3 ++- gdb/testsuite/gdb.base/inferior-died.exp | 3 ++- gdb/testsuite/gdb.base/info-proc.exp | 3 ++- gdb/testsuite/gdb.base/info_sources_2.exp | 3 ++- gdb/testsuite/gdb.base/internal-string-values.exp | 3 ++- .../gdb.base/interrupt-daemon-attach.exp | 6 ++++-- gdb/testsuite/gdb.base/interrupt-daemon.exp | 3 ++- gdb/testsuite/gdb.base/jit-reader-exec.exp | 3 ++- gdb/testsuite/gdb.base/jit-reader-simple.exp | 3 ++- gdb/testsuite/gdb.base/kill-during-detach.exp | 3 ++- gdb/testsuite/gdb.base/killed-outside.exp | 3 ++- gdb/testsuite/gdb.base/langs.exp | 3 ++- gdb/testsuite/gdb.base/lineinc.exp | 3 ++- gdb/testsuite/gdb.base/list-missing-source.exp | 3 ++- gdb/testsuite/gdb.base/list.exp | 9 ++++++--- gdb/testsuite/gdb.base/logical.exp | 3 ++- gdb/testsuite/gdb.base/long_long.exp | 3 ++- gdb/testsuite/gdb.base/longjmp.exp | 3 ++- gdb/testsuite/gdb.base/macscp.exp | 3 ++- .../maint-info-inline-frames-and-blocks.exp | 3 ++- gdb/testsuite/gdb.base/maint.exp | 3 ++- gdb/testsuite/gdb.base/miscexprs.exp | 3 ++- gdb/testsuite/gdb.base/multi-forks.exp | 9 ++++++--- gdb/testsuite/gdb.base/nodebug.exp | 3 ++- gdb/testsuite/gdb.base/nofield.exp | 3 ++- gdb/testsuite/gdb.base/nostdlib.exp | 3 ++- gdb/testsuite/gdb.base/options.exp | 6 ++++-- .../gdb.base/paginate-after-ctrl-c-running.exp | 3 ++- gdb/testsuite/gdb.base/paginate-bg-execution.exp | 3 ++- gdb/testsuite/gdb.base/paginate-inferior-exit.exp | 3 ++- gdb/testsuite/gdb.base/patch.exp | 6 ++++-- gdb/testsuite/gdb.base/pc-not-saved.exp | 3 ++- gdb/testsuite/gdb.base/pie-fork.exp | 3 ++- gdb/testsuite/gdb.base/pointers.exp | 3 ++- gdb/testsuite/gdb.base/pr11022.exp | 3 ++- gdb/testsuite/gdb.base/print-symbol-loading.exp | 6 ++++-- gdb/testsuite/gdb.base/prologue.exp | 3 ++- gdb/testsuite/gdb.base/ptr-typedef.exp | 3 ++- gdb/testsuite/gdb.base/quit-live.exp | 3 ++- gdb/testsuite/gdb.base/random-signal.exp | 6 ++++-- gdb/testsuite/gdb.base/readline-ask.exp | 3 ++- gdb/testsuite/gdb.base/readline-commands-eof.exp | 3 ++- gdb/testsuite/gdb.base/relativedebug.exp | 3 ++- gdb/testsuite/gdb.base/remote.exp | 3 ++- gdb/testsuite/gdb.base/reread.exp | 3 ++- gdb/testsuite/gdb.base/restore.exp | 3 ++- gdb/testsuite/gdb.base/return2.exp | 3 ++- .../gdb.base/run-attach-while-running.exp | 3 ++- .../gdb.base/run-control-while-bg-execution.exp | 3 ++- gdb/testsuite/gdb.base/run-fail-twice.exp | 3 ++- gdb/testsuite/gdb.base/savedregs.exp | 3 ++- gdb/testsuite/gdb.base/sep.exp | 6 ++++-- gdb/testsuite/gdb.base/sepsymtab.exp | 3 ++- gdb/testsuite/gdb.base/set-cwd.exp | 6 ++++-- gdb/testsuite/gdb.base/set-inferior-tty.exp | 3 ++- gdb/testsuite/gdb.base/setshow.exp | 6 ++++-- gdb/testsuite/gdb.base/settings.exp | 3 ++- .../gdb.base/share-env-with-gdbserver.exp | 12 ++++++++---- gdb/testsuite/gdb.base/shlib-call.exp | 6 ++++-- gdb/testsuite/gdb.base/shlib-unload.exp | 12 ++++++++---- gdb/testsuite/gdb.base/shreloc.exp | 3 ++- gdb/testsuite/gdb.base/sigaltstack.exp | 3 ++- gdb/testsuite/gdb.base/sigchld.exp | 3 ++- gdb/testsuite/gdb.base/siginfo-obj.exp | 3 ++- gdb/testsuite/gdb.base/siginfo-thread.exp | 6 ++++-- gdb/testsuite/gdb.base/signals-state-child.exp | 3 ++- gdb/testsuite/gdb.base/signals.exp | 3 ++- gdb/testsuite/gdb.base/signull.exp | 3 ++- gdb/testsuite/gdb.base/sigrepeat.exp | 3 ++- gdb/testsuite/gdb.base/sigstep.exp | 3 ++- gdb/testsuite/gdb.base/so-impl-ld.exp | 3 ++- gdb/testsuite/gdb.base/solib-abort.exp | 3 ++- gdb/testsuite/gdb.base/solib-disc.exp | 3 ++- gdb/testsuite/gdb.base/solib-symbol.exp | 3 ++- gdb/testsuite/gdb.base/solib-weak.exp | 3 ++- gdb/testsuite/gdb.base/source-dir.exp | 3 ++- gdb/testsuite/gdb.base/stack-checking.exp | 3 ++- gdb/testsuite/gdb.base/startup-with-shell.exp | 3 ++- gdb/testsuite/gdb.base/step-over-no-symbols.exp | 3 ++- .../gdb.base/step-sw-breakpoint-adjust-pc.exp | 3 ++- gdb/testsuite/gdb.base/step-test.exp | 3 ++- gdb/testsuite/gdb.base/style.exp | 9 ++++++--- gdb/testsuite/gdb.base/sym-file.exp | 3 ++- gdb/testsuite/gdb.base/symtab-search-order.exp | 3 ++- gdb/testsuite/gdb.base/testenv.exp | 6 ++++-- gdb/testsuite/gdb.base/tls-dlobj.exp | 6 ++++-- gdb/testsuite/gdb.base/tls-multiobj.exp | 6 ++++-- gdb/testsuite/gdb.base/tls-nothreads.exp | 6 ++++-- gdb/testsuite/gdb.base/twice.exp | 3 ++- gdb/testsuite/gdb.base/type-opaque.exp | 3 ++- gdb/testsuite/gdb.base/unload.exp | 3 ++- gdb/testsuite/gdb.base/varargs.exp | 3 ++- gdb/testsuite/gdb.base/watch_thread_num.exp | 3 ++- gdb/testsuite/gdb.base/watchpoint-hw-attach.exp | 3 ++- gdb/testsuite/gdb.base/watchpoint-running.exp | 3 ++- gdb/testsuite/gdb.base/watchpoint-solib.exp | 3 ++- .../gdb.base/watchpoint-stops-at-right-insn.exp | 3 ++- gdb/testsuite/gdb.base/watchpoints.exp | 3 ++- gdb/testsuite/gdb.base/with-mf.exp | 3 ++- gdb/testsuite/gdb.base/with.exp | 9 ++++++--- 192 files changed, 500 insertions(+), 250 deletions(-) diff --git a/gdb/testsuite/gdb.base/access-mem-running.exp b/gdb/testsuite/gdb.base/access-mem-running.exp index ecff4275525..280e89b3a44 100644 --- a/gdb/testsuite/gdb.base/access-mem-running.exp +++ b/gdb/testsuite/gdb.base/access-mem-running.exp @@ -32,7 +32,8 @@ proc test { non_stop } { save_vars { GDBFLAGS } { append GDBFLAGS " -ex \"set non-stop $non_stop\"" - clean_restart ${binfile} + clean_restart + gdb_load $binfile } if ![runto_main] { diff --git a/gdb/testsuite/gdb.base/annota1.exp b/gdb/testsuite/gdb.base/annota1.exp index 06dbec2b003..744d8252b4b 100644 --- a/gdb/testsuite/gdb.base/annota1.exp +++ b/gdb/testsuite/gdb.base/annota1.exp @@ -533,7 +533,8 @@ proc thread_test {} { if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] == "" } { - clean_restart $binfile + clean_restart + gdb_load $binfile if {![runto_main]} { return } diff --git a/gdb/testsuite/gdb.base/args.exp b/gdb/testsuite/gdb.base/args.exp index 7b62a750bf4..36bfee2fa4b 100644 --- a/gdb/testsuite/gdb.base/args.exp +++ b/gdb/testsuite/gdb.base/args.exp @@ -51,7 +51,8 @@ proc args_test { name arglist {re_list {}} } { save_vars { ::GDBFLAGS } { set ::GDBFLAGS "$::GDBFLAGS --args $::binfile $arglist" - clean_restart $::binfile + clean_restart + gdb_load $::binfile gdb_test_no_output "set startup-with-shell ${startup_with_shell}" \ "set startup-with-shell for $name" diff --git a/gdb/testsuite/gdb.base/arrayidx.exp b/gdb/testsuite/gdb.base/arrayidx.exp index 4fc221f59c4..757ce9231b2 100644 --- a/gdb/testsuite/gdb.base/arrayidx.exp +++ b/gdb/testsuite/gdb.base/arrayidx.exp @@ -24,7 +24,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debu return -1 } -clean_restart ${binfile} +clean_restart +gdb_load $binfile if {![runto_main]} { return diff --git a/gdb/testsuite/gdb.base/assign.exp b/gdb/testsuite/gdb.base/assign.exp index a69655d9ebe..aaee7962380 100644 --- a/gdb/testsuite/gdb.base/assign.exp +++ b/gdb/testsuite/gdb.base/assign.exp @@ -33,7 +33,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb } -clean_restart ${binfile} +clean_restart +gdb_load $binfile # diff --git a/gdb/testsuite/gdb.base/attach-fail-twice.exp b/gdb/testsuite/gdb.base/attach-fail-twice.exp index 529002d7c10..5e5d73f3e3c 100644 --- a/gdb/testsuite/gdb.base/attach-fail-twice.exp +++ b/gdb/testsuite/gdb.base/attach-fail-twice.exp @@ -77,7 +77,8 @@ proc test_good_attach {test} { } proc_with_prefix test {} { - clean_restart $::binfile + clean_restart + gdb_load $::binfile # GDB used to have a bug on Windows where failing to attach once # made a subsequent "attach" or "run" hang. So it's important for diff --git a/gdb/testsuite/gdb.base/attach-non-pgrp-leader.exp b/gdb/testsuite/gdb.base/attach-non-pgrp-leader.exp index 2ce092d8b9d..c43a11c25a0 100644 --- a/gdb/testsuite/gdb.base/attach-non-pgrp-leader.exp +++ b/gdb/testsuite/gdb.base/attach-non-pgrp-leader.exp @@ -36,7 +36,8 @@ proc do_test {} { # Attach to the parent, run it to a known point, extract the # child's PID, and detach. with_test_prefix "parent" { - clean_restart ${binfile} + clean_restart + gdb_load $binfile gdb_test "attach $parent_pid" \ "Attaching to program.*, process $parent_pid.*" \ @@ -56,7 +57,8 @@ proc do_test {} { # Start over, and attach to the child this time. with_test_prefix "child" { - clean_restart $binfile + clean_restart + gdb_load $binfile gdb_test "attach $child_pid" \ "Attaching to program.*, process $child_pid.*" \ diff --git a/gdb/testsuite/gdb.base/attach-wait-input.exp b/gdb/testsuite/gdb.base/attach-wait-input.exp index 84c9bab472e..47e3d254ea5 100644 --- a/gdb/testsuite/gdb.base/attach-wait-input.exp +++ b/gdb/testsuite/gdb.base/attach-wait-input.exp @@ -43,7 +43,8 @@ proc start_program {binfile} { global gdb_prompt global decimal - clean_restart $binfile + clean_restart + gdb_load $binfile if {![runto setup_done]} { return 0 diff --git a/gdb/testsuite/gdb.base/attach.exp b/gdb/testsuite/gdb.base/attach.exp index 0d1550a0541..d0a29f2954d 100644 --- a/gdb/testsuite/gdb.base/attach.exp +++ b/gdb/testsuite/gdb.base/attach.exp @@ -56,7 +56,8 @@ proc_with_prefix do_attach_failure_tests {} { global escapedbinfile global srcfile - clean_restart $binfile + clean_restart + gdb_load $binfile # Figure out a regular expression that will match the sysroot, # noting that the default sysroot is "target:", and also noting @@ -215,7 +216,8 @@ proc_with_prefix do_attach_tests {} { global timeout global decimal - clean_restart $binfile + clean_restart + gdb_load $binfile # Figure out a regular expression that will match the sysroot, # noting that the default sysroot is "target:", and also noting @@ -519,7 +521,8 @@ proc_with_prefix do_attach_exec_mismatch_handling_tests {} { global binfile2 global binfile3 - clean_restart $binfile + clean_restart + gdb_load $binfile # Start two programs that can be attached to. # The first program contains a 'int bidule' variable, the second a 'float bidule'. diff --git a/gdb/testsuite/gdb.base/auxv.exp b/gdb/testsuite/gdb.base/auxv.exp index 090d9ba54e1..38efa457cbf 100644 --- a/gdb/testsuite/gdb.base/auxv.exp +++ b/gdb/testsuite/gdb.base/auxv.exp @@ -41,7 +41,8 @@ set core_works [expr [isnative] && ! [is_remote target]] # Run GDB on the test program up to where it will dump core. -clean_restart ${binfile} +clean_restart +gdb_load $binfile gdb_test_no_output "set print sevenbit-strings" gdb_test_no_output "set width 0" diff --git a/gdb/testsuite/gdb.base/basic-edit-cmd.exp b/gdb/testsuite/gdb.base/basic-edit-cmd.exp index 8a23c9b213f..7ad8ab926cd 100644 --- a/gdb/testsuite/gdb.base/basic-edit-cmd.exp +++ b/gdb/testsuite/gdb.base/basic-edit-cmd.exp @@ -68,7 +68,8 @@ save_vars { env(EDITOR) } { "try edit when no symbol file is loaded" # Now start with a test binary. - clean_restart $binfile + clean_restart + gdb_load $binfile with_test_prefix "before starting inferior" { diff --git a/gdb/testsuite/gdb.base/bfp-test.exp b/gdb/testsuite/gdb.base/bfp-test.exp index 7781fe10980..53d274fb719 100644 --- a/gdb/testsuite/gdb.base/bfp-test.exp +++ b/gdb/testsuite/gdb.base/bfp-test.exp @@ -23,7 +23,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debu return -1 } -clean_restart ${binfile} +clean_restart +gdb_load $binfile if {![runto_main]} { return diff --git a/gdb/testsuite/gdb.base/bg-exec-sigint-bp-cond.exp b/gdb/testsuite/gdb.base/bg-exec-sigint-bp-cond.exp index 18e20e03e01..2e2a8e6d3fb 100644 --- a/gdb/testsuite/gdb.base/bg-exec-sigint-bp-cond.exp +++ b/gdb/testsuite/gdb.base/bg-exec-sigint-bp-cond.exp @@ -34,7 +34,8 @@ if {[build_executable "failed to prepare" $testfile $srcfile debug]} { # AFTER_KILL_COND is appended to the breakpoint condition, after "kill # -SIGINT $gdb_pid". proc test { {after_kill_cond ""} } { - clean_restart $::binfile + clean_restart + gdb_load $::binfile if {![runto_main]} { return diff --git a/gdb/testsuite/gdb.base/bg-execution-repeat.exp b/gdb/testsuite/gdb.base/bg-execution-repeat.exp index d5580fb8e34..e7bdf4935c9 100644 --- a/gdb/testsuite/gdb.base/bg-execution-repeat.exp +++ b/gdb/testsuite/gdb.base/bg-execution-repeat.exp @@ -33,7 +33,8 @@ proc test {continue_cmd} { global binfile global linenum - clean_restart $binfile + clean_restart + gdb_load $binfile if ![runto_main] { return diff --git a/gdb/testsuite/gdb.base/bigcore.exp b/gdb/testsuite/gdb.base/bigcore.exp index 7727e482b82..f917eb82487 100644 --- a/gdb/testsuite/gdb.base/bigcore.exp +++ b/gdb/testsuite/gdb.base/bigcore.exp @@ -117,7 +117,8 @@ proc test {dumper} { # Run GDB on the bigcore program up-to where it will dump core. - clean_restart ${binfile} + clean_restart + gdb_load $binfile gdb_test_no_output "set print sevenbit-strings" gdb_test_no_output "set width 0" diff --git a/gdb/testsuite/gdb.base/bitfields2.exp b/gdb/testsuite/gdb.base/bitfields2.exp index a99660a825b..3e981dd92e1 100644 --- a/gdb/testsuite/gdb.base/bitfields2.exp +++ b/gdb/testsuite/gdb.base/bitfields2.exp @@ -233,7 +233,8 @@ proc bitfield_set {} { } } -clean_restart ${binfile} +clean_restart +gdb_load $binfile gdb_test_no_output "set print sevenbit-strings" runto_main diff --git a/gdb/testsuite/gdb.base/bp-cmds-continue-ctrl-c.exp b/gdb/testsuite/gdb.base/bp-cmds-continue-ctrl-c.exp index 4fc8f0676fb..648992c7001 100644 --- a/gdb/testsuite/gdb.base/bp-cmds-continue-ctrl-c.exp +++ b/gdb/testsuite/gdb.base/bp-cmds-continue-ctrl-c.exp @@ -118,7 +118,8 @@ proc do_test {} { # "attach". with_test_prefix "run" { - clean_restart $binfile + clean_restart + gdb_load $binfile if {![runto_main]} { return -1 @@ -129,7 +130,8 @@ with_test_prefix "run" { with_test_prefix "attach" { if {[can_spawn_for_attach]} { - clean_restart $binfile + clean_restart + gdb_load $binfile set test_spawn_id [spawn_wait_for_attach $binfile] set testpid [spawn_id_get_pid $test_spawn_id] diff --git a/gdb/testsuite/gdb.base/bp-cond-failure.exp b/gdb/testsuite/gdb.base/bp-cond-failure.exp index 4d03e7bc5fe..53885227c70 100644 --- a/gdb/testsuite/gdb.base/bp-cond-failure.exp +++ b/gdb/testsuite/gdb.base/bp-cond-failure.exp @@ -45,7 +45,8 @@ if { [is_address_zero_readable] } { } proc run_test { cond_eval access_type bpexpr nloc } { - clean_restart ${::binfile} + clean_restart + gdb_load $::binfile if { ![runto_main] } { return -1 diff --git a/gdb/testsuite/gdb.base/bp-disabled-by-cond.exp b/gdb/testsuite/gdb.base/bp-disabled-by-cond.exp index f0bdd168f69..371b9e73a31 100644 --- a/gdb/testsuite/gdb.base/bp-disabled-by-cond.exp +++ b/gdb/testsuite/gdb.base/bp-disabled-by-cond.exp @@ -52,7 +52,8 @@ set exit_bp_line [gdb_get_line_number "BP before exit" $srcfile] # Restart the inferior, which should unload the shared library, GDB # should mark the b/p as disabled due to its condition again. proc run_test { hit_cond } { - clean_restart $::binfile + clean_restart + gdb_load $::binfile if {![runto_main]} { return diff --git a/gdb/testsuite/gdb.base/bp-permanent.exp b/gdb/testsuite/gdb.base/bp-permanent.exp index c6c62699043..3ae5efe109f 100644 --- a/gdb/testsuite/gdb.base/bp-permanent.exp +++ b/gdb/testsuite/gdb.base/bp-permanent.exp @@ -42,7 +42,8 @@ proc test {always_inserted sw_watchpoint} { global gdb_prompt global srcfile binfile - clean_restart $binfile + clean_restart + gdb_load $binfile if {![runto_main]} { return -1 diff --git a/gdb/testsuite/gdb.base/bt-on-fatal-signal.exp b/gdb/testsuite/gdb.base/bt-on-fatal-signal.exp index 06402dccff6..63428a1c93d 100644 --- a/gdb/testsuite/gdb.base/bt-on-fatal-signal.exp +++ b/gdb/testsuite/gdb.base/bt-on-fatal-signal.exp @@ -61,7 +61,8 @@ foreach test_data {{SEGV "Segmentation fault"} \ # Restart GDB. save_vars { GDB } { set GDB [gdb_no_core] - clean_restart $binfile + clean_restart + gdb_load $binfile } # Capture the pid of GDB. diff --git a/gdb/testsuite/gdb.base/bt-selected-frame.exp b/gdb/testsuite/gdb.base/bt-selected-frame.exp index 68f5ed413de..bbe2a5ab061 100644 --- a/gdb/testsuite/gdb.base/bt-selected-frame.exp +++ b/gdb/testsuite/gdb.base/bt-selected-frame.exp @@ -24,7 +24,8 @@ if { [build_executable "failed to prepare" $testfile $srcfile debug] } { proc check_selected_frame_after_bt { bt_cmd stack_pattern } { global binfile - clean_restart $binfile + clean_restart + gdb_load $binfile with_test_prefix $bt_cmd { diff --git a/gdb/testsuite/gdb.base/call-rt-st.exp b/gdb/testsuite/gdb.base/call-rt-st.exp index 244eba87fef..511e209a060 100644 --- a/gdb/testsuite/gdb.base/call-rt-st.exp +++ b/gdb/testsuite/gdb.base/call-rt-st.exp @@ -39,7 +39,8 @@ set allow_float_test [allow_float_test] # Start with a fresh gdb. -clean_restart ${binfile} +clean_restart +gdb_load $binfile gdb_test_no_output "set print sevenbit-strings" gdb_test_no_output "set print address off" gdb_test_no_output "set width 0" diff --git a/gdb/testsuite/gdb.base/call-signal-resume.exp b/gdb/testsuite/gdb.base/call-signal-resume.exp index 10a2928dc4a..a74b8afdaa6 100644 --- a/gdb/testsuite/gdb.base/call-signal-resume.exp +++ b/gdb/testsuite/gdb.base/call-signal-resume.exp @@ -47,7 +47,8 @@ proc get_dummy_frame_number { } { # Start with a fresh gdb. -clean_restart ${binfile} +clean_restart +gdb_load $binfile if { ![runto_main] } { return 0 diff --git a/gdb/testsuite/gdb.base/callexit.exp b/gdb/testsuite/gdb.base/callexit.exp index c250c6788c7..e0ce899272b 100644 --- a/gdb/testsuite/gdb.base/callexit.exp +++ b/gdb/testsuite/gdb.base/callexit.exp @@ -27,7 +27,8 @@ require {!target_info exists gdb,cannot_call_functions} # Start with a fresh gdb. -clean_restart ${binfile} +clean_restart +gdb_load $binfile if { ![runto_main] } { return 0 diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp index f3ddef51dd7..9c5839c2991 100644 --- a/gdb/testsuite/gdb.base/catch-syscall.exp +++ b/gdb/testsuite/gdb.base/catch-syscall.exp @@ -630,7 +630,8 @@ proc test_catch_syscall_multi_arch {} { test_catch_syscall_multi_arch_1 $arch1 $arch2 $syscall1_name \ $syscall2_name $syscall_number - clean_restart $binfile + clean_restart + gdb_load $binfile } proc do_syscall_tests_without_xml {} { @@ -801,18 +802,21 @@ fill_all_syscalls_numbers # Execute the tests, using XML support gdb_exit if { [allow_xml_test] } { - clean_restart $binfile + clean_restart + gdb_load $binfile do_syscall_tests # Now, we have to see if GDB displays a warning when we # don't set the data-directory but try to use catch syscall # anyway. For that, we must restart GDB first. - clean_restart $binfile + clean_restart + gdb_load $binfile test_catch_syscall_fail_nodatadir } # Restart gdb -clean_restart $binfile +clean_restart +gdb_load $binfile # Execute the tests, without XML support. In this case, GDB will # only display syscall numbers, and not syscall names. diff --git a/gdb/testsuite/gdb.base/checkpoint.exp b/gdb/testsuite/gdb.base/checkpoint.exp index 89b36f529e9..55eba5de68e 100644 --- a/gdb/testsuite/gdb.base/checkpoint.exp +++ b/gdb/testsuite/gdb.base/checkpoint.exp @@ -290,7 +290,8 @@ gdb_test "restart 10" "has no checkpoints" "no more checkpoint 10" # Now let's try setting a large number of checkpoints (>600) # -clean_restart $binfile +clean_restart +gdb_load $binfile runto_main gdb_breakpoint $break1_loc @@ -356,7 +357,8 @@ gdb_test "kill" "" "kill all one with many checkpoints" \ # with_test_prefix "delete checkpoint 0" { - clean_restart $binfile + clean_restart + gdb_load $binfile runto_main gdb_test "checkpoint" "Checkpoint 1: fork returned pid $decimal\\." diff --git a/gdb/testsuite/gdb.base/chng-syms.exp b/gdb/testsuite/gdb.base/chng-syms.exp index a561689c12d..dbc523d2caf 100644 --- a/gdb/testsuite/gdb.base/chng-syms.exp +++ b/gdb/testsuite/gdb.base/chng-syms.exp @@ -36,7 +36,8 @@ proc expect_to_stop_here { ident } { gdb_test "" "Breakpoint \[0-9\]*, stop_here .*" "running to stop_here $ident" } -clean_restart ${binfile} +clean_restart +gdb_load $binfile gdb_test "break stop_here if (var1 == 42)" \ "Breakpoint.*at.* file .*$srcfile, line.*" \ diff --git a/gdb/testsuite/gdb.base/clear_non_user_bp.exp b/gdb/testsuite/gdb.base/clear_non_user_bp.exp index f078b972d9c..c016d07bc4d 100644 --- a/gdb/testsuite/gdb.base/clear_non_user_bp.exp +++ b/gdb/testsuite/gdb.base/clear_non_user_bp.exp @@ -47,7 +47,8 @@ if { [gdb_compile "${srcdir}/${subdir}/main.c" "${binfile}" executable {debug}] } # Start with a fresh gdb. -clean_restart ${binfile} +clean_restart +gdb_load $binfile if {![runto_main]} { return 0 diff --git a/gdb/testsuite/gdb.base/code-expr.exp b/gdb/testsuite/gdb.base/code-expr.exp index 4288617bf73..8af2ee69c23 100644 --- a/gdb/testsuite/gdb.base/code-expr.exp +++ b/gdb/testsuite/gdb.base/code-expr.exp @@ -29,7 +29,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb return -1 } -clean_restart ${binfile} +clean_restart +gdb_load $binfile gdb_test_no_output "set print sevenbit-strings" gdb_test_no_output "set print address off" diff --git a/gdb/testsuite/gdb.base/cond-expr.exp b/gdb/testsuite/gdb.base/cond-expr.exp index e60fd16bc29..20809378b02 100644 --- a/gdb/testsuite/gdb.base/cond-expr.exp +++ b/gdb/testsuite/gdb.base/cond-expr.exp @@ -39,7 +39,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb } -clean_restart ${binfile} +clean_restart +gdb_load $binfile if {![runto_main]} { diff --git a/gdb/testsuite/gdb.base/condbreak-multi-context.exp b/gdb/testsuite/gdb.base/condbreak-multi-context.exp index dce162b7748..b4ea0f11754 100644 --- a/gdb/testsuite/gdb.base/condbreak-multi-context.exp +++ b/gdb/testsuite/gdb.base/condbreak-multi-context.exp @@ -53,7 +53,8 @@ proc find_location_contexts { } { global loc_name loc_index fill global decimal hex gdb_prompt binfile - clean_restart ${binfile} + clean_restart + gdb_load $binfile if {![runto_main]} { return @@ -130,7 +131,8 @@ proc check_bp_locations {bpnum states cond {msg ""}} { proc_with_prefix scenario_1 { start_before } { global warning decimal fill bkptno_num_re binfile - clean_restart ${binfile} + clean_restart + gdb_load $binfile if { $start_before } { if {![runto_main temporary]} { @@ -242,7 +244,8 @@ proc setup_bps { bpnum1_name bpnum2_name } { proc_with_prefix scenario_2 { start_before } { global binfile bkptno_num_re - clean_restart ${binfile} + clean_restart + gdb_load $binfile if { $start_before } { if {![runto_main temporary]} { @@ -290,7 +293,8 @@ proc_with_prefix scenario_2 { start_before } { proc_with_prefix scenario_3 { start_before } { global binfile bkptno_num_re loc_index warning - clean_restart ${binfile} + clean_restart + gdb_load $binfile if { $start_before } { if {![runto_main temporary]} { @@ -367,7 +371,8 @@ proc_with_prefix scenario_3 { start_before } { proc_with_prefix scenario_4 { start_before } { global binfile bkptno_num_re loc_index warning - clean_restart ${binfile} + clean_restart + gdb_load $binfile if { $start_before } { if {![runto_main temporary]} { diff --git a/gdb/testsuite/gdb.base/constvars.exp b/gdb/testsuite/gdb.base/constvars.exp index 8f559458d30..dcc8d1b7790 100644 --- a/gdb/testsuite/gdb.base/constvars.exp +++ b/gdb/testsuite/gdb.base/constvars.exp @@ -34,7 +34,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable debug return -1 } -clean_restart ${binfile} +clean_restart +gdb_load $binfile # 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 4764d72d3b2..8ba1f61fc2a 100644 --- a/gdb/testsuite/gdb.base/continue-after-aborted-step-over.exp +++ b/gdb/testsuite/gdb.base/continue-after-aborted-step-over.exp @@ -45,7 +45,8 @@ proc do_test {displaced breakpoint_always_inserted} { global gdb_prompt decimal global srcfile binfile - clean_restart $binfile + clean_restart + gdb_load $binfile gdb_test_no_output "set displaced-stepping $displaced" gdb_test_no_output "set breakpoint always-inserted $breakpoint_always_inserted" diff --git a/gdb/testsuite/gdb.base/corefile-exec-context.exp b/gdb/testsuite/gdb.base/corefile-exec-context.exp index 7c9647ce83b..23fd964955a 100644 --- a/gdb/testsuite/gdb.base/corefile-exec-context.exp +++ b/gdb/testsuite/gdb.base/corefile-exec-context.exp @@ -51,7 +51,8 @@ remote_exec build "mv $corefile $corefile_1" # Load the core file and confirm that the full executable name is # seen. -clean_restart $binfile +clean_restart +gdb_load $binfile set saw_generated_line false gdb_test_multiple "core-file $corefile_1" "load core file no args" { -re "^Core was generated by `[string_to_regexp $binfile]'\\.\r\n" { @@ -80,7 +81,8 @@ remote_exec build "mv $corefile $corefile_2" # Load the core file and confirm that the full executable name and # argument list are seen. -clean_restart $binfile +clean_restart +gdb_load $binfile set saw_generated_line false gdb_test_multiple "core-file $corefile_2" "load core file with args" { -re "^Core was generated by `[string_to_regexp $binfile] $args'\\.\r\n" { @@ -155,7 +157,8 @@ remote_exec build "mv $corefile $corefile_3" # Restart, load the core file, and check the environment variable # shows up. -clean_restart $binfile +clean_restart +gdb_load $binfile # Check for environment variable VAR_NAME in the environment, its # value should be VAR_VALUE. diff --git a/gdb/testsuite/gdb.base/corefile-shmem-zero-id.exp b/gdb/testsuite/gdb.base/corefile-shmem-zero-id.exp index 57c665e9e4c..94ab4547810 100644 --- a/gdb/testsuite/gdb.base/corefile-shmem-zero-id.exp +++ b/gdb/testsuite/gdb.base/corefile-shmem-zero-id.exp @@ -93,7 +93,8 @@ save_vars { env(LD_PRELOAD) env(ASAN_OPTIONS) } { # LD_PRELOAD. append_environment_default ASAN_OPTIONS verify_asan_link_order 0 - clean_restart $binfile + clean_restart + gdb_load $binfile # Start GDB with the modified environment, this means that, when # using remote targets, gdbserver will also use the preload @@ -186,7 +187,8 @@ with_timeout_factor 3 { # Restart GDB. This time we are _not_ using the preload library. We # no longer need it as we are only analysing the core file now. -clean_restart $binfile +clean_restart +gdb_load $binfile # Load the core file. gdb_test "core-file $corefile" \ diff --git a/gdb/testsuite/gdb.base/corefile.exp b/gdb/testsuite/gdb.base/corefile.exp index fd8d1d1274c..c34dfb5d9c2 100644 --- a/gdb/testsuite/gdb.base/corefile.exp +++ b/gdb/testsuite/gdb.base/corefile.exp @@ -97,7 +97,8 @@ foreach_with_prefix coreopt {--core= -core= "-c "} { # Now restart normally. -clean_restart $binfile +clean_restart +gdb_load $binfile # Test basic corefile recognition via core-file command. @@ -201,7 +202,8 @@ set coremmap_data_backup_filename \ remote_exec host "mv ${coremmap_data_filename} \ ${coremmap_data_backup_filename}" -clean_restart $binfile +clean_restart +gdb_load $binfile # Load the core file and check we get a warning about the # coremmap.data file being missing. @@ -230,7 +232,8 @@ remote_exec host "mv ${coremmap_data_backup_filename} \ # Test that we can unload the core with the "detach" command. proc_with_prefix corefile_detach {} { - clean_restart $::binfile + clean_restart + gdb_load $::binfile gdb_test "core-file $::corefile" "Core was generated by .*" "load core" gdb_test "detach" "No core file now\\." "detach core" @@ -252,7 +255,8 @@ proc corefile_test_run {} { return } - clean_restart $::binfile + clean_restart + gdb_load $::binfile gdb_test "core-file $corefile" "Core was generated by .*" "run: load core again" set re "Local core dump file:" diff --git a/gdb/testsuite/gdb.base/corefile2.exp b/gdb/testsuite/gdb.base/corefile2.exp index d35ba1a1295..39754600f1c 100644 --- a/gdb/testsuite/gdb.base/corefile2.exp +++ b/gdb/testsuite/gdb.base/corefile2.exp @@ -171,7 +171,8 @@ with_test_prefix "renamed binfile" { # Restart and run to the abort call. -clean_restart $binfile +clean_restart +gdb_load $binfile if {![runto_main]} { return @@ -195,7 +196,8 @@ if {!$core_supported} { gdb_test_no_output "maint print core-file-backed-mappings" \ "maint print core-file-backed-mapping with no core file" -clean_restart $binfile +clean_restart +gdb_load $binfile set core_loaded [gdb_core_cmd "$corefile" "re-load generated corefile"] if { $core_loaded == -1 } { diff --git a/gdb/testsuite/gdb.base/corefile3.exp b/gdb/testsuite/gdb.base/corefile3.exp index ef391d15049..45285096652 100644 --- a/gdb/testsuite/gdb.base/corefile3.exp +++ b/gdb/testsuite/gdb.base/corefile3.exp @@ -47,7 +47,8 @@ set backup_filename \ [standard_output_file coredir.[getpid]/coremmap.data.backup] remote_exec host "mv ${data_filename} ${backup_filename}" -clean_restart $binfile +clean_restart +gdb_load $binfile # Load the core file. The 'coremap.data' file cannot be found by GDB, # but all the mappings for that file are r/w and should be present in diff --git a/gdb/testsuite/gdb.base/default-args.exp b/gdb/testsuite/gdb.base/default-args.exp index efc42051eb7..ae417ed38fe 100644 --- a/gdb/testsuite/gdb.base/default-args.exp +++ b/gdb/testsuite/gdb.base/default-args.exp @@ -25,7 +25,8 @@ if {[build_executable "failed to prepare" $testfile $srcfile debug]} { return -1 } -clean_restart $binfile +clean_restart +gdb_load $binfile # Basic/core tests using user-visible commands. with_test_prefix "basics" { diff --git a/gdb/testsuite/gdb.base/detach-while-running.exp b/gdb/testsuite/gdb.base/detach-while-running.exp index 60943f385ad..34c2adc7d84 100644 --- a/gdb/testsuite/gdb.base/detach-while-running.exp +++ b/gdb/testsuite/gdb.base/detach-while-running.exp @@ -45,7 +45,8 @@ proc test {} { if {$is_remote} { append ::GDBFLAGS " -ex \"maint set target-non-stop on\"" } - clean_restart ${binfile} + clean_restart + gdb_load $binfile } set test_spawn_id [spawn_wait_for_attach $binfile] diff --git a/gdb/testsuite/gdb.base/detach.exp b/gdb/testsuite/gdb.base/detach.exp index f9f67a85c0d..c8d4350e86b 100644 --- a/gdb/testsuite/gdb.base/detach.exp +++ b/gdb/testsuite/gdb.base/detach.exp @@ -42,7 +42,8 @@ proc do_detach_tests {} { gdb_test "detach" "Detaching from program: .*$escapedbinfile, .*" "detach, $pass" } -clean_restart $binfile +clean_restart +gdb_load $binfile global pass set pass "one" diff --git a/gdb/testsuite/gdb.base/dfp-test.exp b/gdb/testsuite/gdb.base/dfp-test.exp index 2a6c377e1b8..11f75dac283 100644 --- a/gdb/testsuite/gdb.base/dfp-test.exp +++ b/gdb/testsuite/gdb.base/dfp-test.exp @@ -28,7 +28,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {quie return -1 } -clean_restart ${binfile} +clean_restart +gdb_load $binfile if {![runto_main]} { return diff --git a/gdb/testsuite/gdb.base/display.exp b/gdb/testsuite/gdb.base/display.exp index 7aed6d52c2e..2fb6e0725be 100644 --- a/gdb/testsuite/gdb.base/display.exp +++ b/gdb/testsuite/gdb.base/display.exp @@ -52,7 +52,8 @@ if !$use_gdb_stub { gdb_test "kill" ".*" "kill again" gdb_test "detach" ".*" "detach again" - clean_restart $binfile + clean_restart + gdb_load $binfile } # Ok, on to real life diff --git a/gdb/testsuite/gdb.base/dlmopen-ns-ids.exp b/gdb/testsuite/gdb.base/dlmopen-ns-ids.exp index bfce900c6a7..f3bdfb054d9 100644 --- a/gdb/testsuite/gdb.base/dlmopen-ns-ids.exp +++ b/gdb/testsuite/gdb.base/dlmopen-ns-ids.exp @@ -126,7 +126,8 @@ proc get_first_so_ns {} { # Run the tests relating to the command "info sharedlibrary", to # verify that the namespace ID is consistent. proc test_info_shared {} { - clean_restart $::binfile + clean_restart + gdb_load $::binfile if { ![runto_main] } { return @@ -176,7 +177,8 @@ proc test_info_shared {} { # Also tests that the namespace ID is only printed at the correct # times. proc_with_prefix test_conv_vars {} { - clean_restart $::binfile + clean_restart + gdb_load $::binfile gdb_test "print \$_linker_namespace_count" "0" \ "0 namespace before starting inferior" @@ -219,7 +221,8 @@ proc_with_prefix test_conv_vars {} { # Restarting GDB so that we can test setting a breakpoint # using the convenience variable, while a proper bp syntax # isn't implemented for namespaces - clean_restart $::binfile + clean_restart + gdb_load $::binfile if {![runto_main]} { return } @@ -235,7 +238,8 @@ proc_with_prefix test_conv_vars {} { # Run several tests relating to the command "info namespaces". proc test_info_linker_namespaces {} { - clean_restart $::binfile + clean_restart + gdb_load $::binfile # Check that "info linker-namespaces" while the inferior is not running # doesn't crash. diff --git a/gdb/testsuite/gdb.base/dlmopen.exp b/gdb/testsuite/gdb.base/dlmopen.exp index 54fb4c4b4ca..c4eb7cdfb22 100644 --- a/gdb/testsuite/gdb.base/dlmopen.exp +++ b/gdb/testsuite/gdb.base/dlmopen.exp @@ -183,7 +183,8 @@ proc test_dlmopen {} { # Setup for calling 'test_dlmopen', this is the version of the test # that doesn't use 'attach'. proc test_dlmopen_no_attach {} { - clean_restart $::binfile + clean_restart + gdb_load $::binfile if { ![runto_main] } { return @@ -208,7 +209,8 @@ proc test_dlmopen_with_attach {} { return } - clean_restart $::binfile + clean_restart + gdb_load $::binfile # Start the test program. set test_spawn_id [spawn_wait_for_attach $::binfile] @@ -298,7 +300,8 @@ proc_with_prefix test_solib_unmap_events { } { return } - clean_restart $::binfile + clean_restart + gdb_load $::binfile if { ![runto_main] } { return @@ -393,7 +396,8 @@ proc_with_prefix test_solib_unmap_events { } { # Check that we can 'next' over the dlclose calls without GDB giving any # warnings or errors. proc_with_prefix test_next_over_dlclose {} { - clean_restart $::binfile + clean_restart + gdb_load $::binfile if { ![runto_main] } { return diff --git a/gdb/testsuite/gdb.base/dprintf-bp-same-addr.exp b/gdb/testsuite/gdb.base/dprintf-bp-same-addr.exp index 649784bc1da..11a83104716 100644 --- a/gdb/testsuite/gdb.base/dprintf-bp-same-addr.exp +++ b/gdb/testsuite/gdb.base/dprintf-bp-same-addr.exp @@ -28,7 +28,8 @@ proc test { style } { global gdb_prompt binfile dp_location with_test_prefix "$style" { - clean_restart $binfile + clean_restart + gdb_load $binfile if ![runto_main] { return -1 diff --git a/gdb/testsuite/gdb.base/dprintf-detach.exp b/gdb/testsuite/gdb.base/dprintf-detach.exp index dc3384bb162..431037ceb19 100644 --- a/gdb/testsuite/gdb.base/dprintf-detach.exp +++ b/gdb/testsuite/gdb.base/dprintf-detach.exp @@ -37,7 +37,8 @@ proc dprintf_detach_test { breakpoint_always_inserted dprintf_style disconnected with_test_prefix "$test_prefix" { # Start with a clean gdb - clean_restart ${binfile} + clean_restart + gdb_load $binfile gdb_test_no_output "set breakpoint always-inserted ${breakpoint_always_inserted}" gdb_test_no_output "set dprintf-style ${dprintf_style}" @@ -68,7 +69,8 @@ proc dprintf_detach_test { breakpoint_always_inserted dprintf_style disconnected gdb_exit # Check that the process still exists by attaching a new gdb to it. - clean_restart ${binfile} + clean_restart + gdb_load $binfile set test "re-attach to inferior" set is_gdbserver [target_is_gdbserver] diff --git a/gdb/testsuite/gdb.base/dprintf-execution-x-script.exp b/gdb/testsuite/gdb.base/dprintf-execution-x-script.exp index 06be468891e..65de2d5e5e1 100644 --- a/gdb/testsuite/gdb.base/dprintf-execution-x-script.exp +++ b/gdb/testsuite/gdb.base/dprintf-execution-x-script.exp @@ -93,7 +93,8 @@ do_test "" $test # Restart GDB and 'source' the script; this will (still) run the program # due to the 'run' command in the script. -clean_restart $binfile +clean_restart +gdb_load $binfile do_test "source $x_file" "load and run script using source command" # This should leave us at the gdb prompt; Run program again using diff --git a/gdb/testsuite/gdb.base/dprintf-pending.exp b/gdb/testsuite/gdb.base/dprintf-pending.exp index 9242a841199..f28e9696ccb 100644 --- a/gdb/testsuite/gdb.base/dprintf-pending.exp +++ b/gdb/testsuite/gdb.base/dprintf-pending.exp @@ -60,7 +60,8 @@ with_test_prefix "without symbols" { gdb_test "" ".*x=3.*x=4.*x=3.*" "run to resolved dprintf" } -clean_restart ${binfile} +clean_restart +gdb_load $binfile gdb_load_shlib $lib_sl # diff --git a/gdb/testsuite/gdb.base/dprintf.exp b/gdb/testsuite/gdb.base/dprintf.exp index 0135b86a159..262ccc19cf0 100644 --- a/gdb/testsuite/gdb.base/dprintf.exp +++ b/gdb/testsuite/gdb.base/dprintf.exp @@ -74,7 +74,8 @@ proc restart {} { global binfile global bp_location1 dp_location1 - clean_restart $binfile + clean_restart + gdb_load $binfile if ![runto_main] { return -1 diff --git a/gdb/testsuite/gdb.base/dso2dso.exp b/gdb/testsuite/gdb.base/dso2dso.exp index 24d4203fc61..3b00f6d92cc 100644 --- a/gdb/testsuite/gdb.base/dso2dso.exp +++ b/gdb/testsuite/gdb.base/dso2dso.exp @@ -54,7 +54,8 @@ if { [gdb_compile $srcdir/$subdir/$srcfile $binfile executable \ return -1 } -clean_restart $binfile +clean_restart +gdb_load $binfile gdb_load_shlib $binfile_libdso2 gdb_load_shlib $binfile_libdso1 diff --git a/gdb/testsuite/gdb.base/dtrace-probe.exp b/gdb/testsuite/gdb.base/dtrace-probe.exp index 32a72cc1068..e165bb44a65 100644 --- a/gdb/testsuite/gdb.base/dtrace-probe.exp +++ b/gdb/testsuite/gdb.base/dtrace-probe.exp @@ -27,7 +27,8 @@ proc dtrace_test {} { return -1 } - clean_restart ${binfile} + clean_restart + gdb_load $binfile if ![runto_main] { return -1 diff --git a/gdb/testsuite/gdb.base/dump.exp b/gdb/testsuite/gdb.base/dump.exp index 7c84056dfa6..64d897b09a2 100644 --- a/gdb/testsuite/gdb.base/dump.exp +++ b/gdb/testsuite/gdb.base/dump.exp @@ -46,7 +46,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable ${op return -1 } -clean_restart $binfile +clean_restart +gdb_load $binfile gdb_test "dump mem /dev/null 0x10 0x20" "Cannot access memory at address 0x10" \ "inaccessible memory is reported" diff --git a/gdb/testsuite/gdb.base/duplicate-bp.exp b/gdb/testsuite/gdb.base/duplicate-bp.exp index b1003f28b4e..da5834be9a6 100644 --- a/gdb/testsuite/gdb.base/duplicate-bp.exp +++ b/gdb/testsuite/gdb.base/duplicate-bp.exp @@ -24,7 +24,8 @@ proc test_setup { count } { global srcfile global binfile - clean_restart ${binfile} + clean_restart + gdb_load $binfile if {![runto_main]} { return 0 diff --git a/gdb/testsuite/gdb.base/eh_return.exp b/gdb/testsuite/gdb.base/eh_return.exp index 5a4f524a809..703f9e95c4f 100644 --- a/gdb/testsuite/gdb.base/eh_return.exp +++ b/gdb/testsuite/gdb.base/eh_return.exp @@ -71,7 +71,8 @@ if { $address == -1 } { return 0 } -clean_restart ${binfile} +clean_restart +gdb_load $binfile gdb_assert [gdb_breakpoint "*$address" no-message] "set breakpoint on address" diff --git a/gdb/testsuite/gdb.base/errno.exp b/gdb/testsuite/gdb.base/errno.exp index ff18214ab12..ea1ff70498c 100644 --- a/gdb/testsuite/gdb.base/errno.exp +++ b/gdb/testsuite/gdb.base/errno.exp @@ -45,7 +45,8 @@ standard_testfile proc do_tests {{do_xfail_cast 0} {do_xfail 0} {do_xfail_core_test 0}} { - clean_restart $::binfile + clean_restart + gdb_load $::binfile if ![runto_main] { return } @@ -176,7 +177,8 @@ proc do_tests {{do_xfail_cast 0} {do_xfail 0} {do_xfail_core_test 0}} { return } - clean_restart $::binfile + clean_restart + gdb_load $::binfile set core_loaded [gdb_core_cmd $corefile "load corefile"] if { $core_loaded == -1 } { diff --git a/gdb/testsuite/gdb.base/eval-skip.exp b/gdb/testsuite/gdb.base/eval-skip.exp index 82c5fe0e855..b4c856ed2e6 100644 --- a/gdb/testsuite/gdb.base/eval-skip.exp +++ b/gdb/testsuite/gdb.base/eval-skip.exp @@ -39,7 +39,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb return -1 } -clean_restart ${binfile} +clean_restart +gdb_load $binfile if {![runto_main]} { diff --git a/gdb/testsuite/gdb.base/exe-lock.exp b/gdb/testsuite/gdb.base/exe-lock.exp index 40a470f6c07..2e375b4ed71 100644 --- a/gdb/testsuite/gdb.base/exe-lock.exp +++ b/gdb/testsuite/gdb.base/exe-lock.exp @@ -27,7 +27,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debu return -1 } -clean_restart ${binfile} +clean_restart +gdb_load $binfile # Sanity-check: Verify that the executable exists. This is just to # make sure that, when we verify later that the file does not exist, diff --git a/gdb/testsuite/gdb.base/exec-invalid-sysroot.exp b/gdb/testsuite/gdb.base/exec-invalid-sysroot.exp index 7ab446e63e2..99f5e7df857 100644 --- a/gdb/testsuite/gdb.base/exec-invalid-sysroot.exp +++ b/gdb/testsuite/gdb.base/exec-invalid-sysroot.exp @@ -69,5 +69,6 @@ proc do_exec_sysroot_test {} { } # Start with a fresh gdb -clean_restart $binfile +clean_restart +gdb_load $binfile do_exec_sysroot_test diff --git a/gdb/testsuite/gdb.base/exprs.exp b/gdb/testsuite/gdb.base/exprs.exp index 81f6f197cc4..ee0c198bf3d 100644 --- a/gdb/testsuite/gdb.base/exprs.exp +++ b/gdb/testsuite/gdb.base/exprs.exp @@ -26,7 +26,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb return -1 } -clean_restart ${binfile} +clean_restart +gdb_load $binfile # # set it up at a breakpoint so we can play with the variable values diff --git a/gdb/testsuite/gdb.base/fileio.exp b/gdb/testsuite/gdb.base/fileio.exp index 7347c1160b1..a6b4c2391c7 100644 --- a/gdb/testsuite/gdb.base/fileio.exp +++ b/gdb/testsuite/gdb.base/fileio.exp @@ -41,7 +41,8 @@ system "rm -rf [standard_output_file *.fileio.test]" set oldtimeout $timeout set timeout [expr "$timeout + 60"] -clean_restart $binfile +clean_restart +gdb_load $binfile gdb_test_no_output "set print sevenbit-strings" gdb_test_no_output "set print address off" gdb_test_no_output "set width 0" diff --git a/gdb/testsuite/gdb.base/find.exp b/gdb/testsuite/gdb.base/find.exp index ae686861c15..3b2dfb0a6ea 100644 --- a/gdb/testsuite/gdb.base/find.exp +++ b/gdb/testsuite/gdb.base/find.exp @@ -22,7 +22,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb return -1 } -clean_restart ${binfile} +clean_restart +gdb_load $binfile gdb_test "break $srcfile:stop_here" \ "Breakpoint.*at.* file .*$srcfile, line.*" \ diff --git a/gdb/testsuite/gdb.base/fixsection.exp b/gdb/testsuite/gdb.base/fixsection.exp index 9a5c99637e6..305685135e0 100644 --- a/gdb/testsuite/gdb.base/fixsection.exp +++ b/gdb/testsuite/gdb.base/fixsection.exp @@ -32,7 +32,8 @@ if { [gdb_compile_shlib $libsrc $lib_sl $lib_opts] != "" return -1 } -clean_restart $binfile +clean_restart +gdb_load $binfile gdb_load_shlib ${lib_sl} if {![runto_main]} { diff --git a/gdb/testsuite/gdb.base/float128.exp b/gdb/testsuite/gdb.base/float128.exp index 95b83af4119..b8d3a6c738d 100644 --- a/gdb/testsuite/gdb.base/float128.exp +++ b/gdb/testsuite/gdb.base/float128.exp @@ -30,7 +30,8 @@ if { [do_compile] != "" && [do_compile {-mfloat128}] != "" } { return -1 } -clean_restart ${binfile} +clean_restart +gdb_load $binfile if {![runto_main]} { return diff --git a/gdb/testsuite/gdb.base/floatn.exp b/gdb/testsuite/gdb.base/floatn.exp index 7138d04c39f..1b39ed8a3fe 100644 --- a/gdb/testsuite/gdb.base/floatn.exp +++ b/gdb/testsuite/gdb.base/floatn.exp @@ -30,7 +30,8 @@ if { [do_compile] != "" && [do_compile {-mfloat128}] != "" } { return -1 } -clean_restart ${binfile} +clean_restart +gdb_load $binfile if {![runto_main]} { return diff --git a/gdb/testsuite/gdb.base/fork-no-detach-follow-child-dlopen.exp b/gdb/testsuite/gdb.base/fork-no-detach-follow-child-dlopen.exp index 2d47d5d2c20..cb49ef654d5 100644 --- a/gdb/testsuite/gdb.base/fork-no-detach-follow-child-dlopen.exp +++ b/gdb/testsuite/gdb.base/fork-no-detach-follow-child-dlopen.exp @@ -41,7 +41,8 @@ if { [build_executable "failed to prepare" ${testfile} ${srcfile} $opts] } { } proc do_test {} { - clean_restart $::binfile + clean_restart + gdb_load $::binfile gdb_locate_shlib $::shlib_path gdb_test_no_output "set follow-fork-mode child" gdb_test_no_output "set detach-on-fork off" diff --git a/gdb/testsuite/gdb.base/fork-print-inferior-events.exp b/gdb/testsuite/gdb.base/fork-print-inferior-events.exp index 19ace001b08..c24a9bc3389 100644 --- a/gdb/testsuite/gdb.base/fork-print-inferior-events.exp +++ b/gdb/testsuite/gdb.base/fork-print-inferior-events.exp @@ -73,7 +73,8 @@ set i 0 foreach_with_prefix print_inferior_events { "on" "off" } { foreach_with_prefix follow_fork_mode { "child" "parent" } { foreach_with_prefix detach_on_fork { "on" "off" } { - clean_restart $binfile + clean_restart + gdb_load $binfile gdb_test_no_output "set print inferior-events $print_inferior_events" gdb_test_no_output "set follow-fork-mode $follow_fork_mode" gdb_test_no_output "set detach-on-fork $detach_on_fork" diff --git a/gdb/testsuite/gdb.base/frame-args.exp b/gdb/testsuite/gdb.base/frame-args.exp index 31e4d158734..0daa3aa3ef1 100644 --- a/gdb/testsuite/gdb.base/frame-args.exp +++ b/gdb/testsuite/gdb.base/frame-args.exp @@ -19,7 +19,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debu return -1 } -clean_restart ${binfile} +clean_restart +gdb_load $binfile if {![runto break_me]} { return diff --git a/gdb/testsuite/gdb.base/frame-info-consistent.exp b/gdb/testsuite/gdb.base/frame-info-consistent.exp index 67bcd182194..b59404749a9 100644 --- a/gdb/testsuite/gdb.base/frame-info-consistent.exp +++ b/gdb/testsuite/gdb.base/frame-info-consistent.exp @@ -97,7 +97,8 @@ proc compare_frames {frames} { proc test {enable} { - clean_restart $::binfile + clean_restart + gdb_load $::binfile gdb_test_no_output "maint frame-unwinder $enable DEBUGINFO" diff --git a/gdb/testsuite/gdb.base/frame-view.exp b/gdb/testsuite/gdb.base/frame-view.exp index fa00c359f18..34ac668080a 100644 --- a/gdb/testsuite/gdb.base/frame-view.exp +++ b/gdb/testsuite/gdb.base/frame-view.exp @@ -28,7 +28,8 @@ if { [build_executable "failed to prepare" \ # "select-frame view". proc test_select_frame_view { with_pretty_printer } { - clean_restart $::binfile + clean_restart + gdb_load $::binfile if { $with_pretty_printer } { require allow_python_tests diff --git a/gdb/testsuite/gdb.base/fullname.exp b/gdb/testsuite/gdb.base/fullname.exp index ce617d5792b..ec90179dee9 100644 --- a/gdb/testsuite/gdb.base/fullname.exp +++ b/gdb/testsuite/gdb.base/fullname.exp @@ -45,7 +45,8 @@ set line [gdb_get_line_number "set breakpoint 1 here"] # Initialize GDB after getting the line number, to make sure # symbols aren't loaded. -clean_restart $binfile +clean_restart +gdb_load $binfile set msg "set breakpoint by full path before loading symbols - built absolute" if { [gdb_breakpoint [standard_output_file tmp-${srcfile}]:${line} {no-message}] != 0 } { @@ -70,7 +71,8 @@ if { [gdb_compile [relative_filename [pwd] [build_standard_output_file tmp-${sr return -1 } -clean_restart $binfile +clean_restart +gdb_load $binfile set msg "set breakpoint by full path before loading symbols - built relative" if { [gdb_breakpoint [standard_output_file tmp-${srcfile}]:${line} {no-message}] != 0 } { @@ -99,7 +101,8 @@ with_cwd [standard_output_file {}] { } } -clean_restart $binfile +clean_restart +gdb_load $binfile set msg "set breakpoint by full path before loading symbols - built other" if { [gdb_breakpoint [standard_output_file tmp-${srcfile}]:${line} {no-message}] != 0 } { diff --git a/gdb/testsuite/gdb.base/gcore-buffer-overflow.exp b/gdb/testsuite/gdb.base/gcore-buffer-overflow.exp index 0fb79c733a2..5a6bfe6c39d 100644 --- a/gdb/testsuite/gdb.base/gcore-buffer-overflow.exp +++ b/gdb/testsuite/gdb.base/gcore-buffer-overflow.exp @@ -29,7 +29,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb # Start with a fresh gdb. -clean_restart ${binfile} +clean_restart +gdb_load $binfile gdb_test_no_output "set args ${pattern}" \ "set buffer exceeding arguments" diff --git a/gdb/testsuite/gdb.base/gcore-relro-pie.exp b/gdb/testsuite/gdb.base/gcore-relro-pie.exp index 361fdb60d3d..1f27a0b5079 100644 --- a/gdb/testsuite/gdb.base/gcore-relro-pie.exp +++ b/gdb/testsuite/gdb.base/gcore-relro-pie.exp @@ -51,7 +51,8 @@ if {![gdb_gcore_cmd $gcorefile "save a corefile"]} { # Now restart gdb with the unstripped binary and load the corefile. -clean_restart ${binfile} +clean_restart +gdb_load $binfile gdb_test "core ${gcorefile}" \ "Core was generated by .*" "re-load generated corefile" diff --git a/gdb/testsuite/gdb.base/gcore-relro.exp b/gdb/testsuite/gdb.base/gcore-relro.exp index 0090c37433e..2bbd06443bc 100644 --- a/gdb/testsuite/gdb.base/gcore-relro.exp +++ b/gdb/testsuite/gdb.base/gcore-relro.exp @@ -34,7 +34,8 @@ set objfile [standard_output_file ${testfile}.o] } with_test_prefix "first session" { - clean_restart ${binfile} + clean_restart + gdb_load $binfile gdb_load_shlib ${binfile_lib} if ![runto lib] { @@ -49,7 +50,8 @@ with_test_prefix "first session" { # Now restart gdb and load the corefile. with_test_prefix "second session" { - clean_restart ${binfile} + clean_restart + gdb_load $binfile gdb_load_shlib ${binfile_lib} gdb_test "core ${gcorefile}" "Core was generated by .*" \ diff --git a/gdb/testsuite/gdb.base/gcore-tls-pie.exp b/gdb/testsuite/gdb.base/gcore-tls-pie.exp index c508b7832d9..1ad9b5547b1 100644 --- a/gdb/testsuite/gdb.base/gcore-tls-pie.exp +++ b/gdb/testsuite/gdb.base/gcore-tls-pie.exp @@ -55,7 +55,8 @@ if {![gdb_gcore_cmd $gcorefile "save a corefile"]} { # Now restart gdb with the unstripped binary and load the corefile. -clean_restart ${binfile} +clean_restart +gdb_load $binfile gdb_test "core ${gcorefile}" \ "Core was generated by .*" "re-load generated corefile" diff --git a/gdb/testsuite/gdb.base/gcore.exp b/gdb/testsuite/gdb.base/gcore.exp index 0a9f0991c0d..c8a4c11adc8 100644 --- a/gdb/testsuite/gdb.base/gcore.exp +++ b/gdb/testsuite/gdb.base/gcore.exp @@ -58,7 +58,8 @@ if {!$core_supported} { } # Now restart gdb and load the corefile. -clean_restart $binfile +clean_restart +gdb_load $binfile set core_loaded [gdb_core_cmd "$corefile" "re-load generated corefile"] if { $core_loaded == -1 } { diff --git a/gdb/testsuite/gdb.base/gdb1250.exp b/gdb/testsuite/gdb.base/gdb1250.exp index 4e83c8cf41a..2cabbf0d7bc 100644 --- a/gdb/testsuite/gdb.base/gdb1250.exp +++ b/gdb/testsuite/gdb.base/gdb1250.exp @@ -29,7 +29,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb return -1 } -clean_restart ${binfile} +clean_restart +gdb_load $binfile if {![runto abort {allow-pending}]} { return diff --git a/gdb/testsuite/gdb.base/gdb1555.exp b/gdb/testsuite/gdb.base/gdb1555.exp index 648abd7fc39..ab12a28e5a9 100644 --- a/gdb/testsuite/gdb.base/gdb1555.exp +++ b/gdb/testsuite/gdb.base/gdb1555.exp @@ -34,7 +34,8 @@ if { [gdb_compile_shlib $libsrc $libobj {debug}] != "" return -1 } -clean_restart ${binfile} +clean_restart +gdb_load $binfile gdb_load_shlib $libobj if {![runto_main]} { diff --git a/gdb/testsuite/gdb.base/gdbindex-stabs.exp b/gdb/testsuite/gdb.base/gdbindex-stabs.exp index 506ad11ba22..9becaa14fe2 100644 --- a/gdb/testsuite/gdb.base/gdbindex-stabs.exp +++ b/gdb/testsuite/gdb.base/gdbindex-stabs.exp @@ -28,7 +28,8 @@ if {[gdb_compile "${srcdir}/${subdir}/${srcfile_stabs}" ${objfile_stabs} object return -1 } -clean_restart ${binfile} +clean_restart +gdb_load $binfile # FAIL was: No line number known for stabs_function. gdb_test "list stabs_function" " marker-here .*" diff --git a/gdb/testsuite/gdb.base/global-var-nested-by-dso.exp b/gdb/testsuite/gdb.base/global-var-nested-by-dso.exp index 92d6c62c039..480396a1d7d 100644 --- a/gdb/testsuite/gdb.base/global-var-nested-by-dso.exp +++ b/gdb/testsuite/gdb.base/global-var-nested-by-dso.exp @@ -42,7 +42,8 @@ if { [gdb_compile $srcdir/$subdir/$srcfile $binfile executable \ return -1 } -clean_restart $binfile +clean_restart +gdb_load $binfile gdb_load_shlib $binfile_lib1 gdb_load_shlib $binfile_lib2 diff --git a/gdb/testsuite/gdb.base/gnu_vector.exp b/gdb/testsuite/gdb.base/gnu_vector.exp index ac0bff3265f..62c20032dff 100644 --- a/gdb/testsuite/gdb.base/gnu_vector.exp +++ b/gdb/testsuite/gdb.base/gnu_vector.exp @@ -40,7 +40,8 @@ if { [do_compile {-mcpu=native}] != "" return -1 } -clean_restart ${binfile} +clean_restart +gdb_load $binfile if { ![runto_main] } { return -1 diff --git a/gdb/testsuite/gdb.base/hashline1.exp b/gdb/testsuite/gdb.base/hashline1.exp index 9af144bd025..8e815aee80d 100644 --- a/gdb/testsuite/gdb.base/hashline1.exp +++ b/gdb/testsuite/gdb.base/hashline1.exp @@ -37,7 +37,8 @@ if { [gdb_compile $compile_name "${binfile}" executable {debug}] != "" } { return -1 } -clean_restart ${binfile} +clean_restart +gdb_load $binfile set bp_location [gdb_get_line_number "set breakpoint here" $new_srcfile] diff --git a/gdb/testsuite/gdb.base/hashline2.exp b/gdb/testsuite/gdb.base/hashline2.exp index 740f511b86c..f12b4d109c9 100644 --- a/gdb/testsuite/gdb.base/hashline2.exp +++ b/gdb/testsuite/gdb.base/hashline2.exp @@ -34,7 +34,8 @@ if { [gdb_compile $new_srcfile "${binfile}" executable {debug}] != "" } { return -1 } -clean_restart $binfile +clean_restart +gdb_load $binfile set bp_location [gdb_get_line_number "set breakpoint here" ${new_srcfile}] diff --git a/gdb/testsuite/gdb.base/hashline3.exp b/gdb/testsuite/gdb.base/hashline3.exp index 2575c28b3d3..508f7c98117 100644 --- a/gdb/testsuite/gdb.base/hashline3.exp +++ b/gdb/testsuite/gdb.base/hashline3.exp @@ -35,7 +35,8 @@ if { [gdb_compile $new_srcfile "${binfile}" executable {debug}] != "" } { return -1 } -clean_restart $binfile +clean_restart +gdb_load $binfile set bp_location [gdb_get_line_number "set breakpoint here" $new_srcfile] diff --git a/gdb/testsuite/gdb.base/hbreak-in-shr-unsupported.exp b/gdb/testsuite/gdb.base/hbreak-in-shr-unsupported.exp index 8598345a3f7..9355ce0ee0b 100644 --- a/gdb/testsuite/gdb.base/hbreak-in-shr-unsupported.exp +++ b/gdb/testsuite/gdb.base/hbreak-in-shr-unsupported.exp @@ -34,7 +34,8 @@ if { [gdb_compile_shlib ${srcdir}/${subdir}/${lib_src} ${lib_so} $lib_opts] != " return -1 } -clean_restart $binfile +clean_restart +gdb_load $binfile gdb_load_shlib $lib_so if {![runto_main]} { diff --git a/gdb/testsuite/gdb.base/hook-stop.exp b/gdb/testsuite/gdb.base/hook-stop.exp index a7b6ccd3af0..1c774ce4e4c 100644 --- a/gdb/testsuite/gdb.base/hook-stop.exp +++ b/gdb/testsuite/gdb.base/hook-stop.exp @@ -37,7 +37,8 @@ proc define_hook_stop {commands} { proc setup {commands} { global srcfile binfile - clean_restart $binfile + clean_restart + gdb_load $binfile if {![runto_main]} { return -code return diff --git a/gdb/testsuite/gdb.base/huge.exp b/gdb/testsuite/gdb.base/huge.exp index f75b6209c36..cb12964d073 100644 --- a/gdb/testsuite/gdb.base/huge.exp +++ b/gdb/testsuite/gdb.base/huge.exp @@ -42,7 +42,8 @@ for { set size $max } { $size >= $min } { set size [expr $size / 2] } { require {expr $compilation_succeeded} # Start with a fresh gdb. -clean_restart ${binfile} +clean_restart +gdb_load $binfile save_vars { timeout } { set timeout 30 diff --git a/gdb/testsuite/gdb.base/infcall-exec.exp b/gdb/testsuite/gdb.base/infcall-exec.exp index 33cc5b608d1..b8192844771 100644 --- a/gdb/testsuite/gdb.base/infcall-exec.exp +++ b/gdb/testsuite/gdb.base/infcall-exec.exp @@ -36,7 +36,8 @@ if { [is_remote target] } { set binfile2 [gdb_remote_download target $binfile2] } -clean_restart $binfile +clean_restart +gdb_load $binfile if {![runto_main]} { return -1 diff --git a/gdb/testsuite/gdb.base/infcall-failure.exp b/gdb/testsuite/gdb.base/infcall-failure.exp index e7aeac1ff1c..594cb2be765 100644 --- a/gdb/testsuite/gdb.base/infcall-failure.exp +++ b/gdb/testsuite/gdb.base/infcall-failure.exp @@ -39,7 +39,8 @@ proc start_gdb_and_runto_main { target_async target_non_stop } { append ::GDBFLAGS \ " -ex \"maintenance set target-async ${target_async}\"" - clean_restart ${::binfile} + clean_restart + gdb_load $::binfile } if { ![runto_main] } { diff --git a/gdb/testsuite/gdb.base/infcall-nested-structs.exp.tcl b/gdb/testsuite/gdb.base/infcall-nested-structs.exp.tcl index 3a11d7f108e..fae36c2fc75 100644 --- a/gdb/testsuite/gdb.base/infcall-nested-structs.exp.tcl +++ b/gdb/testsuite/gdb.base/infcall-nested-structs.exp.tcl @@ -81,7 +81,8 @@ proc start_nested_structs_test { lang types } { } # Start with a fresh gdb. - clean_restart ${binfile} + clean_restart + gdb_load $binfile # Make certain that the output is consistent gdb_test_no_output "set print sevenbit-strings" diff --git a/gdb/testsuite/gdb.base/infcall-timeout.exp b/gdb/testsuite/gdb.base/infcall-timeout.exp index aa7dbc34f74..621a7b999ae 100644 --- a/gdb/testsuite/gdb.base/infcall-timeout.exp +++ b/gdb/testsuite/gdb.base/infcall-timeout.exp @@ -41,7 +41,8 @@ proc run_test { target_async target_non_stop non_stop unwind } { append ::GDBFLAGS \ " -ex \"maintenance set target-async ${target_async}\"" - clean_restart ${::binfile} + clean_restart + gdb_load $::binfile } if {![runto_main]} { diff --git a/gdb/testsuite/gdb.base/inferior-args.exp b/gdb/testsuite/gdb.base/inferior-args.exp index dfa1215c504..3887239ef36 100644 --- a/gdb/testsuite/gdb.base/inferior-args.exp +++ b/gdb/testsuite/gdb.base/inferior-args.exp @@ -43,7 +43,8 @@ proc do_test { method startup_with_shell inferior_args expected_results \ stub_suitable } { global binfile hex - clean_restart $binfile + clean_restart + gdb_load $binfile gdb_test_no_output "set startup-with-shell $startup_with_shell" diff --git a/gdb/testsuite/gdb.base/inferior-died.exp b/gdb/testsuite/gdb.base/inferior-died.exp index 764a88da8c2..9ba3a4c0bb8 100644 --- a/gdb/testsuite/gdb.base/inferior-died.exp +++ b/gdb/testsuite/gdb.base/inferior-died.exp @@ -25,7 +25,8 @@ if { [build_executable "failed to build" ${testfile} ${testfile}.c] } { save_vars { GDBFLAGS } { append GDBFLAGS " -ex \"set non-stop on\"" - clean_restart ${binfile} + clean_restart + gdb_load $binfile } gdb_test_no_output "set detach-on-fork off" diff --git a/gdb/testsuite/gdb.base/info-proc.exp b/gdb/testsuite/gdb.base/info-proc.exp index 8dff6a5250f..adc889480e4 100644 --- a/gdb/testsuite/gdb.base/info-proc.exp +++ b/gdb/testsuite/gdb.base/info-proc.exp @@ -63,7 +63,8 @@ if {[istarget "*-*-linux*"]} { } set gcorefile [standard_output_file $testfile.gcore] if {[gdb_gcore_cmd $gcorefile "save a core file"]} { - clean_restart $binfile + clean_restart + gdb_load $binfile gdb_test "core $gcorefile" "Core was generated by.*" \ "core [file tail $gcorefile]" diff --git a/gdb/testsuite/gdb.base/info_sources_2.exp b/gdb/testsuite/gdb.base/info_sources_2.exp index 39b594bf205..09e99727ea7 100644 --- a/gdb/testsuite/gdb.base/info_sources_2.exp +++ b/gdb/testsuite/gdb.base/info_sources_2.exp @@ -35,7 +35,8 @@ if {[gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile} executable \ return -1 } -clean_restart ${binfile} +clean_restart +gdb_load $binfile set solib_name [gdb_load_shlib $solib_name] diff --git a/gdb/testsuite/gdb.base/internal-string-values.exp b/gdb/testsuite/gdb.base/internal-string-values.exp index aa68bc96990..c1afa184bb5 100644 --- a/gdb/testsuite/gdb.base/internal-string-values.exp +++ b/gdb/testsuite/gdb.base/internal-string-values.exp @@ -250,7 +250,8 @@ proc_with_prefix test_internal_var { } { return } - clean_restart $::binfile + clean_restart + gdb_load $::binfile if {![runto_main]} { fail "could not run to main" diff --git a/gdb/testsuite/gdb.base/interrupt-daemon-attach.exp b/gdb/testsuite/gdb.base/interrupt-daemon-attach.exp index 3c46f5d7ef2..a42fc121bc6 100644 --- a/gdb/testsuite/gdb.base/interrupt-daemon-attach.exp +++ b/gdb/testsuite/gdb.base/interrupt-daemon-attach.exp @@ -36,7 +36,8 @@ proc do_test {} { # Attach to the parent, run it to a known point, extract the # child's PID, and detach. with_test_prefix "parent" { - clean_restart ${binfile} + clean_restart + gdb_load $binfile gdb_test "attach $parent_pid" \ "Attaching to program.*, process $parent_pid.*" \ @@ -60,7 +61,8 @@ proc do_test {} { with_test_prefix "child" { global gdb_prompt - clean_restart $binfile + clean_restart + gdb_load $binfile gdb_test "attach $child_pid" \ "Attaching to program.*, process $child_pid.*" \ diff --git a/gdb/testsuite/gdb.base/interrupt-daemon.exp b/gdb/testsuite/gdb.base/interrupt-daemon.exp index 8b8c61d6fc9..b909437b307 100644 --- a/gdb/testsuite/gdb.base/interrupt-daemon.exp +++ b/gdb/testsuite/gdb.base/interrupt-daemon.exp @@ -30,7 +30,8 @@ proc do_test {} { global binfile global gdb_prompt - clean_restart $binfile + clean_restart + gdb_load $binfile gdb_test "set follow-fork-mode child" ".*" diff --git a/gdb/testsuite/gdb.base/jit-reader-exec.exp b/gdb/testsuite/gdb.base/jit-reader-exec.exp index ef6148b68b8..e70f104408d 100644 --- a/gdb/testsuite/gdb.base/jit-reader-exec.exp +++ b/gdb/testsuite/gdb.base/jit-reader-exec.exp @@ -43,7 +43,8 @@ if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ return -1 } -clean_restart $binfile +clean_restart +gdb_load $binfile if {![runto_main]} { return diff --git a/gdb/testsuite/gdb.base/jit-reader-simple.exp b/gdb/testsuite/gdb.base/jit-reader-simple.exp index 77705eb079a..55a274c08a6 100644 --- a/gdb/testsuite/gdb.base/jit-reader-simple.exp +++ b/gdb/testsuite/gdb.base/jit-reader-simple.exp @@ -103,7 +103,8 @@ proc jit_test_reread {standalone change_addr} { with_test_prefix "initial run" { if {$standalone} { - clean_restart $binfile + clean_restart + gdb_load $binfile } else { clean_restart $binfile_dl } diff --git a/gdb/testsuite/gdb.base/kill-during-detach.exp b/gdb/testsuite/gdb.base/kill-during-detach.exp index e1642348bfb..290606ab5c3 100644 --- a/gdb/testsuite/gdb.base/kill-during-detach.exp +++ b/gdb/testsuite/gdb.base/kill-during-detach.exp @@ -76,7 +76,8 @@ set checkpoint_line [gdb_get_line_number "Checkpoint here"] proc run_test { exit_p checkpoint_p } { save_vars { ::GDBFLAGS } { append ::GDBFLAGS " -ex \"set non-stop on\"" - clean_restart $::binfile + clean_restart + gdb_load $::binfile } if {![runto_main]} { diff --git a/gdb/testsuite/gdb.base/killed-outside.exp b/gdb/testsuite/gdb.base/killed-outside.exp index 919584d5991..2b367e4bd7e 100644 --- a/gdb/testsuite/gdb.base/killed-outside.exp +++ b/gdb/testsuite/gdb.base/killed-outside.exp @@ -46,7 +46,8 @@ proc test {cmds_after_kill} { global gdb_prompt global decimal - clean_restart ${binfile} + clean_restart + gdb_load $binfile if ![runto done] { return diff --git a/gdb/testsuite/gdb.base/langs.exp b/gdb/testsuite/gdb.base/langs.exp index b84b7d69564..aa8d8e00cfa 100644 --- a/gdb/testsuite/gdb.base/langs.exp +++ b/gdb/testsuite/gdb.base/langs.exp @@ -93,7 +93,8 @@ if {[runto csub]} { gdb_continue_to_end "first session" } -clean_restart $binfile +clean_restart +gdb_load $binfile # Try exercising the "minimal" language a bit... diff --git a/gdb/testsuite/gdb.base/lineinc.exp b/gdb/testsuite/gdb.base/lineinc.exp index cfd2ba7d27b..2382fa534d8 100644 --- a/gdb/testsuite/gdb.base/lineinc.exp +++ b/gdb/testsuite/gdb.base/lineinc.exp @@ -86,7 +86,8 @@ if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" ${binfile} executable \ return -1 } -clean_restart ${binfile} +clean_restart +gdb_load $binfile # Any command that causes GDB to read the debugging info for the # lineinc.c compilation unit will do here. diff --git a/gdb/testsuite/gdb.base/list-missing-source.exp b/gdb/testsuite/gdb.base/list-missing-source.exp index 78072065506..196a1f209dc 100644 --- a/gdb/testsuite/gdb.base/list-missing-source.exp +++ b/gdb/testsuite/gdb.base/list-missing-source.exp @@ -43,7 +43,8 @@ if { [gdb_compile "${srcfile}" "${binfile}" \ remote_file host delete $srcfile # Now start GDB, run to main and try to list the source. -clean_restart ${binfile} +clean_restart +gdb_load $binfile if {![runto_main]} { return 0 diff --git a/gdb/testsuite/gdb.base/list.exp b/gdb/testsuite/gdb.base/list.exp index d005ceb59a8..bdbb52ba0cf 100644 --- a/gdb/testsuite/gdb.base/list.exp +++ b/gdb/testsuite/gdb.base/list.exp @@ -385,7 +385,8 @@ proc test_only_end {} { proc test_list_invalid_args {} { global binfile - clean_restart ${binfile} + clean_restart + gdb_load $binfile gdb_test "list -INVALID" \ "invalid explicit location argument, \"-INVALID\"" \ "first use of \"list -INVALID\"" @@ -393,7 +394,8 @@ proc test_list_invalid_args {} { "invalid explicit location argument, \"-INVALID\"" \ "second use of \"list -INVALID\"" - clean_restart ${binfile} + clean_restart + gdb_load $binfile gdb_test "list +INVALID" "Function \"\\+INVALID\" not defined." \ "first use of \"list +INVALID\"" gdb_test "list +INVALID" "Function \"\\+INVALID\" not defined." \ @@ -499,7 +501,8 @@ proc test_list {command listsize1 listsize2 linerange1 linerange2} { with_test_prefix "$command after stop: $listsize1, $listsize2" { global binfile - clean_restart $binfile + clean_restart + gdb_load $binfile if {![runto_main]} { return } diff --git a/gdb/testsuite/gdb.base/logical.exp b/gdb/testsuite/gdb.base/logical.exp index 31007e8dfad..b00d6d58c7d 100644 --- a/gdb/testsuite/gdb.base/logical.exp +++ b/gdb/testsuite/gdb.base/logical.exp @@ -32,7 +32,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb return -1 } -clean_restart ${binfile} +clean_restart +gdb_load $binfile # diff --git a/gdb/testsuite/gdb.base/long_long.exp b/gdb/testsuite/gdb.base/long_long.exp index 38ba03e7578..4fbb7573550 100644 --- a/gdb/testsuite/gdb.base/long_long.exp +++ b/gdb/testsuite/gdb.base/long_long.exp @@ -30,7 +30,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [con # use this to debug: #log_user 1 -clean_restart ${binfile} +clean_restart +gdb_load $binfile if {![runto known_types]} { return diff --git a/gdb/testsuite/gdb.base/longjmp.exp b/gdb/testsuite/gdb.base/longjmp.exp index caf0d5cbce5..99552e6baef 100644 --- a/gdb/testsuite/gdb.base/longjmp.exp +++ b/gdb/testsuite/gdb.base/longjmp.exp @@ -26,7 +26,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb } proc do_test { with_probes } { - clean_restart ${::binfile} + clean_restart + gdb_load $::binfile if { !$with_probes } { gdb_test "maint ignore-probes libc ^longjmp$" diff --git a/gdb/testsuite/gdb.base/macscp.exp b/gdb/testsuite/gdb.base/macscp.exp index 0b5f86337c1..63f1356efc3 100644 --- a/gdb/testsuite/gdb.base/macscp.exp +++ b/gdb/testsuite/gdb.base/macscp.exp @@ -29,7 +29,8 @@ if {[gdb_compile "${srcdir}/${subdir}/macscp1.c" "${objfile}" \ return -1 } -clean_restart ${binfile} +clean_restart +gdb_load $binfile # Ask GDB to show the current definition of MACRO, and return a list diff --git a/gdb/testsuite/gdb.base/maint-info-inline-frames-and-blocks.exp b/gdb/testsuite/gdb.base/maint-info-inline-frames-and-blocks.exp index 80f2d01aad2..91d03792a3e 100644 --- a/gdb/testsuite/gdb.base/maint-info-inline-frames-and-blocks.exp +++ b/gdb/testsuite/gdb.base/maint-info-inline-frames-and-blocks.exp @@ -201,7 +201,8 @@ gdb_test "maint info blocks" [make_blocks_result normal_func \ inline_func_a inline_func_b] \ "maint info blocks using stored \$pc, inferior still running" -clean_restart $binfile +clean_restart +gdb_load $binfile # Use the recorded $pc value to check inline frames when the inferior # is not executing. diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp index 7936e5353fe..3d49b36a862 100644 --- a/gdb/testsuite/gdb.base/maint.exp +++ b/gdb/testsuite/gdb.base/maint.exp @@ -72,7 +72,8 @@ with_test_prefix "warnings" { foreach cmd {"per-command" "per-command time"} { with_test_prefix $cmd { # GDB only warns once, so restart between commands. - clean_restart $binfile + clean_restart + gdb_load $binfile gdb_test "mt set $cmd on" "$maybe_per_command_warning" gdb_test "mt set $cmd off" "command started" gdb_test_no_output "mt set $cmd on" \ diff --git a/gdb/testsuite/gdb.base/miscexprs.exp b/gdb/testsuite/gdb.base/miscexprs.exp index 86196fa5dc8..f723d751bd0 100644 --- a/gdb/testsuite/gdb.base/miscexprs.exp +++ b/gdb/testsuite/gdb.base/miscexprs.exp @@ -44,7 +44,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [lis return -1 } -clean_restart ${binfile} +clean_restart +gdb_load $binfile # diff --git a/gdb/testsuite/gdb.base/multi-forks.exp b/gdb/testsuite/gdb.base/multi-forks.exp index 3facccb6315..5d2d22009bc 100644 --- a/gdb/testsuite/gdb.base/multi-forks.exp +++ b/gdb/testsuite/gdb.base/multi-forks.exp @@ -28,7 +28,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $fla # Start with a fresh gdb -clean_restart ${binfile} +clean_restart +gdb_load $binfile global gdb_prompt @@ -103,7 +104,8 @@ proc continue_to_exit_bp_loc {} { # parent's branch. foreach mode { "child" "parent" } { - clean_restart ${binfile} + clean_restart + gdb_load $binfile runto_main gdb_test_no_output "set follow-fork $mode" @@ -135,7 +137,8 @@ foreach mode { "child" "parent" } { # Start with a fresh gdb -clean_restart ${binfile} +clean_restart +gdb_load $binfile runto_main gdb_breakpoint $exit_bp_loc diff --git a/gdb/testsuite/gdb.base/nodebug.exp b/gdb/testsuite/gdb.base/nodebug.exp index 2d0a5a92626..b839317d00a 100644 --- a/gdb/testsuite/gdb.base/nodebug.exp +++ b/gdb/testsuite/gdb.base/nodebug.exp @@ -33,7 +33,8 @@ if { [gdb_compile $srcdir/$subdir/$srcfile $binfile executable $exec_opts] != " # Start with a fresh gdb. -clean_restart $binfile +clean_restart +gdb_load $binfile # Run to FUNC and unload symbols from system shared libraries, to # avoid conflicts with the minsyms in the program. E.g., diff --git a/gdb/testsuite/gdb.base/nofield.exp b/gdb/testsuite/gdb.base/nofield.exp index 2e88725dbe8..31d0234c91f 100644 --- a/gdb/testsuite/gdb.base/nofield.exp +++ b/gdb/testsuite/gdb.base/nofield.exp @@ -23,7 +23,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debu set eol "\r\n" set sp "\[ \t\]*" -clean_restart ${binfile} +clean_restart +gdb_load $binfile gdb_test "ptype struct not_empty" \ "type = struct not_empty {$eol${sp}void \\*e;$eol${sp}void \\*u;$eol}" diff --git a/gdb/testsuite/gdb.base/nostdlib.exp b/gdb/testsuite/gdb.base/nostdlib.exp index ecf09a8d64f..8dcefcf276e 100644 --- a/gdb/testsuite/gdb.base/nostdlib.exp +++ b/gdb/testsuite/gdb.base/nostdlib.exp @@ -49,7 +49,8 @@ foreach_with_prefix pie { "nopie" "pie" } { return -1 } - clean_restart $binfile + clean_restart + gdb_load $binfile gdb_breakpoint "*marker" diff --git a/gdb/testsuite/gdb.base/options.exp b/gdb/testsuite/gdb.base/options.exp index a0947e2f6f4..8ac9f4ee755 100644 --- a/gdb/testsuite/gdb.base/options.exp +++ b/gdb/testsuite/gdb.base/options.exp @@ -205,7 +205,8 @@ proc_with_prefix test-print {{prefix ""}} { } global binfile - clean_restart $binfile + clean_restart + gdb_load $binfile if ![runto_main] { return @@ -317,7 +318,8 @@ proc_with_prefix test-backtrace {} { "backtrace no-filters" global binfile - clean_restart $binfile + clean_restart + gdb_load $binfile if ![runto_main] { return diff --git a/gdb/testsuite/gdb.base/paginate-after-ctrl-c-running.exp b/gdb/testsuite/gdb.base/paginate-after-ctrl-c-running.exp index a831050551c..d60a0ea9e6d 100644 --- a/gdb/testsuite/gdb.base/paginate-after-ctrl-c-running.exp +++ b/gdb/testsuite/gdb.base/paginate-after-ctrl-c-running.exp @@ -31,7 +31,8 @@ proc test_ctrlc_while_target_running_does_not_paginate {} { set testline [gdb_get_line_number "after sleep"] with_test_prefix "ctrlc target running" { - clean_restart $binfile + clean_restart + gdb_load $binfile if {![runto_main]} { return 0 diff --git a/gdb/testsuite/gdb.base/paginate-bg-execution.exp b/gdb/testsuite/gdb.base/paginate-bg-execution.exp index dfd78237270..40f98fc6a29 100644 --- a/gdb/testsuite/gdb.base/paginate-bg-execution.exp +++ b/gdb/testsuite/gdb.base/paginate-bg-execution.exp @@ -30,7 +30,8 @@ proc test_bg_execution_pagination_return {} { global decimal with_test_prefix "paginate" { - clean_restart $binfile + clean_restart + gdb_load $binfile if {![runto_main]} { return 0 diff --git a/gdb/testsuite/gdb.base/paginate-inferior-exit.exp b/gdb/testsuite/gdb.base/paginate-inferior-exit.exp index 76176e2cfc7..6cc992bb7f8 100644 --- a/gdb/testsuite/gdb.base/paginate-inferior-exit.exp +++ b/gdb/testsuite/gdb.base/paginate-inferior-exit.exp @@ -29,7 +29,8 @@ proc test_paginate_inferior_exited {} { global inferior_exited_re with_test_prefix "paginate" { - clean_restart $binfile + clean_restart + gdb_load $binfile if {![runto_main]} { return 0 diff --git a/gdb/testsuite/gdb.base/patch.exp b/gdb/testsuite/gdb.base/patch.exp index 69e5581cbe7..f6abc597c49 100644 --- a/gdb/testsuite/gdb.base/patch.exp +++ b/gdb/testsuite/gdb.base/patch.exp @@ -34,7 +34,8 @@ with_test_prefix "exec" { gdb_test "p extern_global = 2" " = 2" "modify value" gdb_test "p extern_global" " = 2" "value modified" - clean_restart $binfile + clean_restart + gdb_load $binfile gdb_test "p extern_global" " = 2" "value modified persisted" } @@ -43,7 +44,8 @@ with_test_prefix "exec" { # Generate a core file. with_test_prefix "gcore" { - clean_restart $binfile + clean_restart + gdb_load $binfile if {![runto_main]} { return diff --git a/gdb/testsuite/gdb.base/pc-not-saved.exp b/gdb/testsuite/gdb.base/pc-not-saved.exp index 16e11bc46f7..e761e9355f3 100644 --- a/gdb/testsuite/gdb.base/pc-not-saved.exp +++ b/gdb/testsuite/gdb.base/pc-not-saved.exp @@ -60,7 +60,8 @@ gdb_assert { ![string equal $pc unknown] } \ "check we read the frame's PC" # Restart and load the Python unwinder script. -clean_restart $binfile +clean_restart +gdb_load $binfile gdb_test_no_output "source ${remote_python_file}" "load python file" # Tell the Python unwinder to use the frame-id we cached above. diff --git a/gdb/testsuite/gdb.base/pie-fork.exp b/gdb/testsuite/gdb.base/pie-fork.exp index 86407b4adad..9d232c83592 100644 --- a/gdb/testsuite/gdb.base/pie-fork.exp +++ b/gdb/testsuite/gdb.base/pie-fork.exp @@ -29,7 +29,8 @@ if [build_executable "failed to prepare" $testfile $srcfile $opts] { proc setup_test {detach_on_fork {follow_fork_mode "parent"}} { global binfile - clean_restart ${binfile} + clean_restart + gdb_load $binfile if ![runto_main] { return diff --git a/gdb/testsuite/gdb.base/pointers.exp b/gdb/testsuite/gdb.base/pointers.exp index ab021813ffe..4d4d58ed881 100644 --- a/gdb/testsuite/gdb.base/pointers.exp +++ b/gdb/testsuite/gdb.base/pointers.exp @@ -32,7 +32,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb return -1 } -clean_restart ${binfile} +clean_restart +gdb_load $binfile # diff --git a/gdb/testsuite/gdb.base/pr11022.exp b/gdb/testsuite/gdb.base/pr11022.exp index e7bfba0596b..70a7d8b0591 100644 --- a/gdb/testsuite/gdb.base/pr11022.exp +++ b/gdb/testsuite/gdb.base/pr11022.exp @@ -24,7 +24,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb # Start with a fresh gdb. -clean_restart ${binfile} +clean_restart +gdb_load $binfile if {![runto_main]} { return 0 diff --git a/gdb/testsuite/gdb.base/print-symbol-loading.exp b/gdb/testsuite/gdb.base/print-symbol-loading.exp index c9e24808f59..91e818b179d 100644 --- a/gdb/testsuite/gdb.base/print-symbol-loading.exp +++ b/gdb/testsuite/gdb.base/print-symbol-loading.exp @@ -35,7 +35,8 @@ if { [gdb_compile ${objfile} ${binfile} executable $opts] != "" } { return -1 } -clean_restart ${binfile} +clean_restart +gdb_load $binfile gdb_load_shlib ${binfile_lib} if ![runto lib] { @@ -94,7 +95,8 @@ proc test_load_shlib { print_symbol_loading } { global binfile global gdb_prompt with_test_prefix "shlib ${print_symbol_loading}" { - clean_restart ${binfile} + clean_restart + gdb_load $binfile if ![runto_main] { return -1 } diff --git a/gdb/testsuite/gdb.base/prologue.exp b/gdb/testsuite/gdb.base/prologue.exp index 0d3902d7bbd..736e7798a9a 100644 --- a/gdb/testsuite/gdb.base/prologue.exp +++ b/gdb/testsuite/gdb.base/prologue.exp @@ -23,7 +23,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb return -1 } -clean_restart ${binfile} +clean_restart +gdb_load $binfile if {![runto_main]} { return diff --git a/gdb/testsuite/gdb.base/ptr-typedef.exp b/gdb/testsuite/gdb.base/ptr-typedef.exp index 53d03cc0341..8bffb26336a 100644 --- a/gdb/testsuite/gdb.base/ptr-typedef.exp +++ b/gdb/testsuite/gdb.base/ptr-typedef.exp @@ -22,7 +22,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb # Get things started. -clean_restart ${binfile} +clean_restart +gdb_load $binfile if ![runto marker1] { untested "couldn't run to marker1" diff --git a/gdb/testsuite/gdb.base/quit-live.exp b/gdb/testsuite/gdb.base/quit-live.exp index a95c980aa90..46579d4d4f3 100644 --- a/gdb/testsuite/gdb.base/quit-live.exp +++ b/gdb/testsuite/gdb.base/quit-live.exp @@ -95,7 +95,8 @@ proc quit_with_live_inferior {appear_how extra_inferior quit_how} { set test_spawn_id "" if {$appear_how != "attach-nofile"} { - clean_restart $binfile + clean_restart + gdb_load $binfile } else { clean_restart } diff --git a/gdb/testsuite/gdb.base/random-signal.exp b/gdb/testsuite/gdb.base/random-signal.exp index bb5b482166d..16f94676b19 100644 --- a/gdb/testsuite/gdb.base/random-signal.exp +++ b/gdb/testsuite/gdb.base/random-signal.exp @@ -49,7 +49,8 @@ proc do_test {} { # while gdb is processing the internal software watchtpoint # single-step. With remote debugging, the ctrl-c reaches GDB first. with_test_prefix "run" { - clean_restart $binfile + clean_restart + gdb_load $binfile if {![runto_main]} { return -1 @@ -62,7 +63,8 @@ with_test_prefix "run" { # reaches GDB first. Test that as well. with_test_prefix "attach" { if {[can_spawn_for_attach]} { - clean_restart $binfile + clean_restart + gdb_load $binfile set test_spawn_id [spawn_wait_for_attach $binfile] set testpid [spawn_id_get_pid $test_spawn_id] diff --git a/gdb/testsuite/gdb.base/readline-ask.exp b/gdb/testsuite/gdb.base/readline-ask.exp index 2948970b706..0fdfc7661ce 100644 --- a/gdb/testsuite/gdb.base/readline-ask.exp +++ b/gdb/testsuite/gdb.base/readline-ask.exp @@ -27,7 +27,8 @@ setenv TERM dumb # INPUTRC gets reset for the next testfile. setenv INPUTRC $inputrc -clean_restart ${binfile} +clean_restart +gdb_load $binfile if { ![readline_is_used] } { unsupported "completion doesn't work when readline isn't used." diff --git a/gdb/testsuite/gdb.base/readline-commands-eof.exp b/gdb/testsuite/gdb.base/readline-commands-eof.exp index 021e40f3700..d55dd1d1f56 100644 --- a/gdb/testsuite/gdb.base/readline-commands-eof.exp +++ b/gdb/testsuite/gdb.base/readline-commands-eof.exp @@ -43,7 +43,8 @@ if { ![readline_supports_eof_flag] } { # arrived. If it is then GDB will start displaying extra blank lines # after each line of input. proc run_test {} { - clean_restart $::binfile + clean_restart + gdb_load $::binfile gdb_breakpoint main diff --git a/gdb/testsuite/gdb.base/relativedebug.exp b/gdb/testsuite/gdb.base/relativedebug.exp index d7137718b63..2465ffdc503 100644 --- a/gdb/testsuite/gdb.base/relativedebug.exp +++ b/gdb/testsuite/gdb.base/relativedebug.exp @@ -24,7 +24,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb # Get things started. -clean_restart ${binfile} +clean_restart +gdb_load $binfile runto_main diff --git a/gdb/testsuite/gdb.base/remote.exp b/gdb/testsuite/gdb.base/remote.exp index 9917faf89b2..c1d6a99ba0b 100644 --- a/gdb/testsuite/gdb.base/remote.exp +++ b/gdb/testsuite/gdb.base/remote.exp @@ -164,7 +164,8 @@ gdb_load_timed $binfile "limit" 0 # Get the size of random_data table (defaults to 48K). set sizeof_random_data [get_sizeof "random_data" 48*1024] -clean_restart $binfile +clean_restart +gdb_load $binfile # # Part THREE: Check the upload behavior. diff --git a/gdb/testsuite/gdb.base/reread.exp b/gdb/testsuite/gdb.base/reread.exp index 7e7d2c89f86..6c71f40dc79 100644 --- a/gdb/testsuite/gdb.base/reread.exp +++ b/gdb/testsuite/gdb.base/reread.exp @@ -106,7 +106,8 @@ foreach_with_prefix opts { "" "pie" } { gdb_rename_execfile ${binfile1} ${binfile} # Restart GDB entirely. - clean_restart ${binfile} + clean_restart + gdb_load $binfile # Set a breakpoint on foo and run to it. gdb_test "break foo" \ diff --git a/gdb/testsuite/gdb.base/restore.exp b/gdb/testsuite/gdb.base/restore.exp index 9724032e459..5448fb42e67 100644 --- a/gdb/testsuite/gdb.base/restore.exp +++ b/gdb/testsuite/gdb.base/restore.exp @@ -96,7 +96,8 @@ restore_tests set timeout $prev_timeout # Test PR cli/23785 -clean_restart $binfile +clean_restart +gdb_load $binfile if { ![runto_main] } { return -1 } diff --git a/gdb/testsuite/gdb.base/return2.exp b/gdb/testsuite/gdb.base/return2.exp index b657c117348..e90a60b1da7 100644 --- a/gdb/testsuite/gdb.base/return2.exp +++ b/gdb/testsuite/gdb.base/return2.exp @@ -103,7 +103,8 @@ proc return2_tests { } { # Start with a fresh gdb. -clean_restart ${binfile} +clean_restart +gdb_load $binfile set timeout 30 return2_tests diff --git a/gdb/testsuite/gdb.base/run-attach-while-running.exp b/gdb/testsuite/gdb.base/run-attach-while-running.exp index ae1388d79a9..7b40a5f493a 100644 --- a/gdb/testsuite/gdb.base/run-attach-while-running.exp +++ b/gdb/testsuite/gdb.base/run-attach-while-running.exp @@ -60,7 +60,8 @@ proc_with_prefix test { non-stop threaded run-or-attach } { set ::GDBFLAGS "$::GDBFLAGS -ex \"maint set target-non-stop on\"" } - clean_restart $::binfile + clean_restart + gdb_load $::binfile } if { ![runto_main] } { diff --git a/gdb/testsuite/gdb.base/run-control-while-bg-execution.exp b/gdb/testsuite/gdb.base/run-control-while-bg-execution.exp index eaee0101a90..2c75d06b84d 100644 --- a/gdb/testsuite/gdb.base/run-control-while-bg-execution.exp +++ b/gdb/testsuite/gdb.base/run-control-while-bg-execution.exp @@ -56,7 +56,8 @@ proc do_test { action1 action2 } { save_vars { ::GDBFLAGS } { append ::GDBFLAGS " -ex \"maintenance set target-non-stop on\"" - clean_restart $::binfile + clean_restart + gdb_load $::binfile } # Ensure we are at least after the getpid call, should we need it. diff --git a/gdb/testsuite/gdb.base/run-fail-twice.exp b/gdb/testsuite/gdb.base/run-fail-twice.exp index af8c61b1484..07cbddae1cf 100644 --- a/gdb/testsuite/gdb.base/run-fail-twice.exp +++ b/gdb/testsuite/gdb.base/run-fail-twice.exp @@ -43,7 +43,8 @@ proc test_run {testname} { proc_with_prefix test {} { global gdb_prompt binfile - clean_restart $binfile + clean_restart + gdb_load $binfile gdb_test_no_output "set confirm off" diff --git a/gdb/testsuite/gdb.base/savedregs.exp b/gdb/testsuite/gdb.base/savedregs.exp index 2c44566267c..d71d8720f2c 100644 --- a/gdb/testsuite/gdb.base/savedregs.exp +++ b/gdb/testsuite/gdb.base/savedregs.exp @@ -35,7 +35,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb } # get things started -clean_restart ${binfile} +clean_restart +gdb_load $binfile # Advance to main if {![runto_main]} { diff --git a/gdb/testsuite/gdb.base/sep.exp b/gdb/testsuite/gdb.base/sep.exp index 5a1e07732f2..6abf3564961 100644 --- a/gdb/testsuite/gdb.base/sep.exp +++ b/gdb/testsuite/gdb.base/sep.exp @@ -26,7 +26,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb set location [gdb_get_line_number "say_hello" "sep-proc.c"] -clean_restart ${binfile} +clean_restart +gdb_load $binfile # Try to display the source code inside a file which is included by # another source file. The purpose of this test is to verify that @@ -45,7 +46,8 @@ gdb_test "list sep-proc.c:$location" \ # Try the same, but this time with a breakpoint. We need to exit # GDB to make sure that we havn't loaded the full symbols yet when # we test the breakpoint insertion. -clean_restart $binfile +clean_restart +gdb_load $binfile set test "breakpoint inside included file" gdb_test_multiple "break sep-proc.c:$location" "$test" { diff --git a/gdb/testsuite/gdb.base/sepsymtab.exp b/gdb/testsuite/gdb.base/sepsymtab.exp index f5e8705c29e..ed7a7a23f82 100644 --- a/gdb/testsuite/gdb.base/sepsymtab.exp +++ b/gdb/testsuite/gdb.base/sepsymtab.exp @@ -31,7 +31,8 @@ if [gdb_gnu_strip_debug $binfile no-main] { return -1 } -clean_restart ${binfile} +clean_restart +gdb_load $binfile set command "info sym main" set command_regex [string_to_regexp $command] diff --git a/gdb/testsuite/gdb.base/set-cwd.exp b/gdb/testsuite/gdb.base/set-cwd.exp index 72a2632d690..73a200f713d 100644 --- a/gdb/testsuite/gdb.base/set-cwd.exp +++ b/gdb/testsuite/gdb.base/set-cwd.exp @@ -184,7 +184,9 @@ proc_with_prefix test_cwd_reset { } { } test_cd_into_dir -clean_restart $binfile +clean_restart +gdb_load $binfile test_tilde_expansion -clean_restart $binfile +clean_restart +gdb_load $binfile test_cwd_reset diff --git a/gdb/testsuite/gdb.base/set-inferior-tty.exp b/gdb/testsuite/gdb.base/set-inferior-tty.exp index 64ec57b1822..c9b0a96b1bd 100644 --- a/gdb/testsuite/gdb.base/set-inferior-tty.exp +++ b/gdb/testsuite/gdb.base/set-inferior-tty.exp @@ -24,7 +24,8 @@ if {[build_executable $testfile.exp $testfile ${srcfile} ${compile_options}] == proc test_set_inferior_tty { command } { global binfile - clean_restart ${binfile} + clean_restart + gdb_load $binfile gdb_test_no_output "$command hello" "set inferior-tty to hello" gdb_test "show inferior-tty" \ diff --git a/gdb/testsuite/gdb.base/setshow.exp b/gdb/testsuite/gdb.base/setshow.exp index 79ff913b723..0e38a9d8279 100644 --- a/gdb/testsuite/gdb.base/setshow.exp +++ b/gdb/testsuite/gdb.base/setshow.exp @@ -29,7 +29,8 @@ if { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile} executable {debug}] proc_with_prefix test_setshow_annotate {} { # Start with a fresh gdb - clean_restart $::binfile + clean_restart + gdb_load $::binfile if {![runto_main]} { return @@ -78,7 +79,8 @@ proc_with_prefix test_setshow_annotate {} { } proc_with_prefix test_setshow_args {} { - clean_restart $::binfile + clean_restart + gdb_load $::binfile if {![runto_main]} { return diff --git a/gdb/testsuite/gdb.base/settings.exp b/gdb/testsuite/gdb.base/settings.exp index 5e7cc243457..d83023b6816 100644 --- a/gdb/testsuite/gdb.base/settings.exp +++ b/gdb/testsuite/gdb.base/settings.exp @@ -531,7 +531,8 @@ proc test-string {variant} { global srcfile binfile # Load symbols for the completion test below. - clean_restart $binfile + clean_restart + gdb_load $binfile # Use these variables to make sure we don't call the wrong command # by mistake. diff --git a/gdb/testsuite/gdb.base/share-env-with-gdbserver.exp b/gdb/testsuite/gdb.base/share-env-with-gdbserver.exp index 920f435d77d..aa4b300ad34 100644 --- a/gdb/testsuite/gdb.base/share-env-with-gdbserver.exp +++ b/gdb/testsuite/gdb.base/share-env-with-gdbserver.exp @@ -91,7 +91,8 @@ proc do_prepare_inferior { } { proc do_test { var_value { var_name "" } { var_name_match "" } { var_value_match "" } } { global binfile test_var_name - clean_restart $binfile + clean_restart + gdb_load $binfile if { $var_name == "" } { set var_name $test_var_name @@ -146,7 +147,8 @@ with_test_prefix "strange named var" { proc test_set_unset_vars { } { global binfile - clean_restart $binfile + clean_restart + gdb_load $binfile with_test_prefix "set 3 environment variables" { # Set some environment variables @@ -205,7 +207,8 @@ with_test_prefix "test set/unset of vars" { proc test_unset { } { global hex decimal binfile gdb_prompt - clean_restart $binfile + clean_restart + gdb_load $binfile do_prepare_inferior @@ -234,7 +237,8 @@ proc test_unset { } { } with_test_prefix "set-then-unset" { - clean_restart $binfile + clean_restart + gdb_load $binfile # Test if setting and then unsetting $HOME works. gdb_test_no_output "set environment HOME = test" "set HOME as test" diff --git a/gdb/testsuite/gdb.base/shlib-call.exp b/gdb/testsuite/gdb.base/shlib-call.exp index 6a5f6d81ea8..d3ff1c3374c 100644 --- a/gdb/testsuite/gdb.base/shlib-call.exp +++ b/gdb/testsuite/gdb.base/shlib-call.exp @@ -59,7 +59,8 @@ if { [gdb_compile_shlib ${lib1src} ${lib1} $lib_opts] != "" # Start with a fresh gdb. -clean_restart ${binfile} +clean_restart +gdb_load $binfile gdb_load_shlib $lib1 gdb_load_shlib $lib2 @@ -161,7 +162,8 @@ gdb_test "step" "mainshr1 \\(g=4\\) at.*return 2.g;" \ # Start with a fresh gdb. -clean_restart $binfile +clean_restart +gdb_load $binfile # PR's 16495, 18213 # test that we can re-set breakpoints in shared libraries diff --git a/gdb/testsuite/gdb.base/shlib-unload.exp b/gdb/testsuite/gdb.base/shlib-unload.exp index 9d47416fa70..0e1369eda4f 100644 --- a/gdb/testsuite/gdb.base/shlib-unload.exp +++ b/gdb/testsuite/gdb.base/shlib-unload.exp @@ -69,7 +69,8 @@ proc_with_prefix test_bp_modified_events {} { return } - clean_restart $::binfile + clean_restart + gdb_load $::binfile if {![runto_main]} { return @@ -114,7 +115,8 @@ proc_with_prefix test_bp_modified_events {} { # Check that GDB disables dprintf breakpoints within a shared library # when the shared library is unloaded. proc_with_prefix test_dprintf_after_unload {} { - clean_restart $::binfile + clean_restart + gdb_load $::binfile if {![runto_main]} { return @@ -143,7 +145,8 @@ proc_with_prefix test_dprintf_after_unload {} { # inferior. We should not get an error about re-setting the dprintf # breakpoint. proc_with_prefix test_dprintf_with_rerun {} { - clean_restart $::binfile + clean_restart + gdb_load $::binfile if {![runto_main]} { return @@ -238,7 +241,8 @@ proc_with_prefix test_silent_nosharedlib {} { } foreach_with_prefix type { breakpoint dprintf } { - clean_restart $::binfile + clean_restart + gdb_load $::binfile if {![runto_main]} { return diff --git a/gdb/testsuite/gdb.base/shreloc.exp b/gdb/testsuite/gdb.base/shreloc.exp index 8ab64a8071e..2bd79affcc5 100644 --- a/gdb/testsuite/gdb.base/shreloc.exp +++ b/gdb/testsuite/gdb.base/shreloc.exp @@ -65,7 +65,8 @@ if { [gdb_compile_shlib $lib1src $lib1_sl $lib_opts] != ""} { # Start with a fresh gdb. -clean_restart $binfile +clean_restart +gdb_load $binfile gdb_load_shlib $lib1_sl gdb_load_shlib $lib2_sl diff --git a/gdb/testsuite/gdb.base/sigaltstack.exp b/gdb/testsuite/gdb.base/sigaltstack.exp index 978ddebe24a..47013a0f836 100644 --- a/gdb/testsuite/gdb.base/sigaltstack.exp +++ b/gdb/testsuite/gdb.base/sigaltstack.exp @@ -33,7 +33,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb } # get things started -clean_restart ${binfile} +clean_restart +gdb_load $binfile # Pass all the alarms straight through (but verbosely) gdb_test "handle SIGALRM print pass nostop" diff --git a/gdb/testsuite/gdb.base/sigchld.exp b/gdb/testsuite/gdb.base/sigchld.exp index 51d41c3755b..40112417460 100644 --- a/gdb/testsuite/gdb.base/sigchld.exp +++ b/gdb/testsuite/gdb.base/sigchld.exp @@ -24,7 +24,8 @@ if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug return -1 } -clean_restart ${binfile} +clean_restart +gdb_load $binfile runto_main diff --git a/gdb/testsuite/gdb.base/siginfo-obj.exp b/gdb/testsuite/gdb.base/siginfo-obj.exp index d63febb28dd..52f71400125 100644 --- a/gdb/testsuite/gdb.base/siginfo-obj.exp +++ b/gdb/testsuite/gdb.base/siginfo-obj.exp @@ -118,7 +118,8 @@ with_test_prefix "validate modified siginfo fields" { # Test siginfo preservation in core files. if {$gcore_created} { - clean_restart $binfile + clean_restart + gdb_load $binfile gdb_test "core $gcorefile" "Core was generated by.*" \ "core [file tail $gcorefile]" diff --git a/gdb/testsuite/gdb.base/siginfo-thread.exp b/gdb/testsuite/gdb.base/siginfo-thread.exp index bf0d58cdba6..270b4e15e91 100644 --- a/gdb/testsuite/gdb.base/siginfo-thread.exp +++ b/gdb/testsuite/gdb.base/siginfo-thread.exp @@ -27,7 +27,8 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" \ return -1 } -clean_restart $binfile +clean_restart +gdb_load $binfile # Advance to main if {![runto_main]} { @@ -92,7 +93,8 @@ gdb_test "p \$_siginfo.si_signo == $ssi_signo" " = 0" \ # Test siginfo preservation in core files. if {$gcore_created} { - clean_restart $binfile + clean_restart + gdb_load $binfile gdb_test "core $gcorefile" "Core was generated by.*" \ "core [file tail $gcorefile]" diff --git a/gdb/testsuite/gdb.base/signals-state-child.exp b/gdb/testsuite/gdb.base/signals-state-child.exp index 608951f70cd..00ad7f51834 100644 --- a/gdb/testsuite/gdb.base/signals-state-child.exp +++ b/gdb/testsuite/gdb.base/signals-state-child.exp @@ -97,7 +97,8 @@ remote_close target # Now run the program through gdb, and dump its initial signal actions # and mask in "gdb.txt". -clean_restart $binfile +clean_restart +gdb_load $binfile if {![runto_main]} { return -1 diff --git a/gdb/testsuite/gdb.base/signals.exp b/gdb/testsuite/gdb.base/signals.exp index d3113610761..5ff1e381dfe 100644 --- a/gdb/testsuite/gdb.base/signals.exp +++ b/gdb/testsuite/gdb.base/signals.exp @@ -58,7 +58,8 @@ proc test_handle_all_print {} { } test_handle_all_print -clean_restart $binfile +clean_restart +gdb_load $binfile if {[runto_main]} { diff --git a/gdb/testsuite/gdb.base/signull.exp b/gdb/testsuite/gdb.base/signull.exp index 478e471ba8c..9ad772ffeb7 100644 --- a/gdb/testsuite/gdb.base/signull.exp +++ b/gdb/testsuite/gdb.base/signull.exp @@ -37,7 +37,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debu return -1 } -clean_restart ${binfile} +clean_restart +gdb_load $binfile # # Run to `main' where we begin our tests. diff --git a/gdb/testsuite/gdb.base/sigrepeat.exp b/gdb/testsuite/gdb.base/sigrepeat.exp index 9afa3467f99..8fa92af5177 100644 --- a/gdb/testsuite/gdb.base/sigrepeat.exp +++ b/gdb/testsuite/gdb.base/sigrepeat.exp @@ -30,7 +30,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb } # get things started -clean_restart ${binfile} +clean_restart +gdb_load $binfile # Advance to main if {![runto_main]} { diff --git a/gdb/testsuite/gdb.base/sigstep.exp b/gdb/testsuite/gdb.base/sigstep.exp index b49105cf07e..2df5dd0c27c 100644 --- a/gdb/testsuite/gdb.base/sigstep.exp +++ b/gdb/testsuite/gdb.base/sigstep.exp @@ -40,7 +40,8 @@ set other_handler_location [gdb_get_line_number "other handler location"] proc restart {} { global binfile - clean_restart $binfile + clean_restart + gdb_load $binfile gdb_test "display/i \$pc" diff --git a/gdb/testsuite/gdb.base/so-impl-ld.exp b/gdb/testsuite/gdb.base/so-impl-ld.exp index d5c4143ac8f..1e309e53654 100644 --- a/gdb/testsuite/gdb.base/so-impl-ld.exp +++ b/gdb/testsuite/gdb.base/so-impl-ld.exp @@ -33,7 +33,8 @@ if { [gdb_compile_shlib $libsrc $lib_sl $lib_opts] != "" # Start with a fresh gdb -clean_restart ${binfile} +clean_restart +gdb_load $binfile gdb_load_shlib $lib_sl # This program implicitly loads SOM shared libraries. diff --git a/gdb/testsuite/gdb.base/solib-abort.exp b/gdb/testsuite/gdb.base/solib-abort.exp index 2f6d636646b..ab162a9d416 100644 --- a/gdb/testsuite/gdb.base/solib-abort.exp +++ b/gdb/testsuite/gdb.base/solib-abort.exp @@ -38,7 +38,8 @@ if { [gdb_compile_shlib ${srcfile_lib} ${binfile_lib} $lib_flags] != "" return -1 } -clean_restart $binfile +clean_restart +gdb_load $binfile if {![runto_main]} { return 0 diff --git a/gdb/testsuite/gdb.base/solib-disc.exp b/gdb/testsuite/gdb.base/solib-disc.exp index ba7dcce767c..880f632c963 100644 --- a/gdb/testsuite/gdb.base/solib-disc.exp +++ b/gdb/testsuite/gdb.base/solib-disc.exp @@ -44,7 +44,8 @@ if { [gdb_compile_shlib $libsrc $libobj {debug}] != "" return -1 } -clean_restart $binfile +clean_restart +gdb_load $binfile gdb_load_shlib $libobj if {![runto_main]} { diff --git a/gdb/testsuite/gdb.base/solib-symbol.exp b/gdb/testsuite/gdb.base/solib-symbol.exp index f3ca61296dc..4d3494cbc67 100644 --- a/gdb/testsuite/gdb.base/solib-symbol.exp +++ b/gdb/testsuite/gdb.base/solib-symbol.exp @@ -34,7 +34,8 @@ if { [gdb_compile_shlib ${srcfile_lib} ${binfile_lib} $lib_flags] != "" return -1 } -clean_restart $binfile +clean_restart +gdb_load $binfile gdb_load_shlib $binfile_lib # Set a breakpoint in the binary. diff --git a/gdb/testsuite/gdb.base/solib-weak.exp b/gdb/testsuite/gdb.base/solib-weak.exp index 2d75a91d6d3..511ef372771 100644 --- a/gdb/testsuite/gdb.base/solib-weak.exp +++ b/gdb/testsuite/gdb.base/solib-weak.exp @@ -84,7 +84,8 @@ proc do_test { lib1opts lib2opts lib1first } { } with_test_prefix $testopts { - clean_restart $binfile + clean_restart + gdb_load $binfile gdb_load_shlib $lib1 gdb_load_shlib $lib2 diff --git a/gdb/testsuite/gdb.base/source-dir.exp b/gdb/testsuite/gdb.base/source-dir.exp index 3b0c5dd2b06..e07a1177455 100644 --- a/gdb/testsuite/gdb.base/source-dir.exp +++ b/gdb/testsuite/gdb.base/source-dir.exp @@ -119,7 +119,8 @@ proc test_truncated_comp_dir {} { } } - clean_restart ${binfile} + clean_restart + gdb_load $binfile if { [ishost *-*-mingw*] } { gdb_test_no_output "set directories \$cdir;\$cwd" diff --git a/gdb/testsuite/gdb.base/stack-checking.exp b/gdb/testsuite/gdb.base/stack-checking.exp index 5e55b435f6e..15fc677dda1 100644 --- a/gdb/testsuite/gdb.base/stack-checking.exp +++ b/gdb/testsuite/gdb.base/stack-checking.exp @@ -21,7 +21,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [con return -1 } -clean_restart ${binfile} +clean_restart +gdb_load $binfile if {![runto_main]} { return 0 diff --git a/gdb/testsuite/gdb.base/startup-with-shell.exp b/gdb/testsuite/gdb.base/startup-with-shell.exp index 9c016b47c1f..25b161ad4f1 100644 --- a/gdb/testsuite/gdb.base/startup-with-shell.exp +++ b/gdb/testsuite/gdb.base/startup-with-shell.exp @@ -42,7 +42,8 @@ run_on_host \ proc initial_setup_simple { startup_with_shell run_args } { global hex decimal binfile unique_file - clean_restart $binfile + clean_restart + gdb_load $binfile gdb_test_no_output "set startup-with-shell $startup_with_shell" gdb_test_no_output "set print characters unlimited" diff --git a/gdb/testsuite/gdb.base/step-over-no-symbols.exp b/gdb/testsuite/gdb.base/step-over-no-symbols.exp index 2eb8efea005..1a919864d43 100644 --- a/gdb/testsuite/gdb.base/step-over-no-symbols.exp +++ b/gdb/testsuite/gdb.base/step-over-no-symbols.exp @@ -47,7 +47,8 @@ proc test_step_over { displaced } { global hex global binfile - clean_restart $binfile + clean_restart + gdb_load $binfile if ![runto_main] { return -1 diff --git a/gdb/testsuite/gdb.base/step-sw-breakpoint-adjust-pc.exp b/gdb/testsuite/gdb.base/step-sw-breakpoint-adjust-pc.exp index 2dc67ea3139..2dde3bbece7 100644 --- a/gdb/testsuite/gdb.base/step-sw-breakpoint-adjust-pc.exp +++ b/gdb/testsuite/gdb.base/step-sw-breakpoint-adjust-pc.exp @@ -36,7 +36,8 @@ proc test {non_stop displaced always_inserted} { save_vars { GDBFLAGS } { set GDBFLAGS "$GDBFLAGS -ex \"set non-stop $non_stop\"" - clean_restart $binfile + clean_restart + gdb_load $binfile } gdb_test_no_output "set displaced-stepping $displaced" diff --git a/gdb/testsuite/gdb.base/step-test.exp b/gdb/testsuite/gdb.base/step-test.exp index 28eccf75cc4..39833a30fd8 100644 --- a/gdb/testsuite/gdb.base/step-test.exp +++ b/gdb/testsuite/gdb.base/step-test.exp @@ -24,7 +24,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debu return -1 } -clean_restart ${binfile} +clean_restart +gdb_load $binfile if {![runto_main]} { return 0 diff --git a/gdb/testsuite/gdb.base/style.exp b/gdb/testsuite/gdb.base/style.exp index 6b1b08e9d5e..3dde79af323 100644 --- a/gdb/testsuite/gdb.base/style.exp +++ b/gdb/testsuite/gdb.base/style.exp @@ -885,7 +885,8 @@ proc previous_line_is_ok { str } { # prompt, the previous line disables styling as expected. proc test_pagination_prompt_styling {} { with_ansi_styling_terminal { - clean_restart $::binfile + clean_restart + gdb_load $::binfile } if {![runto_main]} { @@ -981,7 +982,8 @@ proc test_pagination_prompt_styling {} { # default style once the logging file has finished. proc test_pagination_continue_styling_1 { length } { with_ansi_styling_terminal { - clean_restart $::binfile + clean_restart + gdb_load $::binfile } set filename [string repeat "ax" $length] @@ -1036,7 +1038,8 @@ proc test_pagination_continue_styling { } { # Check to see if the Python styling of disassembler output is # expected or not, this styling requires Python support in GDB, and # the Python pygments module to be available. -clean_restart ${binfile} +clean_restart +gdb_load $binfile if {[allow_python_tests] && [gdb_py_module_available "pygments"]} { set python_disassembly_styling true } else { diff --git a/gdb/testsuite/gdb.base/sym-file.exp b/gdb/testsuite/gdb.base/sym-file.exp index 8197c0e30ca..6570fdb7a3b 100644 --- a/gdb/testsuite/gdb.base/sym-file.exp +++ b/gdb/testsuite/gdb.base/sym-file.exp @@ -70,7 +70,8 @@ gdb_load_shlib ${lib_so} proc do_test { remove_expr } { global lib_basename lib_syms srcfile srcfile3 - clean_restart $::binfile + clean_restart + gdb_load $::binfile if {![runto_main]} { return diff --git a/gdb/testsuite/gdb.base/symtab-search-order.exp b/gdb/testsuite/gdb.base/symtab-search-order.exp index cf0d5070e74..34b1db02ce9 100644 --- a/gdb/testsuite/gdb.base/symtab-search-order.exp +++ b/gdb/testsuite/gdb.base/symtab-search-order.exp @@ -33,7 +33,8 @@ if { [gdb_compile_shlib $lib1src $lib1 $lib_opts] != "" # Start with a fresh gdb. -clean_restart $binfile +clean_restart +gdb_load $binfile gdb_load_shlib $lib1 if ![runto_main] { diff --git a/gdb/testsuite/gdb.base/testenv.exp b/gdb/testsuite/gdb.base/testenv.exp index beb59d2d7ad..fb7a584bd46 100644 --- a/gdb/testsuite/gdb.base/testenv.exp +++ b/gdb/testsuite/gdb.base/testenv.exp @@ -90,7 +90,8 @@ proc find_env {varname} { proc_with_prefix test_set_unset_env {} { global binfile - clean_restart $binfile + clean_restart + gdb_load $binfile # First test with no TEST_GDB_VAR. with_test_prefix "test1" { @@ -151,7 +152,8 @@ proc_with_prefix test_inherit_env_var {} { save_vars {env(TEST_GDB_GLOBAL)} { set env(TEST_GDB_GLOBAL) "Global environment value" - clean_restart $binfile + clean_restart + gdb_load $binfile gdb_breakpoint $bp_line diff --git a/gdb/testsuite/gdb.base/tls-dlobj.exp b/gdb/testsuite/gdb.base/tls-dlobj.exp index 32e869e1296..1509ec8d445 100644 --- a/gdb/testsuite/gdb.base/tls-dlobj.exp +++ b/gdb/testsuite/gdb.base/tls-dlobj.exp @@ -56,7 +56,8 @@ proc gdb_test_with_xfail { cmd re cond} { } proc do_tests {force_internal_tls} { - clean_restart $::binfile + clean_restart + gdb_load $::binfile if ![runto_main] { return } @@ -288,7 +289,8 @@ proc do_tests {force_internal_tls} { return } - clean_restart $::binfile + clean_restart + gdb_load $::binfile set core_loaded [gdb_core_cmd $corefile "load corefile"] if { $core_loaded == -1 } { diff --git a/gdb/testsuite/gdb.base/tls-multiobj.exp b/gdb/testsuite/gdb.base/tls-multiobj.exp index 2a52610dbf8..eb3721ee4a0 100644 --- a/gdb/testsuite/gdb.base/tls-multiobj.exp +++ b/gdb/testsuite/gdb.base/tls-multiobj.exp @@ -26,7 +26,8 @@ set lib2obj [standard_output_file "${testfile}2-lib.so"] set lib3obj [standard_output_file "${testfile}3-lib.so"] proc do_tests {force_internal_tls {do_kfail_tls_access 0}} { - clean_restart $::binfile + clean_restart + gdb_load $::binfile if ![runto_main] { return } @@ -128,7 +129,8 @@ proc do_tests {force_internal_tls {do_kfail_tls_access 0}} { return } - clean_restart $::binfile + clean_restart + gdb_load $::binfile set core_loaded [gdb_core_cmd $corefile "load corefile"] if { $core_loaded == -1 } { diff --git a/gdb/testsuite/gdb.base/tls-nothreads.exp b/gdb/testsuite/gdb.base/tls-nothreads.exp index 105e68642d7..0be78a2b6f5 100644 --- a/gdb/testsuite/gdb.base/tls-nothreads.exp +++ b/gdb/testsuite/gdb.base/tls-nothreads.exp @@ -18,7 +18,8 @@ source $srcdir/$subdir/tls-common.exp.tcl standard_testfile proc do_tests {force_internal_tls {do_kfail_tls_access 0}} { - clean_restart $::binfile + clean_restart + gdb_load $::binfile if ![runto_main] { return } @@ -155,7 +156,8 @@ proc do_tests {force_internal_tls {do_kfail_tls_access 0}} { return } - clean_restart $::binfile + clean_restart + gdb_load $::binfile set core_loaded [gdb_core_cmd $corefile "load corefile"] if { $core_loaded == -1 } { diff --git a/gdb/testsuite/gdb.base/twice.exp b/gdb/testsuite/gdb.base/twice.exp index 6f49c462850..995cd4d027a 100644 --- a/gdb/testsuite/gdb.base/twice.exp +++ b/gdb/testsuite/gdb.base/twice.exp @@ -32,7 +32,8 @@ if { [gdb_compile $local_srcfile "${binfile}" executable $options] != "" } { # Start with a fresh gdb. -clean_restart $binfile +clean_restart +gdb_load $binfile if {[runto_main]} { # Test that GDB can still detect whether we have line numbers diff --git a/gdb/testsuite/gdb.base/type-opaque.exp b/gdb/testsuite/gdb.base/type-opaque.exp index da060b99d88..f5d8582924f 100644 --- a/gdb/testsuite/gdb.base/type-opaque.exp +++ b/gdb/testsuite/gdb.base/type-opaque.exp @@ -32,7 +32,8 @@ if { [gdb_compile_shlib $libsrc $libobj {debug}] != "" return -1 } -clean_restart ${binfile} +clean_restart +gdb_load $binfile gdb_load_shlib ${libobj} if {![runto_main]} { diff --git a/gdb/testsuite/gdb.base/unload.exp b/gdb/testsuite/gdb.base/unload.exp index 0761f270ebb..b2d848d55da 100644 --- a/gdb/testsuite/gdb.base/unload.exp +++ b/gdb/testsuite/gdb.base/unload.exp @@ -50,7 +50,8 @@ if { [gdb_compile_shlib $libsrc $lib_sl $lib_opts] != "" return -1 } -clean_restart $binfile +clean_restart +gdb_load $binfile gdb_load_shlib $lib_sl gdb_load_shlib $lib_sl2 diff --git a/gdb/testsuite/gdb.base/varargs.exp b/gdb/testsuite/gdb.base/varargs.exp index a34a57868ae..534971c6f5f 100644 --- a/gdb/testsuite/gdb.base/varargs.exp +++ b/gdb/testsuite/gdb.base/varargs.exp @@ -49,7 +49,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ # Start with a fresh gdb. -clean_restart ${binfile} +clean_restart +gdb_load $binfile gdb_test_no_output "set print sevenbit-strings" gdb_test_no_output "set print address off" gdb_test_no_output "set width 0" diff --git a/gdb/testsuite/gdb.base/watch_thread_num.exp b/gdb/testsuite/gdb.base/watch_thread_num.exp index 4a5c1c2d9e9..e1b54c0e4fb 100644 --- a/gdb/testsuite/gdb.base/watch_thread_num.exp +++ b/gdb/testsuite/gdb.base/watch_thread_num.exp @@ -31,7 +31,8 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab return -1 } -clean_restart ${binfile} +clean_restart +gdb_load $binfile if {![runto_main]} { return diff --git a/gdb/testsuite/gdb.base/watchpoint-hw-attach.exp b/gdb/testsuite/gdb.base/watchpoint-hw-attach.exp index fa63edb935d..afdb82e69b9 100644 --- a/gdb/testsuite/gdb.base/watchpoint-hw-attach.exp +++ b/gdb/testsuite/gdb.base/watchpoint-hw-attach.exp @@ -35,7 +35,8 @@ gdb_test "detach" "Detaching from program: .*, process $testpid\r\n\\\[Inferior # A clean restart is needed to force the hardware watchpoint setup # logic to run post attach rather than post inferior launch. -clean_restart $binfile +clean_restart +gdb_load $binfile gdb_test "attach $testpid" "Attaching to program: .*, process $testpid.*" "attach twice" diff --git a/gdb/testsuite/gdb.base/watchpoint-running.exp b/gdb/testsuite/gdb.base/watchpoint-running.exp index 1a5f9c3a23d..04c4c5273df 100644 --- a/gdb/testsuite/gdb.base/watchpoint-running.exp +++ b/gdb/testsuite/gdb.base/watchpoint-running.exp @@ -43,7 +43,8 @@ proc test {stop_mode hw} { # default. append ::GDBFLAGS " -ex \"maint set target-non-stop on\"" } - clean_restart $::binfile + clean_restart + gdb_load $::binfile } gdb_test_no_output "set can-use-hw-watchpoints $hw" diff --git a/gdb/testsuite/gdb.base/watchpoint-solib.exp b/gdb/testsuite/gdb.base/watchpoint-solib.exp index 28b8d084fc1..7f58a83b3d9 100644 --- a/gdb/testsuite/gdb.base/watchpoint-solib.exp +++ b/gdb/testsuite/gdb.base/watchpoint-solib.exp @@ -49,7 +49,8 @@ if { [gdb_compile_shlib $libsrc $lib_sl $lib_opts] != "" return -1 } -clean_restart $binfile +clean_restart +gdb_load $binfile gdb_load_shlib $lib_sl runto_main diff --git a/gdb/testsuite/gdb.base/watchpoint-stops-at-right-insn.exp b/gdb/testsuite/gdb.base/watchpoint-stops-at-right-insn.exp index 2bedcaa5d6f..163ec3bdee7 100644 --- a/gdb/testsuite/gdb.base/watchpoint-stops-at-right-insn.exp +++ b/gdb/testsuite/gdb.base/watchpoint-stops-at-right-insn.exp @@ -129,7 +129,8 @@ proc test {always_inserted} { with_test_prefix "always-inserted $always_inserted" { - clean_restart $binfile + clean_restart + gdb_load $binfile if {![runto_main]} { return diff --git a/gdb/testsuite/gdb.base/watchpoints.exp b/gdb/testsuite/gdb.base/watchpoints.exp index 37baa5e31b6..d8e4d63a57c 100644 --- a/gdb/testsuite/gdb.base/watchpoints.exp +++ b/gdb/testsuite/gdb.base/watchpoints.exp @@ -53,7 +53,8 @@ with_test_prefix "before inferior start" { # This will turn hardware watchpoints back on and delete the watchpoint # we just created. - clean_restart ${binfile} + clean_restart + gdb_load $binfile # Disable hardware watchpoints if necessary. if {!$allow_hw_watchpoint_tests_p} { diff --git a/gdb/testsuite/gdb.base/with-mf.exp b/gdb/testsuite/gdb.base/with-mf.exp index 564d5d7c675..3ac5e1d8a38 100644 --- a/gdb/testsuite/gdb.base/with-mf.exp +++ b/gdb/testsuite/gdb.base/with-mf.exp @@ -29,7 +29,8 @@ if { [ensure_gdb_index $binfile] == -1 } { return -1 } -clean_restart $binfile +clean_restart +gdb_load $binfile gdb_test "with language ada -- print g_s" \ " = \\(a => 1, b => 2, c => 3\\)" diff --git a/gdb/testsuite/gdb.base/with.exp b/gdb/testsuite/gdb.base/with.exp index a9b4a6c9475..d766e5d3b8f 100644 --- a/gdb/testsuite/gdb.base/with.exp +++ b/gdb/testsuite/gdb.base/with.exp @@ -25,7 +25,8 @@ if {[build_executable "failed to prepare" $testfile $srcfile debug]} { return -1 } -clean_restart $binfile +clean_restart +gdb_load $binfile # Test "maint with". VALUES is a list of values. A nested "with" is # performed with each combination of pair of values from this list. @@ -178,7 +179,8 @@ with_test_prefix "user-defined" { # Check repeating. with_test_prefix "repeat" { - clean_restart $binfile + clean_restart + gdb_load $binfile # "with" with no command reinvokes the previous command. gdb_test "with language ada" \ @@ -209,7 +211,8 @@ with_test_prefix "repeat" { # Basic run control. with_test_prefix "run control" { - clean_restart $binfile + clean_restart + gdb_load $binfile if ![runto_main] { return -- 2.47.3