From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 2K8IH2Wsq1/SJgAAWB0awg (envelope-from ) for ; Wed, 11 Nov 2020 04:18:29 -0500 Received: by simark.ca (Postfix, from userid 112) id 7C3431F08B; Wed, 11 Nov 2020 04:18:29 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 3DFDC1E58F for ; Wed, 11 Nov 2020 04:18:27 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6185B398780E; Wed, 11 Nov 2020 09:18:26 +0000 (GMT) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id 01DAF398780E for ; Wed, 11 Nov 2020 09:18:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 01DAF398780E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tdevries@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id D8E65ABD6; Wed, 11 Nov 2020 09:18:15 +0000 (UTC) To: Simon Marchi , gdb-patches@sourceware.org References: <20201105164017.GA26390@delia> <09afb982-34dc-0488-1df7-7534042b787f@simark.ca> From: Tom de Vries Subject: [PATCH][gdb/testsuite] Use clean_restart where possible Message-ID: <1fe630a0-0d44-8e04-b905-09a727ba7c56@suse.de> Date: Wed, 11 Nov 2020 10:18:15 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <09afb982-34dc-0488-1df7-7534042b787f@simark.ca> Content-Type: multipart/mixed; boundary="------------94A3975E82F97CF9FB89F91C" Content-Language: en-US X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" This is a multi-part message in MIME format. --------------94A3975E82F97CF9FB89F91C Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit [ was: Re: [PATCH][gdb/testsuite] Add gdb.dwarf2/fission-multi-cu-clang.exp ] On 11/10/20 8:21 PM, Simon Marchi wrote: >> +gdb_exit >> +gdb_start >> +gdb_reinitialize_dir $srcdir/$subdir > > clean_restart? Hmm yes, that's one of those things I just pick up by starting a test-case using a copy of another test-case. So, let's fix this in those other test-cases as well. FWIW, I'm open to suggestions to do this in an easier way than using awk. Thanks, - Tom --------------94A3975E82F97CF9FB89F91C Content-Type: text/x-patch; charset=UTF-8; name="0001-gdb-testsuite-Use-clean_restart-where-possible.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename*0="0001-gdb-testsuite-Use-clean_restart-where-possible.patch" [gdb/testsuite] Use clean_restart where possible A command series: =2E.. gdb_exit gdb_start gdb_reinitialize_dir $srcdir/$subdir gdb_load =2E.. can be replaced with the shorter: =2E.. clean_restart =2E.. Likewise, if the gdb_load is not present, a command series: =2E.. gdb_exit gdb_start gdb_reinitialize_dir $srcdir/$subdir =2E.. can be replaced with the shorter: =2E.. clean_restart =2E.. Do this replacement using replace.awk: =2E.. BEGINFILE { var=3D0 } /^[ \t]*gdb_exit$/ { match($0, /(^[ \t]*)/, m) prefix=3Dm[1] if (var =3D=3D 0) { var=3D1 line=3D$0 next } } /^[ \t]*gdb_start$/ { match($0, /(^[ \t]*)/, m) if (var =3D=3D 1 && m[1] =3D=3D prefix) { var=3D2 line=3Dline "\n" $0 next } } /^[ \t]*gdb_reinitialize_dir \$srcdir\/\$subdir$/ { match($0, /(^[ \t]*)/, m) if (var =3D=3D 2 && m[1] =3D=3D prefix) { var=3D3 line=3Dprefix "clean_restart" next } } /^[ \t]*gdb_load [^ \t]*$/ { match($0, /(^[ \t]*)/, m) if (var =3D=3D 3 && m[1] =3D=3D prefix) { var=3D0 match($0, /gdb_load ([^ \t]*$)/, m) file=3Dm[1] print prefix "clean_restart " file next } } // { if (var >=3D 1) { var=3D0 ; print line } print $0 } ENDFILE { if (var >=3D 1) { var=3D0 ; print line } } =2E.. and: =2E.. $ for f in $(find gdb/testsuite/ -name *.exp); do \ awk -i inplace -f replace.awk $f \ done =2E.. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2020-11-11 Tom de Vries * gdb.ada/assign_1.exp: Use clean_restart where possible. * gdb.ada/boolean_expr.exp: Same. * gdb.ada/ptype_arith_binop.exp: Same. * gdb.arch/alpha-step.exp: Same. * gdb.arch/altivec-abi.exp: Same. * gdb.arch/e500-prologue.exp: Same. * gdb.arch/e500-regs.exp: Same. * gdb.arch/gdb1291.exp: Same. * gdb.arch/gdb1431.exp: Same. * gdb.arch/gdb1558.exp: Same. * gdb.arch/i386-biarch-core.exp: Same. * gdb.arch/i386-bp_permanent.exp: Same. * gdb.arch/i386-gnu-cfi.exp: Same. * gdb.arch/i386-prologue.exp: Same. * gdb.arch/i386-signal.exp: Same. * gdb.arch/i386-size-overlap.exp: Same. * gdb.arch/i386-size.exp: Same. * gdb.arch/i386-unwind.exp: Same. * gdb.arch/ia64-breakpoint-shadow.exp: Same. * gdb.arch/mips-octeon-bbit.exp: Same. * gdb.arch/pa-nullify.exp: Same. * gdb.arch/powerpc-aix-prologue.exp: Same. * gdb.arch/powerpc-d128-regs.exp: Same. * gdb.arch/powerpc-prologue.exp: Same. * gdb.arch/ppc-dfp.exp: Same. * gdb.arch/ppc-fp.exp: Same. * gdb.arch/ppc64-symtab-cordic.exp: Same. * gdb.arch/pr25124.exp: Same. * gdb.arch/thumb-prologue.exp: Same. * gdb.arch/thumb2-it.exp: Same. * gdb.arch/vsx-regs.exp: Same. * gdb.base/alias.exp: Same. * gdb.base/annota1.exp: Same. * gdb.base/bitops.exp: Same. * gdb.base/checkpoint.exp: Same. * gdb.base/comprdebug.exp: Same. * gdb.base/cursal.exp: Same. * gdb.base/detach.exp: Same. * gdb.base/dfp-exprs.exp: Same. * gdb.base/display.exp: Same. * gdb.base/dprintf-pending.exp: Same. * gdb.base/dump.exp: Same. * gdb.base/fileio.exp: Same. * gdb.base/fixsection.exp: Same. * gdb.base/gcore.exp: Same. * gdb.base/hashline2.exp: Same. * gdb.base/hashline3.exp: Same. * gdb.base/langs.exp: Same. * gdb.base/list.exp: Same. * gdb.base/pending.exp: Same. * gdb.base/permissions.exp: Same. * gdb.base/print-symbol-loading.exp: Same. * gdb.base/printcmds.exp: Same. * gdb.base/readline.exp: Same. * gdb.base/relocate.exp: Same. * gdb.base/sect-cmd.exp: Same. * gdb.base/sep.exp: Same. * gdb.base/sepdebug.exp: Same. * gdb.base/shlib-call.exp: Same. * gdb.base/solib-disc.exp: Same. * gdb.base/solib-symbol.exp: Same. * gdb.base/solib-weak.exp: Same. * gdb.base/subst.exp: Same. * gdb.base/unload.exp: Same. * gdb.base/watchpoint-solib.exp: Same. * gdb.cp/cp-relocate.exp: Same. * gdb.cp/nsusing.exp: Same. * gdb.disasm/am33.exp: Same. * gdb.disasm/h8300s.exp: Same. * gdb.disasm/hppa.exp: Same. * gdb.disasm/mn10300.exp: Same. * gdb.disasm/sh3.exp: Same. * gdb.dwarf2/dw2-error.exp: Same. * gdb.dwarf2/dw2-stack-boundary.exp: Same. * gdb.dwarf2/dwp-symlink.exp: Same. * gdb.dwarf2/dwzbuildid.exp: Same. * gdb.dwarf2/fission-base.exp: Same. * gdb.dwarf2/fission-loclists-pie.exp: Same. * gdb.dwarf2/fission-loclists.exp: Same. * gdb.dwarf2/fission-multi-cu.exp: Same. * gdb.dwarf2/fission-reread.exp: Same. * gdb.dwarf2/member-ptr-forwardref.exp: Same. * gdb.fortran/exprs.exp: Same. * gdb.fortran/subarray.exp: Same. * gdb.fortran/types.exp: Same. * gdb.go/basic-types.exp: Same. * gdb.go/print.exp: Same. * gdb.guile/guile.exp: Same. * gdb.guile/scm-parameter.exp: Same. * gdb.guile/scm-pretty-print.exp: Same. * gdb.guile/scm-progspace.exp: Same. * gdb.guile/scm-section-script.exp: Same. * gdb.guile/scm-symbol.exp: Same. * gdb.guile/scm-type.exp: Same. * gdb.objc/basicclass.exp: Same. * gdb.objc/nondebug.exp: Same. * gdb.objc/objcdecode.exp: Same. * gdb.objc/print.exp: Same. * gdb.pascal/print.exp: Same. * gdb.pascal/types.exp: Same. * gdb.perf/disassemble.exp: Same. * gdb.python/py-format-string.exp: Same. * gdb.python/py-function.exp: Same. * gdb.python/py-lookup-type.exp: Same. * gdb.python/py-parameter.exp: Same. * gdb.python/py-prettyprint.exp: Same. * gdb.python/py-progspace.exp: Same. * gdb.python/py-prompt.exp: Same. * gdb.python/py-section-script.exp: Same. * gdb.python/py-sync-interp.exp: Same. * gdb.python/py-template.exp: Same. * gdb.python/py-type.exp: Same. * gdb.python/python.exp: Same. * gdb.reverse/sigall-precsave.exp: Same. * gdb.reverse/sigall-reverse.exp: Same. * gdb.server/solib-list.exp: Same. * gdb.stabs/weird.exp: Same. * gdb.threads/attach-stopped.exp: Same. * gdb.threads/fork-thread-pending.exp: Same. * gdb.threads/schedlock.exp: Same. * gdb.threads/watchthreads.exp: Same. * gdb.trace/actions.exp: Same. * gdb.trace/change-loc.exp: Same. * gdb.trace/entry-values.exp: Same. * gdb.trace/pending.exp: Same. * gdb.trace/read-memory.exp: Same. * gdb.trace/unavailable.exp: Same. * gdb.trace/while-stepping.exp: Same. * lib/gdb.exp: Same. --- gdb/testsuite/gdb.ada/assign_1.exp | 4 +-- gdb/testsuite/gdb.ada/boolean_expr.exp | 4 +-- gdb/testsuite/gdb.ada/ptype_arith_binop.exp | 4 +-- gdb/testsuite/gdb.arch/alpha-step.exp | 5 +-- gdb/testsuite/gdb.arch/altivec-abi.exp | 5 +-- gdb/testsuite/gdb.arch/e500-prologue.exp | 5 +-- gdb/testsuite/gdb.arch/e500-regs.exp | 5 +-- gdb/testsuite/gdb.arch/gdb1291.exp | 5 +-- gdb/testsuite/gdb.arch/gdb1431.exp | 5 +-- gdb/testsuite/gdb.arch/gdb1558.exp | 5 +-- gdb/testsuite/gdb.arch/i386-biarch-core.exp | 4 +-- gdb/testsuite/gdb.arch/i386-bp_permanent.exp | 5 +-- gdb/testsuite/gdb.arch/i386-gnu-cfi.exp | 5 +-- gdb/testsuite/gdb.arch/i386-prologue.exp | 5 +-- gdb/testsuite/gdb.arch/i386-signal.exp | 5 +-- gdb/testsuite/gdb.arch/i386-size-overlap.exp | 5 +-- gdb/testsuite/gdb.arch/i386-size.exp | 5 +-- gdb/testsuite/gdb.arch/i386-unwind.exp | 5 +-- gdb/testsuite/gdb.arch/ia64-breakpoint-shadow.exp | 5 +-- gdb/testsuite/gdb.arch/mips-octeon-bbit.exp | 5 +-- gdb/testsuite/gdb.arch/pa-nullify.exp | 5 +-- gdb/testsuite/gdb.arch/powerpc-aix-prologue.exp | 5 +-- gdb/testsuite/gdb.arch/powerpc-d128-regs.exp | 5 +-- gdb/testsuite/gdb.arch/powerpc-prologue.exp | 5 +-- gdb/testsuite/gdb.arch/ppc-dfp.exp | 5 +-- gdb/testsuite/gdb.arch/ppc-fp.exp | 5 +-- gdb/testsuite/gdb.arch/ppc64-symtab-cordic.exp | 4 +-- gdb/testsuite/gdb.arch/pr25124.exp | 4 +-- gdb/testsuite/gdb.arch/thumb-prologue.exp | 5 +-- gdb/testsuite/gdb.arch/thumb2-it.exp | 5 +-- gdb/testsuite/gdb.arch/vsx-regs.exp | 5 +-- gdb/testsuite/gdb.base/alias.exp | 4 +-- gdb/testsuite/gdb.base/annota1.exp | 5 +-- gdb/testsuite/gdb.base/bitops.exp | 4 +-- gdb/testsuite/gdb.base/checkpoint.exp | 5 +-- gdb/testsuite/gdb.base/comprdebug.exp | 4 +-- gdb/testsuite/gdb.base/cursal.exp | 4 +-- gdb/testsuite/gdb.base/detach.exp | 5 +-- gdb/testsuite/gdb.base/dfp-exprs.exp | 4 +-- gdb/testsuite/gdb.base/display.exp | 5 +-- gdb/testsuite/gdb.base/dprintf-pending.exp | 8 ++--- gdb/testsuite/gdb.base/dump.exp | 4 +-- gdb/testsuite/gdb.base/fileio.exp | 5 +-- gdb/testsuite/gdb.base/fixsection.exp | 5 +-- gdb/testsuite/gdb.base/gcore.exp | 5 +-- gdb/testsuite/gdb.base/hashline2.exp | 5 +-- gdb/testsuite/gdb.base/hashline3.exp | 5 +-- gdb/testsuite/gdb.base/langs.exp | 5 +-- gdb/testsuite/gdb.base/list.exp | 4 +-- gdb/testsuite/gdb.base/pending.exp | 8 ++--- gdb/testsuite/gdb.base/permissions.exp | 4 +-- gdb/testsuite/gdb.base/print-symbol-loading.exp | 4 +-- gdb/testsuite/gdb.base/printcmds.exp | 4 +-- gdb/testsuite/gdb.base/readline.exp | 4 +-- gdb/testsuite/gdb.base/relocate.exp | 12 ++----- gdb/testsuite/gdb.base/sect-cmd.exp | 5 +-- gdb/testsuite/gdb.base/sep.exp | 5 +-- gdb/testsuite/gdb.base/sepdebug.exp | 8 ++--- gdb/testsuite/gdb.base/shlib-call.exp | 5 +-- gdb/testsuite/gdb.base/solib-disc.exp | 5 +-- gdb/testsuite/gdb.base/solib-symbol.exp | 5 +-- gdb/testsuite/gdb.base/solib-weak.exp | 5 +-- gdb/testsuite/gdb.base/subst.exp | 4 +-- gdb/testsuite/gdb.base/unload.exp | 5 +-- gdb/testsuite/gdb.base/watchpoint-solib.exp | 5 +-- gdb/testsuite/gdb.cp/cp-relocate.exp | 8 ++--- gdb/testsuite/gdb.cp/nsusing.exp | 20 +++-------- gdb/testsuite/gdb.disasm/am33.exp | 5 +-- gdb/testsuite/gdb.disasm/h8300s.exp | 4 +-- gdb/testsuite/gdb.disasm/hppa.exp | 5 +-- gdb/testsuite/gdb.disasm/mn10300.exp | 5 +-- gdb/testsuite/gdb.disasm/sh3.exp | 5 +-- gdb/testsuite/gdb.dwarf2/dw2-error.exp | 4 +-- gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.exp | 4 +-- gdb/testsuite/gdb.dwarf2/dwp-symlink.exp | 4 +-- gdb/testsuite/gdb.dwarf2/dwzbuildid.exp | 4 +-- gdb/testsuite/gdb.dwarf2/fission-base.exp | 4 +-- gdb/testsuite/gdb.dwarf2/fission-loclists-pie.exp | 4 +-- gdb/testsuite/gdb.dwarf2/fission-loclists.exp | 4 +-- gdb/testsuite/gdb.dwarf2/fission-multi-cu.exp | 4 +-- gdb/testsuite/gdb.dwarf2/fission-reread.exp | 4 +-- gdb/testsuite/gdb.dwarf2/member-ptr-forwardref.exp | 4 +-- gdb/testsuite/gdb.fortran/exprs.exp | 4 +-- gdb/testsuite/gdb.fortran/subarray.exp | 5 +-- gdb/testsuite/gdb.fortran/types.exp | 4 +-- gdb/testsuite/gdb.go/basic-types.exp | 4 +-- gdb/testsuite/gdb.go/print.exp | 4 +-- gdb/testsuite/gdb.guile/guile.exp | 4 +-- gdb/testsuite/gdb.guile/scm-parameter.exp | 4 +-- gdb/testsuite/gdb.guile/scm-pretty-print.exp | 10 ++---- gdb/testsuite/gdb.guile/scm-progspace.exp | 4 +-- gdb/testsuite/gdb.guile/scm-section-script.exp | 4 +-- gdb/testsuite/gdb.guile/scm-symbol.exp | 5 +-- gdb/testsuite/gdb.guile/scm-type.exp | 5 +-- gdb/testsuite/gdb.objc/basicclass.exp | 5 +-- gdb/testsuite/gdb.objc/nondebug.exp | 5 +-- gdb/testsuite/gdb.objc/objcdecode.exp | 5 +-- gdb/testsuite/gdb.objc/print.exp | 4 +-- gdb/testsuite/gdb.pascal/print.exp | 4 +-- gdb/testsuite/gdb.pascal/types.exp | 4 +-- gdb/testsuite/gdb.perf/disassemble.exp | 4 +-- gdb/testsuite/gdb.python/py-format-string.exp | 5 +-- gdb/testsuite/gdb.python/py-function.exp | 4 +-- gdb/testsuite/gdb.python/py-lookup-type.exp | 4 +-- gdb/testsuite/gdb.python/py-parameter.exp | 4 +-- gdb/testsuite/gdb.python/py-prettyprint.exp | 10 ++---- gdb/testsuite/gdb.python/py-progspace.exp | 4 +-- gdb/testsuite/gdb.python/py-prompt.exp | 4 +-- gdb/testsuite/gdb.python/py-section-script.exp | 4 +-- gdb/testsuite/gdb.python/py-sync-interp.exp | 4 +-- gdb/testsuite/gdb.python/py-template.exp | 4 +-- gdb/testsuite/gdb.python/py-type.exp | 5 +-- gdb/testsuite/gdb.python/python.exp | 4 +-- gdb/testsuite/gdb.reverse/sigall-precsave.exp | 4 +-- gdb/testsuite/gdb.reverse/sigall-reverse.exp | 4 +-- gdb/testsuite/gdb.server/solib-list.exp | 4 +-- gdb/testsuite/gdb.stabs/weird.exp | 4 +-- gdb/testsuite/gdb.threads/attach-stopped.exp | 5 +-- gdb/testsuite/gdb.threads/fork-thread-pending.exp | 4 +-- gdb/testsuite/gdb.threads/schedlock.exp | 4 +-- gdb/testsuite/gdb.threads/watchthreads.exp | 5 +-- gdb/testsuite/gdb.trace/actions.exp | 8 ++--- gdb/testsuite/gdb.trace/change-loc.exp | 4 +-- gdb/testsuite/gdb.trace/entry-values.exp | 5 +-- gdb/testsuite/gdb.trace/pending.exp | 4 +-- gdb/testsuite/gdb.trace/read-memory.exp | 4 +-- gdb/testsuite/gdb.trace/unavailable.exp | 20 +++-------- gdb/testsuite/gdb.trace/while-stepping.exp | 8 ++--- gdb/testsuite/lib/gdb.exp | 40 +++++-----------= ------ 129 files changed, 153 insertions(+), 533 deletions(-) diff --git a/gdb/testsuite/gdb.ada/assign_1.exp b/gdb/testsuite/gdb.ada/a= ssign_1.exp index abbfd6d7925..5f5ecaa7ef9 100644 --- a/gdb/testsuite/gdb.ada/assign_1.exp +++ b/gdb/testsuite/gdb.ada/assign_1.exp @@ -17,9 +17,7 @@ load_lib "ada.exp" =20 if { [skip_ada_tests] } { return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 # Force the language to Ada, as this will not happen automatically # in this case (no test program). diff --git a/gdb/testsuite/gdb.ada/boolean_expr.exp b/gdb/testsuite/gdb.a= da/boolean_expr.exp index 9d363cfe8eb..a9ec5e17da4 100644 --- a/gdb/testsuite/gdb.ada/boolean_expr.exp +++ b/gdb/testsuite/gdb.ada/boolean_expr.exp @@ -17,9 +17,7 @@ load_lib "ada.exp" =20 if { [skip_ada_tests] } { return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 set any_nb "\[0-9\]+" set any_addr "0x\[0-9a-zA-Z\]+" diff --git a/gdb/testsuite/gdb.ada/ptype_arith_binop.exp b/gdb/testsuite/= gdb.ada/ptype_arith_binop.exp index 9812eb9c0d8..e214900fc9f 100644 --- a/gdb/testsuite/gdb.ada/ptype_arith_binop.exp +++ b/gdb/testsuite/gdb.ada/ptype_arith_binop.exp @@ -15,9 +15,7 @@ =20 if { [skip_ada_tests] } { return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 gdb_test_no_output "set lang ada" \ "set lang ada" diff --git a/gdb/testsuite/gdb.arch/alpha-step.exp b/gdb/testsuite/gdb.ar= ch/alpha-step.exp index 6eeb44a3e99..e9d722ec1c1 100644 --- a/gdb/testsuite/gdb.arch/alpha-step.exp +++ b/gdb/testsuite/gdb.arch/alpha-step.exp @@ -28,10 +28,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${= binfile}" executable {}] ! return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} =20 proc test_stepi {function } { # Restart the program from scratch. If GDB got confused during one diff --git a/gdb/testsuite/gdb.arch/altivec-abi.exp b/gdb/testsuite/gdb.a= rch/altivec-abi.exp index 32530011a39..5cb2692eb8d 100644 --- a/gdb/testsuite/gdb.arch/altivec-abi.exp +++ b/gdb/testsuite/gdb.arch/altivec-abi.exp @@ -55,10 +55,7 @@ proc altivec_abi_tests { extra_flags force_abi } { } } =20 - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir - gdb_load ${binfile} + clean_restart ${binfile} =20 # Run to `main' where we begin our tests. if ![runto_main] then { diff --git a/gdb/testsuite/gdb.arch/e500-prologue.exp b/gdb/testsuite/gdb= =2Earch/e500-prologue.exp index a90027f06d1..fc61fa931fb 100644 --- a/gdb/testsuite/gdb.arch/e500-prologue.exp +++ b/gdb/testsuite/gdb.arch/e500-prologue.exp @@ -31,10 +31,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${= binfile}" executable {}] ! return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} =20 # Insert a breakpoint in FUNCTION and verifies that the breakpoint was # inserted at the expected location. EXPECTED_LOCATION should be an diff --git a/gdb/testsuite/gdb.arch/e500-regs.exp b/gdb/testsuite/gdb.arc= h/e500-regs.exp index fa8e590e027..a6af1dbe324 100644 --- a/gdb/testsuite/gdb.arch/e500-regs.exp +++ b/gdb/testsuite/gdb.arch/e500-regs.exp @@ -141,10 +141,7 @@ gdb_expect_list "info vector" ".*$gdb_prompt $" { # We must restart everything, because we have set important registers to= # some unusual values. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} if ![runto_main] then { fail "can't run to main" return 0 diff --git a/gdb/testsuite/gdb.arch/gdb1291.exp b/gdb/testsuite/gdb.arch/= gdb1291.exp index 26c2125a94c..35086d17c8c 100644 --- a/gdb/testsuite/gdb.arch/gdb1291.exp +++ b/gdb/testsuite/gdb.arch/gdb1291.exp @@ -37,10 +37,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${= binfile}" executable ""] ! return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} =20 # # Run to `main' where we begin our tests. diff --git a/gdb/testsuite/gdb.arch/gdb1431.exp b/gdb/testsuite/gdb.arch/= gdb1431.exp index 119f87d03ce..327bbb5e234 100644 --- a/gdb/testsuite/gdb.arch/gdb1431.exp +++ b/gdb/testsuite/gdb.arch/gdb1431.exp @@ -39,10 +39,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${= binfile}" executable ""] ! return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} =20 # # Run to `main' where we begin our tests. diff --git a/gdb/testsuite/gdb.arch/gdb1558.exp b/gdb/testsuite/gdb.arch/= gdb1558.exp index 9748e2e9b39..dd1ad716df8 100644 --- a/gdb/testsuite/gdb.arch/gdb1558.exp +++ b/gdb/testsuite/gdb.arch/gdb1558.exp @@ -36,10 +36,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${= binfile}" executable {"add return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} =20 gdb_test "b -q main" "Breakpoint 1.*" "set breakpoint at main" gdb_test "b -q sub1" "Breakpoint 2.*" "set breakpoint at sub1" diff --git a/gdb/testsuite/gdb.arch/i386-biarch-core.exp b/gdb/testsuite/= gdb.arch/i386-biarch-core.exp index 43b668aa1b6..06b84556e81 100644 --- a/gdb/testsuite/gdb.arch/i386-biarch-core.exp +++ b/gdb/testsuite/gdb.arch/i386-biarch-core.exp @@ -23,9 +23,7 @@ =20 standard_testfile =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 set test "complete set gnutarget" gdb_test_multiple "complete set gnutarget " $test { diff --git a/gdb/testsuite/gdb.arch/i386-bp_permanent.exp b/gdb/testsuite= /gdb.arch/i386-bp_permanent.exp index 21c4449fb76..a79cf9f34d7 100644 --- a/gdb/testsuite/gdb.arch/i386-bp_permanent.exp +++ b/gdb/testsuite/gdb.arch/i386-bp_permanent.exp @@ -36,10 +36,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${= binfile}" executable [list } =20 =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} =20 # # Run to `main' where we begin our tests. diff --git a/gdb/testsuite/gdb.arch/i386-gnu-cfi.exp b/gdb/testsuite/gdb.= arch/i386-gnu-cfi.exp index fa965c3c215..1b75b766425 100644 --- a/gdb/testsuite/gdb.arch/i386-gnu-cfi.exp +++ b/gdb/testsuite/gdb.arch/i386-gnu-cfi.exp @@ -43,10 +43,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfilec} ${s= rcdir}/${subdir}/${srcfile =20 # Get things started. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} =20 # We should stop in abort(3). =20 diff --git a/gdb/testsuite/gdb.arch/i386-prologue.exp b/gdb/testsuite/gdb= =2Earch/i386-prologue.exp index 4edcf566d6b..28c40f3d620 100644 --- a/gdb/testsuite/gdb.arch/i386-prologue.exp +++ b/gdb/testsuite/gdb.arch/i386-prologue.exp @@ -56,10 +56,7 @@ proc skip_breakpoint { msg } { } =20 =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} =20 # # Run to `main' where we begin our tests. diff --git a/gdb/testsuite/gdb.arch/i386-signal.exp b/gdb/testsuite/gdb.a= rch/i386-signal.exp index 4a26589c7be..149dd83ee53 100644 --- a/gdb/testsuite/gdb.arch/i386-signal.exp +++ b/gdb/testsuite/gdb.arch/i386-signal.exp @@ -28,10 +28,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${= binfile}" \ return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} =20 runto func gdb_test "backtrace 10" \ diff --git a/gdb/testsuite/gdb.arch/i386-size-overlap.exp b/gdb/testsuite= /gdb.arch/i386-size-overlap.exp index e025412a8fd..1ee7d61e014 100644 --- a/gdb/testsuite/gdb.arch/i386-size-overlap.exp +++ b/gdb/testsuite/gdb.arch/i386-size-overlap.exp @@ -33,10 +33,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${= binfile}" \ return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} =20 # We use gdb_run_cmd so this stands a chance to work for remote # targets too. diff --git a/gdb/testsuite/gdb.arch/i386-size.exp b/gdb/testsuite/gdb.arc= h/i386-size.exp index b0f844e0028..694c638bcfc 100644 --- a/gdb/testsuite/gdb.arch/i386-size.exp +++ b/gdb/testsuite/gdb.arch/i386-size.exp @@ -38,10 +38,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${= binfile}" \ return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} =20 # We use gdb_run_cmd so this stands a chance to work for remote # targets too. diff --git a/gdb/testsuite/gdb.arch/i386-unwind.exp b/gdb/testsuite/gdb.a= rch/i386-unwind.exp index 1a5111f1d33..c3957058efb 100644 --- a/gdb/testsuite/gdb.arch/i386-unwind.exp +++ b/gdb/testsuite/gdb.arch/i386-unwind.exp @@ -36,10 +36,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${= binfile}" executable [list return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} =20 # Testcase for backtrace/1435. =20 diff --git a/gdb/testsuite/gdb.arch/ia64-breakpoint-shadow.exp b/gdb/test= suite/gdb.arch/ia64-breakpoint-shadow.exp index 7387a50bc03..1813d2f6d77 100644 --- a/gdb/testsuite/gdb.arch/ia64-breakpoint-shadow.exp +++ b/gdb/testsuite/gdb.arch/ia64-breakpoint-shadow.exp @@ -26,10 +26,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "$= {binfile}" executable {deb return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} =20 # We need to start the inferior to place the breakpoints in the memory a= t all. if ![runto_main] { diff --git a/gdb/testsuite/gdb.arch/mips-octeon-bbit.exp b/gdb/testsuite/= gdb.arch/mips-octeon-bbit.exp index d1487972729..d85564e938c 100644 --- a/gdb/testsuite/gdb.arch/mips-octeon-bbit.exp +++ b/gdb/testsuite/gdb.arch/mips-octeon-bbit.exp @@ -88,10 +88,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "$= {binfile}" executable \ =20 pass "compilation" =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} # Native needs run. runto_main =20 diff --git a/gdb/testsuite/gdb.arch/pa-nullify.exp b/gdb/testsuite/gdb.ar= ch/pa-nullify.exp index c8d0a650e2b..09009c5e173 100644 --- a/gdb/testsuite/gdb.arch/pa-nullify.exp +++ b/gdb/testsuite/gdb.arch/pa-nullify.exp @@ -40,10 +40,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${= binfile}" executable {}] ! return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} =20 # In the first test, we do a "step" on a function whose last instruction= =20 # contains a branch-with-nullify. The instruction in the delay slot bel= ongs diff --git a/gdb/testsuite/gdb.arch/powerpc-aix-prologue.exp b/gdb/testsu= ite/gdb.arch/powerpc-aix-prologue.exp index d896b9202de..019f299bdc7 100644 --- a/gdb/testsuite/gdb.arch/powerpc-aix-prologue.exp +++ b/gdb/testsuite/gdb.arch/powerpc-aix-prologue.exp @@ -31,10 +31,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${= binfile}" executable {}] ! return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} =20 # Insert a breakpoint in FUNCTION and verifies that the breakpoint was # inserted at the expected location. EXPECTED_LOCATION should be an diff --git a/gdb/testsuite/gdb.arch/powerpc-d128-regs.exp b/gdb/testsuite= /gdb.arch/powerpc-d128-regs.exp index cccf9e703eb..76c35eac4d7 100644 --- a/gdb/testsuite/gdb.arch/powerpc-d128-regs.exp +++ b/gdb/testsuite/gdb.arch/powerpc-d128-regs.exp @@ -34,10 +34,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "$= {binfile}" executable {qui =20 # Start with a fresh gdb. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} =20 if { ![runto_main] } then { fail "run to main" diff --git a/gdb/testsuite/gdb.arch/powerpc-prologue.exp b/gdb/testsuite/= gdb.arch/powerpc-prologue.exp index 1e1dafe0a56..542c09aa052 100644 --- a/gdb/testsuite/gdb.arch/powerpc-prologue.exp +++ b/gdb/testsuite/gdb.arch/powerpc-prologue.exp @@ -34,10 +34,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${= binfile}" executable {}] ! } =20 =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} =20 # # Run to `main' where we begin our tests. diff --git a/gdb/testsuite/gdb.arch/ppc-dfp.exp b/gdb/testsuite/gdb.arch/= ppc-dfp.exp index 3f3d0d6f5fb..cad48c6f572 100644 --- a/gdb/testsuite/gdb.arch/ppc-dfp.exp +++ b/gdb/testsuite/gdb.arch/ppc-dfp.exp @@ -41,10 +41,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${= binfile}" executable {quie =20 # Start with a fresh gdb. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} =20 gdb_breakpoint [gdb_get_line_number "Set DFP rounding mode."] =20 diff --git a/gdb/testsuite/gdb.arch/ppc-fp.exp b/gdb/testsuite/gdb.arch/p= pc-fp.exp index bf080416db0..b4e81292614 100644 --- a/gdb/testsuite/gdb.arch/ppc-fp.exp +++ b/gdb/testsuite/gdb.arch/ppc-fp.exp @@ -41,10 +41,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${= binfile}" executable {quie =20 # Start with a fresh gdb. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} =20 gdb_breakpoint [gdb_get_line_number "Invalid operation."] gdb_breakpoint [gdb_get_line_number "Division by zero."] diff --git a/gdb/testsuite/gdb.arch/ppc64-symtab-cordic.exp b/gdb/testsui= te/gdb.arch/ppc64-symtab-cordic.exp index a1fa5ffabee..e57acced4e2 100644 --- a/gdb/testsuite/gdb.arch/ppc64-symtab-cordic.exp +++ b/gdb/testsuite/gdb.arch/ppc64-symtab-cordic.exp @@ -34,9 +34,7 @@ if {[catch "system \"bzip2 -dc ${kodebugbz2file} >${kod= ebugfile}\""] !=3D 0} { return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 # This test won't work properly if system debuginfo is installed. # Test message is suppressed by "" as otherwise we could print PASS+UNTE= STED diff --git a/gdb/testsuite/gdb.arch/pr25124.exp b/gdb/testsuite/gdb.arch/= pr25124.exp index e83fd3427dc..33655bc466d 100644 --- a/gdb/testsuite/gdb.arch/pr25124.exp +++ b/gdb/testsuite/gdb.arch/pr25124.exp @@ -28,9 +28,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${b= infile}" executable debug return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 # Load the symbol file the first time. gdb_load ${binfile} diff --git a/gdb/testsuite/gdb.arch/thumb-prologue.exp b/gdb/testsuite/gd= b.arch/thumb-prologue.exp index 0c6de8a7ce9..788a24066dc 100644 --- a/gdb/testsuite/gdb.arch/thumb-prologue.exp +++ b/gdb/testsuite/gdb.arch/thumb-prologue.exp @@ -30,10 +30,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${= binfile}" executable {"add } =20 =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} =20 # # Run to `main' where we begin our tests. diff --git a/gdb/testsuite/gdb.arch/thumb2-it.exp b/gdb/testsuite/gdb.arc= h/thumb2-it.exp index 01d5ed88648..b77b10f0bb6 100644 --- a/gdb/testsuite/gdb.arch/thumb2-it.exp +++ b/gdb/testsuite/gdb.arch/thumb2-it.exp @@ -27,10 +27,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${= binfile}" executable debug return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} =20 if ![runto_main] then { untested "could not run to main" diff --git a/gdb/testsuite/gdb.arch/vsx-regs.exp b/gdb/testsuite/gdb.arch= /vsx-regs.exp index 4ce01e3d01a..ccbb61f7461 100644 --- a/gdb/testsuite/gdb.arch/vsx-regs.exp +++ b/gdb/testsuite/gdb.arch/vsx-regs.exp @@ -181,10 +181,7 @@ if {!$core_supported} { return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} =20 set core_loaded [gdb_core_cmd "$corefile" "re-load generated corefile"] if { $core_loaded =3D=3D -1 } { diff --git a/gdb/testsuite/gdb.base/alias.exp b/gdb/testsuite/gdb.base/al= ias.exp index 03c440dfd7b..d113d0be167 100644 --- a/gdb/testsuite/gdb.base/alias.exp +++ b/gdb/testsuite/gdb.base/alias.exp @@ -14,9 +14,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 # Helper to test the -a option to alias. # Aliases that are abbreviations of commands (e.g. r -> run) diff --git a/gdb/testsuite/gdb.base/annota1.exp b/gdb/testsuite/gdb.base/= annota1.exp index f3c99667acd..07d075dce22 100644 --- a/gdb/testsuite/gdb.base/annota1.exp +++ b/gdb/testsuite/gdb.base/annota1.exp @@ -455,10 +455,7 @@ proc thread_test {} { =20 if { ![get_compiler_info] && [gdb_compile_pthreads "${srcdir}/${subd= ir}/${srcfile}" "${binfile}" executable {debug nowarnings}] =3D=3D "" } {= =20 - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir - gdb_load ${binfile} + clean_restart ${binfile} if { ![runto_main] } then { fail "run to main" return diff --git a/gdb/testsuite/gdb.base/bitops.exp b/gdb/testsuite/gdb.base/b= itops.exp index 26b56625d1c..91c01d457c8 100644 --- a/gdb/testsuite/gdb.base/bitops.exp +++ b/gdb/testsuite/gdb.base/bitops.exp @@ -28,9 +28,7 @@ # =20 =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 =20 gdb_test "print !1" ".\[0-9\]* =3D 0" "print value of !1" diff --git a/gdb/testsuite/gdb.base/checkpoint.exp b/gdb/testsuite/gdb.ba= se/checkpoint.exp index 86b098aa1b5..e1f6bd3756d 100644 --- a/gdb/testsuite/gdb.base/checkpoint.exp +++ b/gdb/testsuite/gdb.base/checkpoint.exp @@ -291,10 +291,7 @@ gdb_test "restart 10" "Not found.*" "no more checkpo= int 10" # Now let's try setting a large number of checkpoints (>600) # =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} =20 runto_main gdb_breakpoint $break1_loc diff --git a/gdb/testsuite/gdb.base/comprdebug.exp b/gdb/testsuite/gdb.ba= se/comprdebug.exp index e78b8a3ce1e..1dce4a08b0c 100644 --- a/gdb/testsuite/gdb.base/comprdebug.exp +++ b/gdb/testsuite/gdb.base/comprdebug.exp @@ -34,9 +34,7 @@ if {$result =3D=3D 1} { return } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart set testname "file [file tail $ofile]" if {[gdb_file_cmd $ofile] =3D=3D 0} { pass $testname diff --git a/gdb/testsuite/gdb.base/cursal.exp b/gdb/testsuite/gdb.base/c= ursal.exp index ef48d7287a7..247a9445d0b 100644 --- a/gdb/testsuite/gdb.base/cursal.exp +++ b/gdb/testsuite/gdb.base/cursal.exp @@ -21,9 +21,7 @@ if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${bi= nfile}" executable {debug return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart gdb_file_cmd ${binfile} gdb_test_no_output "set listsize 1" =20 diff --git a/gdb/testsuite/gdb.base/detach.exp b/gdb/testsuite/gdb.base/d= etach.exp index 426ca6fcd7b..d42e6215310 100644 --- a/gdb/testsuite/gdb.base/detach.exp +++ b/gdb/testsuite/gdb.base/detach.exp @@ -43,10 +43,7 @@ proc do_detach_tests {} { } =20 # Start with a fresh gdb -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} =20 global pass set pass "one" diff --git a/gdb/testsuite/gdb.base/dfp-exprs.exp b/gdb/testsuite/gdb.bas= e/dfp-exprs.exp index a4d27b847fe..ea2f48a5a1a 100644 --- a/gdb/testsuite/gdb.base/dfp-exprs.exp +++ b/gdb/testsuite/gdb.base/dfp-exprs.exp @@ -173,9 +173,7 @@ proc test_dfp_conversions {} { =20 # Start with a fresh gdb. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 test_dfp_literals_accepted test_dfp_arithmetic_expressions diff --git a/gdb/testsuite/gdb.base/display.exp b/gdb/testsuite/gdb.base/= display.exp index 242e13bc291..979183ec2e1 100644 --- a/gdb/testsuite/gdb.base/display.exp +++ b/gdb/testsuite/gdb.base/display.exp @@ -43,10 +43,7 @@ if !$use_gdb_stub { gdb_test "kill" ".*" "kill again" gdb_test "detach" ".*" "detach again" =20 - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir - gdb_load ${binfile} + clean_restart ${binfile} } =20 # Ok, on to real life diff --git a/gdb/testsuite/gdb.base/dprintf-pending.exp b/gdb/testsuite/g= db.base/dprintf-pending.exp index a13c8a4ae46..38a3bc83139 100644 --- a/gdb/testsuite/gdb.base/dprintf-pending.exp +++ b/gdb/testsuite/gdb.base/dprintf-pending.exp @@ -37,18 +37,14 @@ if { [gdb_compile_shlib $libsrc $lib_sl $lib_opts] !=3D= "" } =20 with_test_prefix "without format" { - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir + clean_restart =20 gdb_test "dprintf pendfunc" "Format string required" "missing ,FMT" gdb_test "dprintf pendfunc," "Format string required" "missing FMT" } =20 with_test_prefix "without symbols" { - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir + clean_restart =20 gdb_test \ "dprintf pendfunc1, \"x=3D%d\\n\", x" \ diff --git a/gdb/testsuite/gdb.base/dump.exp b/gdb/testsuite/gdb.base/dum= p.exp index 23071ef0ed2..83663075e77 100644 --- a/gdb/testsuite/gdb.base/dump.exp +++ b/gdb/testsuite/gdb.base/dump.exp @@ -52,9 +52,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${= binfile}" executable ${op =20 # Start with a fresh gdb. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 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/fileio.exp b/gdb/testsuite/gdb.base/f= ileio.exp index 9735869e519..fddc59db14e 100644 --- a/gdb/testsuite/gdb.base/fileio.exp +++ b/gdb/testsuite/gdb.base/fileio.exp @@ -54,10 +54,7 @@ set timeout [expr "$timeout + 60"] =20 # Start with a fresh gdb. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${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/fixsection.exp b/gdb/testsuite/gdb.ba= se/fixsection.exp index 92a1b81eecb..6cad6dfc7c3 100644 --- a/gdb/testsuite/gdb.base/fixsection.exp +++ b/gdb/testsuite/gdb.base/fixsection.exp @@ -40,10 +40,7 @@ if { [gdb_compile_shlib $libsrc $lib_sl $lib_opts] !=3D= "" =20 # Start with a fresh gdb. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} gdb_load_shlib ${lib_sl} =20 if ![runto_main] then { diff --git a/gdb/testsuite/gdb.base/gcore.exp b/gdb/testsuite/gdb.base/gc= ore.exp index 66e16a54fb6..594981d2476 100644 --- a/gdb/testsuite/gdb.base/gcore.exp +++ b/gdb/testsuite/gdb.base/gcore.exp @@ -58,10 +58,7 @@ if {!$core_supported} { } =20 # Now restart gdb and load the corefile. -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} =20 set core_loaded [gdb_core_cmd "$corefile" "re-load generated corefile"] if { $core_loaded =3D=3D -1 } { diff --git a/gdb/testsuite/gdb.base/hashline2.exp b/gdb/testsuite/gdb.bas= e/hashline2.exp index bdfc0e8ca85..a785d0340c4 100644 --- a/gdb/testsuite/gdb.base/hashline2.exp +++ b/gdb/testsuite/gdb.base/hashline2.exp @@ -34,10 +34,7 @@ if { [gdb_compile $new_srcfile "${binfile}" executable= {debug}] !=3D "" } { return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} =20 set bp_location [gdb_get_line_number "set breakpoint here" ${new_srcfile= }] =20 diff --git a/gdb/testsuite/gdb.base/hashline3.exp b/gdb/testsuite/gdb.bas= e/hashline3.exp index 068f58f6490..e534ceb1e94 100644 --- a/gdb/testsuite/gdb.base/hashline3.exp +++ b/gdb/testsuite/gdb.base/hashline3.exp @@ -35,10 +35,7 @@ if { [gdb_compile $new_srcfile "${binfile}" executable= {debug}] !=3D "" } { return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} =20 set bp_location [gdb_get_line_number "set breakpoint here" $new_srcfile]= =20 diff --git a/gdb/testsuite/gdb.base/langs.exp b/gdb/testsuite/gdb.base/la= ngs.exp index f1fb2b56f07..0049012c254 100644 --- a/gdb/testsuite/gdb.base/langs.exp +++ b/gdb/testsuite/gdb.base/langs.exp @@ -98,10 +98,7 @@ if [runto csub] then { gdb_continue_to_end "langs.exp" } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load $binfile +clean_restart $binfile =20 # Try exercising the "minimal" language a bit... =20 diff --git a/gdb/testsuite/gdb.base/list.exp b/gdb/testsuite/gdb.base/lis= t.exp index b7d0e98978d..17a112d5016 100644 --- a/gdb/testsuite/gdb.base/list.exp +++ b/gdb/testsuite/gdb.base/list.exp @@ -548,9 +548,7 @@ proc test_list_invalid_args {} { =20 # Start with a fresh gdb. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart gdb_file_cmd ${binfile} =20 gdb_test_no_output "set width 0" diff --git a/gdb/testsuite/gdb.base/pending.exp b/gdb/testsuite/gdb.base/= pending.exp index cb9e4f2158e..6c8f6104981 100644 --- a/gdb/testsuite/gdb.base/pending.exp +++ b/gdb/testsuite/gdb.base/pending.exp @@ -43,9 +43,7 @@ if { [gdb_compile_shlib $libsrc $lib_sl $lib_opts] !=3D= "" =20 # Start with a fresh gdb. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 gdb_test_multiple "break pendfunc1" "set pending breakpoint" { -re ".*Make breakpoint pending.*y or \\\[n\\\]. $" { @@ -74,9 +72,7 @@ gdb_test "" \ =20 # Restart with a fresh gdb. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 gdb_load ${binfile} gdb_load_shlib $lib_sl diff --git a/gdb/testsuite/gdb.base/permissions.exp b/gdb/testsuite/gdb.b= ase/permissions.exp index 6cc6f70eb96..b6eb2aeec63 100644 --- a/gdb/testsuite/gdb.base/permissions.exp +++ b/gdb/testsuite/gdb.base/permissions.exp @@ -30,9 +30,7 @@ if [get_compiler_info] { return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 with_test_prefix "observer mode off" { =20 diff --git a/gdb/testsuite/gdb.base/print-symbol-loading.exp b/gdb/testsu= ite/gdb.base/print-symbol-loading.exp index f29faa758f0..bafba62b247 100644 --- a/gdb/testsuite/gdb.base/print-symbol-loading.exp +++ b/gdb/testsuite/gdb.base/print-symbol-loading.exp @@ -51,9 +51,7 @@ if {![gdb_gcore_cmd $gcorefile "save a corefile"]} { proc test_load_core { print_symbol_loading } { global binfile binfile_lib gcorefile srcdir subdir with_test_prefix "core ${print_symbol_loading}" { - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir + clean_restart gdb_test_no_output "set print symbol-loading $print_symbol_loading" if { ${print_symbol_loading} !=3D "off" } { gdb_test "file $binfile" "Reading symbols from.*" "file" diff --git a/gdb/testsuite/gdb.base/printcmds.exp b/gdb/testsuite/gdb.bas= e/printcmds.exp index 08a09613031..3f534ad0108 100644 --- a/gdb/testsuite/gdb.base/printcmds.exp +++ b/gdb/testsuite/gdb.base/printcmds.exp @@ -988,9 +988,7 @@ proc test_printf_convenience_var {prefix} { =20 # Start with a fresh gdb. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 gdb_test "print \$pc" "No registers\\." =20 diff --git a/gdb/testsuite/gdb.base/readline.exp b/gdb/testsuite/gdb.base= /readline.exp index 64a40a89ad4..b90e20d794d 100644 --- a/gdb/testsuite/gdb.base/readline.exp +++ b/gdb/testsuite/gdb.base/readline.exp @@ -189,9 +189,7 @@ save_vars { env(TERM) } { set env(GDBHISTFILE) "${srcdir}/${subdir}/gdb_history" set env(GDBHISTSIZE) "10" =20 - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir + clean_restart =20 operate_and_get_next "Simple operate-and-get-next" \ "p 7" ".* =3D 7" \ diff --git a/gdb/testsuite/gdb.base/relocate.exp b/gdb/testsuite/gdb.base= /relocate.exp index 8ed23987b1d..a9a7b755688 100644 --- a/gdb/testsuite/gdb.base/relocate.exp +++ b/gdb/testsuite/gdb.base/relocate.exp @@ -25,9 +25,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${b= infile}" object {debug}] return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 #Check that invalid options are rejected. foreach x {"-raednow" "readnow" "foo" "-readnow s"} { @@ -194,9 +192,7 @@ if { "${function_foo_addr}" =3D=3D "${function_bar_ad= dr}" } { # Now use a variable as an offset to add-symbol-file, and check that # the functions' addresses change. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 gdb_test_no_output "set \$offset =3D 0x10000" =20 @@ -317,9 +313,7 @@ with_test_prefix "global vars, 3rd" { # Now try loading the object as an exec-file; we should be able to print= # the values of variables after we do this. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart gdb_file_cmd ${binfile} =20 # Check the values of the variables. diff --git a/gdb/testsuite/gdb.base/sect-cmd.exp b/gdb/testsuite/gdb.base= /sect-cmd.exp index 16d39916219..4c93caad823 100644 --- a/gdb/testsuite/gdb.base/sect-cmd.exp +++ b/gdb/testsuite/gdb.base/sect-cmd.exp @@ -46,10 +46,7 @@ if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${bin= file}" executable {debug n return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} =20 if ![runto_main] then { fail "section command tests suppressed" } =20 diff --git a/gdb/testsuite/gdb.base/sep.exp b/gdb/testsuite/gdb.base/sep.= exp index 484f78f385c..a3ada6418ce 100644 --- a/gdb/testsuite/gdb.base/sep.exp +++ b/gdb/testsuite/gdb.base/sep.exp @@ -41,10 +41,7 @@ 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. -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} =20 set test "breakpoint inside included file" gdb_test_multiple "break sep-proc.c:$location" "$test" { diff --git a/gdb/testsuite/gdb.base/sepdebug.exp b/gdb/testsuite/gdb.base= /sepdebug.exp index 502c664d95c..78ff14f69bd 100644 --- a/gdb/testsuite/gdb.base/sepdebug.exp +++ b/gdb/testsuite/gdb.base/sepdebug.exp @@ -556,9 +556,7 @@ proc test_different_dir {type test_different_dir xfai= l} { global srcdir subdir binfile srcfile timeout gdb_prompt global bp_location6 decimal hex =20 - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir + clean_restart gdb_test_no_output "set debug-file-directory ${test_different_dir}" \ "set separate debug location" gdb_load ${binfile} @@ -651,9 +649,7 @@ if {[build_executable sepdebug.exp sepdebug2 sepdebug= 2.c debug] !=3D -1 =20 remote_exec build "cp ${debugfile} [standard_output_file sepdebug2.d= ebug]" =20 - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir + clean_restart =20 set escapedobjdirsubdir [string_to_regexp [standard_output_file {}]]= =20 diff --git a/gdb/testsuite/gdb.base/shlib-call.exp b/gdb/testsuite/gdb.ba= se/shlib-call.exp index 97e04cdbb5e..b1962206db2 100644 --- a/gdb/testsuite/gdb.base/shlib-call.exp +++ b/gdb/testsuite/gdb.base/shlib-call.exp @@ -162,10 +162,7 @@ gdb_test "step" "mainshr1 \\(g=3D4\\) at.*return 2.g= ;" \ =20 # Start with a fresh gdb. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${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/solib-disc.exp b/gdb/testsuite/gdb.ba= se/solib-disc.exp index a7454721b84..62f58fc9021 100644 --- a/gdb/testsuite/gdb.base/solib-disc.exp +++ b/gdb/testsuite/gdb.base/solib-disc.exp @@ -49,10 +49,7 @@ if { [gdb_compile_shlib $libsrc $libobj {debug}] !=3D = "" return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} gdb_load_shlib $libobj =20 if ![runto_main] then { diff --git a/gdb/testsuite/gdb.base/solib-symbol.exp b/gdb/testsuite/gdb.= base/solib-symbol.exp index 81c05722f99..d87c7d96bbc 100644 --- a/gdb/testsuite/gdb.base/solib-symbol.exp +++ b/gdb/testsuite/gdb.base/solib-symbol.exp @@ -40,10 +40,7 @@ if { [gdb_compile_shlib ${srcfile_lib} ${binfile_lib} = $lib_flags] !=3D "" return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} gdb_load_shlib $binfile_lib =20 # Set a breakpoint in the binary. diff --git a/gdb/testsuite/gdb.base/solib-weak.exp b/gdb/testsuite/gdb.ba= se/solib-weak.exp index 426b57097f9..3577ef72334 100644 --- a/gdb/testsuite/gdb.base/solib-weak.exp +++ b/gdb/testsuite/gdb.base/solib-weak.exp @@ -90,10 +90,7 @@ proc do_test { lib1opts lib2opts lib1first } { return -1 } =20 - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir - gdb_load ${binfile} + clean_restart ${binfile} gdb_load_shlib $lib1 gdb_load_shlib $lib2 =20 diff --git a/gdb/testsuite/gdb.base/subst.exp b/gdb/testsuite/gdb.base/su= bst.exp index c56ae880b4a..0f00bf74a48 100644 --- a/gdb/testsuite/gdb.base/subst.exp +++ b/gdb/testsuite/gdb.base/subst.exp @@ -13,9 +13,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 # Do a bunch of testing of the set/unset/show substitute-path # commands that do not require the presence of an executable. diff --git a/gdb/testsuite/gdb.base/unload.exp b/gdb/testsuite/gdb.base/u= nload.exp index dfd12fcfcea..2e1a320cf4c 100644 --- a/gdb/testsuite/gdb.base/unload.exp +++ b/gdb/testsuite/gdb.base/unload.exp @@ -58,10 +58,7 @@ if { [gdb_compile_shlib $libsrc $lib_sl $lib_opts] !=3D= "" =20 # Start with a fresh gdb. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} gdb_load_shlib $lib_sl gdb_load_shlib $lib_sl2 =20 diff --git a/gdb/testsuite/gdb.base/watchpoint-solib.exp b/gdb/testsuite/= gdb.base/watchpoint-solib.exp index bffb0713c18..80466f90705 100644 --- a/gdb/testsuite/gdb.base/watchpoint-solib.exp +++ b/gdb/testsuite/gdb.base/watchpoint-solib.exp @@ -48,10 +48,7 @@ if { [gdb_compile_shlib $libsrc $lib_sl $lib_opts] !=3D= "" =20 # Start with a fresh gdb. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} gdb_load_shlib $lib_sl =20 runto_main diff --git a/gdb/testsuite/gdb.cp/cp-relocate.exp b/gdb/testsuite/gdb.cp/= cp-relocate.exp index 2b2598b5700..05c59f19247 100644 --- a/gdb/testsuite/gdb.cp/cp-relocate.exp +++ b/gdb/testsuite/gdb.cp/cp-relocate.exp @@ -46,9 +46,7 @@ proc get_func_address { func } { =20 # Load the file as an executable; GDB should assign non-overlapping # section offsets. -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart gdb_file_cmd ${binfile} =20 # Find the interesting functions. We go to a little effort to find @@ -118,9 +116,7 @@ if { $func1_sec =3D=3D $func2_sec } { } =20 # Now start a clean GDB, for add-symbol-file tests. -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 gdb_test "add-symbol-file ${binfile} 0 -s ${func1_sec} 0x10000 -s ${func= 2_sec} 0x20000" \ "Reading symbols from .*${testfile}\\.o\\.\\.\\.(|\r\nUsing host libthr= ead_db library .*libthread_db.so.*\\.)" \ diff --git a/gdb/testsuite/gdb.cp/nsusing.exp b/gdb/testsuite/gdb.cp/nsus= ing.exp index 04a9a7e88c9..11b5f66b4f5 100644 --- a/gdb/testsuite/gdb.cp/nsusing.exp +++ b/gdb/testsuite/gdb.cp/nsusing.exp @@ -47,10 +47,7 @@ gdb_continue_to_breakpoint "marker3" gdb_test "print _a" "No symbol \"_a\" in current context." \ "Print _a without import" =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} =20 =20 ############################################ @@ -68,10 +65,7 @@ gdb_continue_to_breakpoint "marker1 stop" gdb_test "print _a" "=3D 1" "print _a in a nested scope" =20 =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} =20 ############################################ # test printing of namespace imported into @@ -85,10 +79,7 @@ if ![runto marker5] then { =20 gdb_test "print cc" "=3D 3" =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} =20 =20 ############################################ @@ -107,10 +98,7 @@ gdb_test "print _a" "No symbol \"_a\" in current cont= ext." \ gdb_test "print x" "No symbol \"x\" in current context." \ "print x in namespace alias scope" =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} =20 =20 ############################################ diff --git a/gdb/testsuite/gdb.disasm/am33.exp b/gdb/testsuite/gdb.disasm= /am33.exp index 33810154a20..1c1dd0ce674 100644 --- a/gdb/testsuite/gdb.disasm/am33.exp +++ b/gdb/testsuite/gdb.disasm/am33.exp @@ -800,10 +800,7 @@ proc dsp_autoincrement_tests { } { =20 # Start with a fresh gdb. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load $binfile +clean_restart $binfile =20 call_tests movm_tests diff --git a/gdb/testsuite/gdb.disasm/h8300s.exp b/gdb/testsuite/gdb.disa= sm/h8300s.exp index ff82caf76f8..fca95f52264 100644 --- a/gdb/testsuite/gdb.disasm/h8300s.exp +++ b/gdb/testsuite/gdb.disasm/h8300s.exp @@ -643,9 +643,7 @@ proc all_block_data_transfer_tests { } { } } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart all_set_machine_h8300s gdb_load $binfile =20 diff --git a/gdb/testsuite/gdb.disasm/hppa.exp b/gdb/testsuite/gdb.disasm= /hppa.exp index bbe2e7b1cd0..88cd87fd7e4 100644 --- a/gdb/testsuite/gdb.disasm/hppa.exp +++ b/gdb/testsuite/gdb.disasm/hppa.exp @@ -1372,10 +1372,7 @@ proc fmemLRbug_tests { } { =20 # Start with a fresh gdb. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load $binfile +clean_restart $binfile =20 all_integer_memory_tests all_immediate_tests diff --git a/gdb/testsuite/gdb.disasm/mn10300.exp b/gdb/testsuite/gdb.dis= asm/mn10300.exp index 828aeec4923..e03674fe293 100644 --- a/gdb/testsuite/gdb.disasm/mn10300.exp +++ b/gdb/testsuite/gdb.disasm/mn10300.exp @@ -534,10 +534,7 @@ proc sub_tests { } { =20 # Start with a fresh gdb. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load $binfile +clean_restart $binfile =20 add_tests bcc_tests diff --git a/gdb/testsuite/gdb.disasm/sh3.exp b/gdb/testsuite/gdb.disasm/= sh3.exp index f2199263256..485f4c6905c 100644 --- a/gdb/testsuite/gdb.disasm/sh3.exp +++ b/gdb/testsuite/gdb.disasm/sh3.exp @@ -103,10 +103,7 @@ proc all_fp_misc_tests { } { } } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load $binfile +clean_restart $binfile =20 all_fp_move_and_load_tests all_fp_arithmetic_tests diff --git a/gdb/testsuite/gdb.dwarf2/dw2-error.exp b/gdb/testsuite/gdb.d= warf2/dw2-error.exp index 345cc117093..0b4c8e83050 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-error.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-error.exp @@ -33,9 +33,7 @@ if {[build_executable $testfile.exp $testfile $srcfile = {nodebug quiet}]} { return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 gdb_test_no_output "set breakpoint pending off" =20 diff --git a/gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.exp b/gdb/testsu= ite/gdb.dwarf2/dw2-stack-boundary.exp index d946679e548..d1061855061 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.exp @@ -25,9 +25,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${b= infile}" object {}] !=3D "" return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 # From gdb_file_cmd: if [is_remote host] { diff --git a/gdb/testsuite/gdb.dwarf2/dwp-symlink.exp b/gdb/testsuite/gdb= =2Edwarf2/dwp-symlink.exp index 7b52dad3828..cd4fcaa5b87 100644 --- a/gdb/testsuite/gdb.dwarf2/dwp-symlink.exp +++ b/gdb/testsuite/gdb.dwarf2/dwp-symlink.exp @@ -75,9 +75,7 @@ gdb_test "ptype main" {type =3D int \(int, char \*\*\)}= "binary symlink, dwp at sy # a relative path for the program. =20 # This is clean_restart, but specifying a relative path to the binary. -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart gdb_test "cd [file dirname [standard_output_file ${thelink}]]" \ "Working directory .*" gdb_load "./${thelink}" diff --git a/gdb/testsuite/gdb.dwarf2/dwzbuildid.exp b/gdb/testsuite/gdb.= dwarf2/dwzbuildid.exp index 10ad10ae40e..292e541b9d2 100644 --- a/gdb/testsuite/gdb.dwarf2/dwzbuildid.exp +++ b/gdb/testsuite/gdb.dwarf2/dwzbuildid.exp @@ -150,9 +150,7 @@ if {[gdb_compile [list ${binfile}1.o ${binfile}6.o] $= {binfile}-fallback \ =20 foreach testname {ok mismatch fallback} { with_test_prefix $testname { - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir + clean_restart =20 gdb_test_no_output "set debug-file-directory $debugdir" \ "set debug-file-directory" diff --git a/gdb/testsuite/gdb.dwarf2/fission-base.exp b/gdb/testsuite/gd= b.dwarf2/fission-base.exp index 41e30a73fbf..cb290de781e 100644 --- a/gdb/testsuite/gdb.dwarf2/fission-base.exp +++ b/gdb/testsuite/gdb.dwarf2/fission-base.exp @@ -37,9 +37,7 @@ if [build_executable_from_fission_assembler \ return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart # Make sure we can find the .dwo file, regardless of whether we're # running in parallel mode. gdb_test_no_output "set debug-file-directory [file dirname $binfile]" \ diff --git a/gdb/testsuite/gdb.dwarf2/fission-loclists-pie.exp b/gdb/test= suite/gdb.dwarf2/fission-loclists-pie.exp index 519d4aa5dc5..fd882622eea 100644 --- a/gdb/testsuite/gdb.dwarf2/fission-loclists-pie.exp +++ b/gdb/testsuite/gdb.dwarf2/fission-loclists-pie.exp @@ -43,9 +43,7 @@ if [build_executable_from_fission_assembler \ return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart # Make sure we can find the .dwo file, regardless of whether we're # running in parallel mode. gdb_test_no_output "set debug-file-directory [file dirname $binfile]" \ diff --git a/gdb/testsuite/gdb.dwarf2/fission-loclists.exp b/gdb/testsuit= e/gdb.dwarf2/fission-loclists.exp index d80ec2ba63e..feb425ccc33 100644 --- a/gdb/testsuite/gdb.dwarf2/fission-loclists.exp +++ b/gdb/testsuite/gdb.dwarf2/fission-loclists.exp @@ -37,9 +37,7 @@ if [build_executable_from_fission_assembler \ return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart # Make sure we can find the .dwo file, regardless of whether we're # running in parallel mode. gdb_test_no_output "set debug-file-directory [file dirname $binfile]" \ diff --git a/gdb/testsuite/gdb.dwarf2/fission-multi-cu.exp b/gdb/testsuit= e/gdb.dwarf2/fission-multi-cu.exp index f2be5b91d63..4e90eeacef4 100644 --- a/gdb/testsuite/gdb.dwarf2/fission-multi-cu.exp +++ b/gdb/testsuite/gdb.dwarf2/fission-multi-cu.exp @@ -37,9 +37,7 @@ if [build_executable_from_fission_assembler \ return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart # Make sure we can find the .dwo file, regardless of whether we're # running in parallel mode. gdb_test_no_output "set debug-file-directory [file dirname $binfile]" \ diff --git a/gdb/testsuite/gdb.dwarf2/fission-reread.exp b/gdb/testsuite/= gdb.dwarf2/fission-reread.exp index 1994ad7a599..d90c949a8fd 100644 --- a/gdb/testsuite/gdb.dwarf2/fission-reread.exp +++ b/gdb/testsuite/gdb.dwarf2/fission-reread.exp @@ -36,9 +36,7 @@ if [build_executable_from_fission_assembler \ return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart # Make sure we can find the .dwo file, regardless of whether we're # running in parallel mode. gdb_test_no_output "set debug-file-directory [file dirname $binfile]" \ diff --git a/gdb/testsuite/gdb.dwarf2/member-ptr-forwardref.exp b/gdb/tes= tsuite/gdb.dwarf2/member-ptr-forwardref.exp index f32cbb7b9ca..6353dc6f62f 100644 --- a/gdb/testsuite/gdb.dwarf2/member-ptr-forwardref.exp +++ b/gdb/testsuite/gdb.dwarf2/member-ptr-forwardref.exp @@ -28,9 +28,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" ${bi= nfile} object {debug}] !=3D return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 # Be sure to set cp-abi before ${binfile} gets loaded gdb_test "set cp-abi gnu-v3" diff --git a/gdb/testsuite/gdb.fortran/exprs.exp b/gdb/testsuite/gdb.fort= ran/exprs.exp index 3cef73b2757..a65dacdf230 100644 --- a/gdb/testsuite/gdb.fortran/exprs.exp +++ b/gdb/testsuite/gdb.fortran/exprs.exp @@ -243,9 +243,7 @@ proc test_arithmetic_expressions {} { =20 # Start with a fresh gdb. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 gdb_test "set print sevenbit-strings" "" =20 diff --git a/gdb/testsuite/gdb.fortran/subarray.exp b/gdb/testsuite/gdb.f= ortran/subarray.exp index 9ee5a9b3cb1..e601285dfae 100644 --- a/gdb/testsuite/gdb.fortran/subarray.exp +++ b/gdb/testsuite/gdb.fortran/subarray.exp @@ -27,10 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile= $srcfile {debug f90}]} { return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} =20 if ![fortran_runto_main] then { perror "couldn't run to main" diff --git a/gdb/testsuite/gdb.fortran/types.exp b/gdb/testsuite/gdb.fort= ran/types.exp index 8c1ca5cece8..88cfc3234cb 100644 --- a/gdb/testsuite/gdb.fortran/types.exp +++ b/gdb/testsuite/gdb.fortran/types.exp @@ -73,9 +73,7 @@ proc test_float_literal_types_accepted {} { =20 # Start with a fresh gdb. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 gdb_test "set print sevenbit-strings" "" =20 diff --git a/gdb/testsuite/gdb.go/basic-types.exp b/gdb/testsuite/gdb.go/= basic-types.exp index dd0d92fd04d..6538a50044b 100644 --- a/gdb/testsuite/gdb.go/basic-types.exp +++ b/gdb/testsuite/gdb.go/basic-types.exp @@ -102,9 +102,7 @@ proc test_complex_literal_types_accepted {} { =20 # Start with a fresh gdb. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 if [set_lang_go] { test_integer_literal_types_accepted diff --git a/gdb/testsuite/gdb.go/print.exp b/gdb/testsuite/gdb.go/print.= exp index 33af0312ef4..469b6845462 100644 --- a/gdb/testsuite/gdb.go/print.exp +++ b/gdb/testsuite/gdb.go/print.exp @@ -58,9 +58,7 @@ proc test_float_rejected {} { =20 # Start with a fresh gdb. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 if [set_lang_go] { test_float_accepted diff --git a/gdb/testsuite/gdb.guile/guile.exp b/gdb/testsuite/gdb.guile/= guile.exp index 1f80c8a2384..478c19d4b44 100644 --- a/gdb/testsuite/gdb.guile/guile.exp +++ b/gdb/testsuite/gdb.guile/guile.exp @@ -19,9 +19,7 @@ load_lib gdb-guile.exp =20 # Start with a fresh gdb. -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 # Do this instead of the skip_guile_check. # We want to do some tests when Guile is not present. diff --git a/gdb/testsuite/gdb.guile/scm-parameter.exp b/gdb/testsuite/gd= b.guile/scm-parameter.exp index d1e67af1cc1..fb35da1b083 100644 --- a/gdb/testsuite/gdb.guile/scm-parameter.exp +++ b/gdb/testsuite/gdb.guile/scm-parameter.exp @@ -19,9 +19,7 @@ load_lib gdb-guile.exp =20 # Start with a fresh gdb. -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 # Skip all tests if Guile scripting is not enabled. if { [skip_guile_tests] } { continue } diff --git a/gdb/testsuite/gdb.guile/scm-pretty-print.exp b/gdb/testsuite= /gdb.guile/scm-pretty-print.exp index a63e32c16c7..9d7b0e79516 100644 --- a/gdb/testsuite/gdb.guile/scm-pretty-print.exp +++ b/gdb/testsuite/gdb.guile/scm-pretty-print.exp @@ -37,10 +37,7 @@ proc run_lang_tests {exefile lang} { set nl "\[\r\n\]+" =20 # Start with a fresh gdb. - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir - gdb_load ${exefile} + clean_restart ${exefile} =20 if ![gdb_guile_runto_main] { return @@ -113,10 +110,7 @@ run_lang_tests "${binfile}-cxx" "c++" # Run various other tests. =20 # Start with a fresh gdb. -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} =20 if ![gdb_guile_runto_main] { return diff --git a/gdb/testsuite/gdb.guile/scm-progspace.exp b/gdb/testsuite/gd= b.guile/scm-progspace.exp index 91a78e2ab8f..193ecaa1d20 100644 --- a/gdb/testsuite/gdb.guile/scm-progspace.exp +++ b/gdb/testsuite/gdb.guile/scm-progspace.exp @@ -26,9 +26,7 @@ if {[build_executable $testfile.exp $testfile $srcfile = debug] =3D=3D -1} { =20 # Start with a fresh gdb. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 # Skip all tests if Guile scripting is not enabled. if { [skip_guile_tests] } { continue } diff --git a/gdb/testsuite/gdb.guile/scm-section-script.exp b/gdb/testsui= te/gdb.guile/scm-section-script.exp index 2198692eae8..ca6861cd792 100644 --- a/gdb/testsuite/gdb.guile/scm-section-script.exp +++ b/gdb/testsuite/gdb.guile/scm-section-script.exp @@ -73,9 +73,7 @@ gdb_test_multiple "info auto-load guile-scripts" "$test= _name" { =20 # Try again with a working safe-path. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 gdb_test_no_output "set auto-load safe-path ${remote_guile_file}:${binfi= le}" \ "set auto-load safe-path" diff --git a/gdb/testsuite/gdb.guile/scm-symbol.exp b/gdb/testsuite/gdb.g= uile/scm-symbol.exp index 486fc8fcfdb..afb44b32179 100644 --- a/gdb/testsuite/gdb.guile/scm-symbol.exp +++ b/gdb/testsuite/gdb.guile/scm-symbol.exp @@ -143,10 +143,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "= ${binfile}-cxx" executable " } =20 # Start with a fresh gdb. -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile}-cxx +clean_restart ${binfile}-cxx =20 if ![gdb_guile_runto_main] { return diff --git a/gdb/testsuite/gdb.guile/scm-type.exp b/gdb/testsuite/gdb.gui= le/scm-type.exp index 0f666a3046d..b4c354289a1 100644 --- a/gdb/testsuite/gdb.guile/scm-type.exp +++ b/gdb/testsuite/gdb.guile/scm-type.exp @@ -42,10 +42,7 @@ proc build_inferior {exefile lang} { proc restart_gdb {exefile} { global srcdir subdir =20 - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir - gdb_load ${exefile} + clean_restart ${exefile} =20 if { [skip_guile_tests] } { return 0 diff --git a/gdb/testsuite/gdb.objc/basicclass.exp b/gdb/testsuite/gdb.ob= jc/basicclass.exp index d17b21dc98d..c01bc53b8ee 100644 --- a/gdb/testsuite/gdb.objc/basicclass.exp +++ b/gdb/testsuite/gdb.objc/basicclass.exp @@ -78,10 +78,7 @@ proc do_objc_tests {} { =20 # Start with a fresh gdb. =20 - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir - gdb_load $binfile + clean_restart $binfile =20 deduce_language_of_main } diff --git a/gdb/testsuite/gdb.objc/nondebug.exp b/gdb/testsuite/gdb.objc= /nondebug.exp index 300075a9cc6..7f81c891abd 100644 --- a/gdb/testsuite/gdb.objc/nondebug.exp +++ b/gdb/testsuite/gdb.objc/nondebug.exp @@ -36,10 +36,7 @@ proc do_objc_tests {} { =20 # Start with a fresh gdb. =20 - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir - gdb_load $binfile + clean_restart $binfile =20 } =20 diff --git a/gdb/testsuite/gdb.objc/objcdecode.exp b/gdb/testsuite/gdb.ob= jc/objcdecode.exp index 8b80c4f2610..03b7b30f7cd 100644 --- a/gdb/testsuite/gdb.objc/objcdecode.exp +++ b/gdb/testsuite/gdb.objc/objcdecode.exp @@ -36,10 +36,7 @@ proc do_objc_tests {} { =20 # Start with a fresh gdb. =20 - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir - gdb_load $binfile + clean_restart $binfile =20 } =20 diff --git a/gdb/testsuite/gdb.objc/print.exp b/gdb/testsuite/gdb.objc/pr= int.exp index 99b26c7ef6a..c26258a101e 100644 --- a/gdb/testsuite/gdb.objc/print.exp +++ b/gdb/testsuite/gdb.objc/print.exp @@ -59,9 +59,7 @@ proc test_float_rejected {} { =20 # Start with a fresh gdb. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 if [set_lang_objc] { test_float_accepted diff --git a/gdb/testsuite/gdb.pascal/print.exp b/gdb/testsuite/gdb.pasca= l/print.exp index d9c15be730c..7f36968eac2 100644 --- a/gdb/testsuite/gdb.pascal/print.exp +++ b/gdb/testsuite/gdb.pascal/print.exp @@ -59,9 +59,7 @@ proc test_float_rejected {} { =20 # Start with a fresh gdb. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 if [set_lang_pascal] { test_float_accepted diff --git a/gdb/testsuite/gdb.pascal/types.exp b/gdb/testsuite/gdb.pasca= l/types.exp index 3c5a98cd0f4..e5909510ffd 100644 --- a/gdb/testsuite/gdb.pascal/types.exp +++ b/gdb/testsuite/gdb.pascal/types.exp @@ -70,9 +70,7 @@ proc test_float_literal_types_accepted {} { =20 # Start with a fresh gdb. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 if [set_lang_pascal] then { test_integer_literal_types_accepted diff --git a/gdb/testsuite/gdb.perf/disassemble.exp b/gdb/testsuite/gdb.p= erf/disassemble.exp index 948602d3869..05930100951 100644 --- a/gdb/testsuite/gdb.perf/disassemble.exp +++ b/gdb/testsuite/gdb.perf/disassemble.exp @@ -34,9 +34,7 @@ PerfTest::assemble { global srcdir subdir global binfile =20 - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir + clean_restart =20 # When GDB is debugging GDB, the prompt is changed to "(top-gdb) ". # In order to avoid the confusion of pattern matching, set the diff --git a/gdb/testsuite/gdb.python/py-format-string.exp b/gdb/testsuit= e/gdb.python/py-format-string.exp index b7acc242ed3..cf92609cb53 100644 --- a/gdb/testsuite/gdb.python/py-format-string.exp +++ b/gdb/testsuite/gdb.python/py-format-string.exp @@ -45,10 +45,7 @@ proc build_inferior {exefile lang} { proc prepare_gdb {exefile} { global srcdir subdir srcfile testfile hex =20 - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir - gdb_load ${exefile} + clean_restart ${exefile} =20 if ![runto_main] then { perror "couldn't run to breakpoint" diff --git a/gdb/testsuite/gdb.python/py-function.exp b/gdb/testsuite/gdb= =2Epython/py-function.exp index d98f2ac210c..dd98b621c98 100644 --- a/gdb/testsuite/gdb.python/py-function.exp +++ b/gdb/testsuite/gdb.python/py-function.exp @@ -20,9 +20,7 @@ load_lib gdb-python.exp =20 # Start with a fresh gdb. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 # Skip all tests if Python scripting is not enabled. if { [skip_python_tests] } { continue } diff --git a/gdb/testsuite/gdb.python/py-lookup-type.exp b/gdb/testsuite/= gdb.python/py-lookup-type.exp index 361f8097ecd..53040be73e1 100644 --- a/gdb/testsuite/gdb.python/py-lookup-type.exp +++ b/gdb/testsuite/gdb.python/py-lookup-type.exp @@ -23,9 +23,7 @@ load_lib gdb-python.exp # created by each language since GDB. So, we must start GDB without # loading any symbol in. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 # Skip all tests if Python scripting is not enabled. if { [skip_python_tests] } { continue } diff --git a/gdb/testsuite/gdb.python/py-parameter.exp b/gdb/testsuite/gd= b.python/py-parameter.exp index 98434d4f455..859cceed8d5 100644 --- a/gdb/testsuite/gdb.python/py-parameter.exp +++ b/gdb/testsuite/gdb.python/py-parameter.exp @@ -19,9 +19,7 @@ load_lib gdb-python.exp =20 # Start with a fresh gdb. -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 # Skip all tests if Python scripting is not enabled. if { [skip_python_tests] } { continue } diff --git a/gdb/testsuite/gdb.python/py-prettyprint.exp b/gdb/testsuite/= gdb.python/py-prettyprint.exp index 65e8489bf87..f1c79f639f5 100644 --- a/gdb/testsuite/gdb.python/py-prettyprint.exp +++ b/gdb/testsuite/gdb.python/py-prettyprint.exp @@ -37,10 +37,7 @@ proc run_lang_tests {exefile lang} { set nl "\[\r\n\]+" =20 # Start with a fresh gdb. - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir - gdb_load ${exefile} + clean_restart ${exefile} =20 if ![runto_main ] then { perror "couldn't run to breakpoint" @@ -164,10 +161,7 @@ with_test_prefix c++ { # Run various other tests. =20 # Start with a fresh gdb. -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} =20 if ![runto_main ] then { perror "couldn't run to breakpoint" diff --git a/gdb/testsuite/gdb.python/py-progspace.exp b/gdb/testsuite/gd= b.python/py-progspace.exp index 54d010f0397..178c692fe08 100644 --- a/gdb/testsuite/gdb.python/py-progspace.exp +++ b/gdb/testsuite/gdb.python/py-progspace.exp @@ -26,9 +26,7 @@ if {[build_executable $testfile.exp $testfile $srcfile = debug] =3D=3D -1} { =20 # Start with a fresh gdb. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 # Skip all tests if Python scripting is not enabled. if { [skip_python_tests] } { continue } diff --git a/gdb/testsuite/gdb.python/py-prompt.exp b/gdb/testsuite/gdb.p= ython/py-prompt.exp index 34332770aa6..3d4eb6a0efa 100644 --- a/gdb/testsuite/gdb.python/py-prompt.exp +++ b/gdb/testsuite/gdb.python/py-prompt.exp @@ -23,9 +23,7 @@ load_lib prompt.exp =20 # Start with a fresh gdb. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 # Skip all tests if Python scripting is not enabled. if { [skip_python_tests] } { continue } diff --git a/gdb/testsuite/gdb.python/py-section-script.exp b/gdb/testsui= te/gdb.python/py-section-script.exp index f4106117a4e..eb1e78d9380 100644 --- a/gdb/testsuite/gdb.python/py-section-script.exp +++ b/gdb/testsuite/gdb.python/py-section-script.exp @@ -73,9 +73,7 @@ gdb_test_multiple "info auto-load python-scripts" "$tes= t_name" { =20 # Try again with a working safe-path. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 # Get the name of the binfile on the host; on a remote host this means # stripping off any directory prefix. diff --git a/gdb/testsuite/gdb.python/py-sync-interp.exp b/gdb/testsuite/= gdb.python/py-sync-interp.exp index aa73e1fc03b..432b35cae11 100644 --- a/gdb/testsuite/gdb.python/py-sync-interp.exp +++ b/gdb/testsuite/gdb.python/py-sync-interp.exp @@ -28,9 +28,7 @@ load_lib gdb-python.exp =20 # Start with a fresh gdb. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 # Skip all tests if Python scripting is not enabled. if { [skip_python_tests] } { continue } diff --git a/gdb/testsuite/gdb.python/py-template.exp b/gdb/testsuite/gdb= =2Epython/py-template.exp index b5dc044ed4d..4bf35eca9d1 100644 --- a/gdb/testsuite/gdb.python/py-template.exp +++ b/gdb/testsuite/gdb.python/py-template.exp @@ -27,9 +27,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${b= infile}" executable \ =20 # Start with a fresh gdb. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 # Skip all tests if Python scripting is not enabled. if { [skip_python_tests] } { continue } diff --git a/gdb/testsuite/gdb.python/py-type.exp b/gdb/testsuite/gdb.pyt= hon/py-type.exp index c01442c3887..1ac1ab84c2a 100644 --- a/gdb/testsuite/gdb.python/py-type.exp +++ b/gdb/testsuite/gdb.python/py-type.exp @@ -40,10 +40,7 @@ proc build_inferior {exefile lang} { proc restart_gdb {exefile} {=20 global srcdir subdir srcfile testfile hex =20 - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir - gdb_load ${exefile} + clean_restart ${exefile} =20 if ![runto_main ] then { perror "couldn't run to breakpoint" diff --git a/gdb/testsuite/gdb.python/python.exp b/gdb/testsuite/gdb.pyth= on/python.exp index 017f33afe52..fdc0311e5a8 100644 --- a/gdb/testsuite/gdb.python/python.exp +++ b/gdb/testsuite/gdb.python/python.exp @@ -26,9 +26,7 @@ if {[build_executable $testfile.exp $testfile \ } =20 # Start with a fresh gdb. -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 set remote_source2_py [gdb_remote_download host \ ${srcdir}/${subdir}/source2.py] diff --git a/gdb/testsuite/gdb.reverse/sigall-precsave.exp b/gdb/testsuit= e/gdb.reverse/sigall-precsave.exp index 5169a5f15dd..2e3d142bf33 100644 --- a/gdb/testsuite/gdb.reverse/sigall-precsave.exp +++ b/gdb/testsuite/gdb.reverse/sigall-precsave.exp @@ -23,9 +23,7 @@ if ![supports_reverse] { } =20 =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 standard_testfile sigall-reverse.c set precsave [standard_output_file sigall.precsave] diff --git a/gdb/testsuite/gdb.reverse/sigall-reverse.exp b/gdb/testsuite= /gdb.reverse/sigall-reverse.exp index 659cbc20a02..c7d2934f94c 100644 --- a/gdb/testsuite/gdb.reverse/sigall-reverse.exp +++ b/gdb/testsuite/gdb.reverse/sigall-reverse.exp @@ -23,9 +23,7 @@ if ![supports_reverse] { } =20 =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 standard_testfile =20 diff --git a/gdb/testsuite/gdb.server/solib-list.exp b/gdb/testsuite/gdb.= server/solib-list.exp index a326f940ad8..6ceb8c7fcbf 100644 --- a/gdb/testsuite/gdb.server/solib-list.exp +++ b/gdb/testsuite/gdb.server/solib-list.exp @@ -45,9 +45,7 @@ foreach nonstop { 0 1 } { with_test_prefix "non-stop $n= onstop" { =20 # clean_restart assumes ${objdir}/${subdir}/ which is not applicable= # for ${interp_system}. - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir + clean_restart gdb_load_shlib ${binlibfile} =20 set remote_binfile [gdb_remote_download target $binfile] diff --git a/gdb/testsuite/gdb.stabs/weird.exp b/gdb/testsuite/gdb.stabs/= weird.exp index 111b38446af..bde04c3136a 100644 --- a/gdb/testsuite/gdb.stabs/weird.exp +++ b/gdb/testsuite/gdb.stabs/weird.exp @@ -278,9 +278,7 @@ if { [gdb_compile "${srcfile}" "${binfile}" object "= "] !=3D "" } { remote_file build delete ${srcfile} =20 # Start with a fresh gdb -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 set binfile [gdb_remote_download host ${binfile} \ [standard_output_file object.o]] diff --git a/gdb/testsuite/gdb.threads/attach-stopped.exp b/gdb/testsuite= /gdb.threads/attach-stopped.exp index 324360973c3..2b62a287018 100644 --- a/gdb/testsuite/gdb.threads/attach-stopped.exp +++ b/gdb/testsuite/gdb.threads/attach-stopped.exp @@ -51,10 +51,7 @@ proc corefunc { threadtype } { remote_exec build "kill -s STOP ${testpid}" =20 # Start with clean gdb - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir - gdb_load ${binfile} + clean_restart ${binfile} =20 # Verify that we can attach to the stopped process. =20 diff --git a/gdb/testsuite/gdb.threads/fork-thread-pending.exp b/gdb/test= suite/gdb.threads/fork-thread-pending.exp index ab8cc7f83fa..00cfaad39a5 100644 --- a/gdb/testsuite/gdb.threads/fork-thread-pending.exp +++ b/gdb/testsuite/gdb.threads/fork-thread-pending.exp @@ -80,9 +80,7 @@ gdb_test_multiple "info threads" "$test" { =20 # Start over, but this time, don't switch away from the fork event threa= d. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 gdb_load ${binfile} if ![runto_main] then { diff --git a/gdb/testsuite/gdb.threads/schedlock.exp b/gdb/testsuite/gdb.= threads/schedlock.exp index 5daa857d564..5cf0caa3135 100644 --- a/gdb/testsuite/gdb.threads/schedlock.exp +++ b/gdb/testsuite/gdb.threads/schedlock.exp @@ -148,9 +148,7 @@ proc step_ten_loops { cmd } { =20 # Start with a fresh gdb. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 # We'll need this when we send_gdb a ^C to GDB. Need to do it before we= # run the program and gdb starts saving and restoring tty states. diff --git a/gdb/testsuite/gdb.threads/watchthreads.exp b/gdb/testsuite/g= db.threads/watchthreads.exp index 21a8adc51b2..54445d28969 100644 --- a/gdb/testsuite/gdb.threads/watchthreads.exp +++ b/gdb/testsuite/gdb.threads/watchthreads.exp @@ -33,10 +33,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfi= le}" "${binfile}" executab return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart ${binfile} =20 gdb_test_no_output "set can-use-hw-watchpoints 1" "" =20 diff --git a/gdb/testsuite/gdb.trace/actions.exp b/gdb/testsuite/gdb.trac= e/actions.exp index 912ca5b5871..90bed624ed4 100644 --- a/gdb/testsuite/gdb.trace/actions.exp +++ b/gdb/testsuite/gdb.trace/actions.exp @@ -329,9 +329,7 @@ gdb_test "tsave -ctf ${tracefile}.ctf" \ "save ctf trace file" =20 # Restart GDB and read the trace data in tfile target. -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart gdb_file_cmd $binfile gdb_test "target tfile ${tracefile}.tf" ".*" \ "change to tfile target" @@ -349,9 +347,7 @@ gdb_test_multiple "target ctf" "" { } =20 if { $gdb_can_read_ctf_data } { - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir + clean_restart gdb_file_cmd $binfile gdb_test "target ctf ${tracefile}.ctf" ".*" \ "change to ctf target" diff --git a/gdb/testsuite/gdb.trace/change-loc.exp b/gdb/testsuite/gdb.t= race/change-loc.exp index 8cb8cc66af8..e44ed63d611 100644 --- a/gdb/testsuite/gdb.trace/change-loc.exp +++ b/gdb/testsuite/gdb.trace/change-loc.exp @@ -186,9 +186,7 @@ proc tracepoint_change_loc_2 { trace_type } { global binfile global gdb_prompt =20 - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir + clean_restart =20 gdb_test_multiple "${trace_type} set_tracepoint" "set pending tracepoin= t" { -re ".*Make \(|fast \)tracepoint pending.*y or \\\[n\\\]. $" { diff --git a/gdb/testsuite/gdb.trace/entry-values.exp b/gdb/testsuite/gdb= =2Etrace/entry-values.exp index d03626a0e8a..b032d5338b0 100644 --- a/gdb/testsuite/gdb.trace/entry-values.exp +++ b/gdb/testsuite/gdb.trace/entry-values.exp @@ -35,10 +35,7 @@ if {[gdb_compile [list ${binfile}1.o] \ # instruction in bar returned from foo. It is needed in the Dwarf # Assembler. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile}1 +clean_restart ${binfile}1 =20 set returned_from_foo "" =20 diff --git a/gdb/testsuite/gdb.trace/pending.exp b/gdb/testsuite/gdb.trac= e/pending.exp index c817bafff30..7cbee47855b 100644 --- a/gdb/testsuite/gdb.trace/pending.exp +++ b/gdb/testsuite/gdb.trace/pending.exp @@ -72,9 +72,7 @@ proc pending_tracepoint_resolved { trace_type } { global lib_sl1 =20 # Start with a fresh gdb. - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir + clean_restart =20 gdb_test_multiple "$trace_type set_point1" "set pending tracepoint" { -re ".*Make \(fast |\)tracepoint pending.*y or \\\[n\\\]. $" { diff --git a/gdb/testsuite/gdb.trace/read-memory.exp b/gdb/testsuite/gdb.= trace/read-memory.exp index 8485a139741..9f1d9c561df 100644 --- a/gdb/testsuite/gdb.trace/read-memory.exp +++ b/gdb/testsuite/gdb.trace/read-memory.exp @@ -129,9 +129,7 @@ proc teset_from_exec { target } { global tracefile =20 # Restart GDB and read the trace data in ${target} target. - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir + clean_restart gdb_file_cmd $binfile =20 gdb_test "target ${target} ${tracefile}.${target}" ".*" \ diff --git a/gdb/testsuite/gdb.trace/unavailable.exp b/gdb/testsuite/gdb.= trace/unavailable.exp index 1ed24b2ed07..206a3c23539 100644 --- a/gdb/testsuite/gdb.trace/unavailable.exp +++ b/gdb/testsuite/gdb.trace/unavailable.exp @@ -202,9 +202,7 @@ proc gdb_collect_args_test {} { =20 foreach target_name ${trace_file_targets} { # Restart GDB and read the trace data in ${TARGET_NAME} target. - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir + clean_restart gdb_file_cmd $binfile gdb_test "target ${target_name} ${tracefile}.args.${target_name}" "= =2E*" \ "change to ${target_name} target" @@ -286,9 +284,7 @@ proc gdb_collect_locals_test { func msg } { =20 foreach target_name ${trace_file_targets} { # Restart GDB and read the trace data in ${TARGET_NAME} target. - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir + clean_restart gdb_file_cmd $binfile gdb_test "target ${target_name} ${tracefile}.locals.${target_name}"= ".*" \ "change to ${target_name} target" @@ -369,9 +365,7 @@ proc gdb_unavailable_registers_test { } { =20 foreach target_name ${trace_file_targets} { # Restart GDB and read the trace data in ${TARGET_NAME} target. - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir + clean_restart gdb_file_cmd $binfile gdb_test "target ${target_name} ${tracefile}.registers.${target_nam= e}" ".*" \ "change to ${target_name} target" @@ -433,9 +427,7 @@ proc gdb_unavailable_floats { } { =20 foreach target_name ${trace_file_targets} { # Restart GDB and read the trace data in ${TARGET_NAME} target. - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir + clean_restart gdb_file_cmd $binfile gdb_test "target ${target_name} ${tracefile}.floats.${target_name}"= ".*" \ "change to ${target_name} target" @@ -701,9 +693,7 @@ proc gdb_collect_globals_test { } { =20 foreach target_name ${trace_file_targets} { # Restart GDB and read the trace data in ${TARGET_NAME} target. - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir + clean_restart gdb_file_cmd $binfile gdb_test "target ${target_name} ${tracefile}.globals.${target_name}= " ".*" \ "change to ${target_name} target" diff --git a/gdb/testsuite/gdb.trace/while-stepping.exp b/gdb/testsuite/g= db.trace/while-stepping.exp index 89990d82cf5..7df2cc4a802 100644 --- a/gdb/testsuite/gdb.trace/while-stepping.exp +++ b/gdb/testsuite/gdb.trace/while-stepping.exp @@ -155,9 +155,7 @@ gdb_test "tsave -ctf ${tracefile}.ctf" \ "save ctf trace file" =20 # Restart GDB and read the trace data in tfile target. -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart gdb_file_cmd $binfile gdb_test "target tfile ${tracefile}.tf" ".*" \ "change to tfile target" @@ -175,9 +173,7 @@ gdb_test_multiple "target ctf" "" { } =20 if { $gdb_can_read_ctf_data } { - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir + clean_restart gdb_file_cmd $binfile gdb_test "target ctf ${tracefile}.ctf" ".*" \ "change to ctf target" diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 55154db6a50..10fbf37068c 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -2957,10 +2957,7 @@ gdb_caching_proc skip_altivec_tests { =20 # Compilation succeeded so now run it via gdb. =20 - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir - gdb_load "$obj" + clean_restart "$obj" gdb_run_cmd gdb_expect { -re ".*Illegal instruction.*${gdb_prompt} $" { @@ -3030,10 +3027,7 @@ gdb_caching_proc skip_vsx_tests { =20 # No error message, compilation succeeded so now run it via gdb. =20 - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir - gdb_load "$obj" + clean_restart "$obj" gdb_run_cmd gdb_expect { -re ".*Illegal instruction.*${gdb_prompt} $" { @@ -3079,10 +3073,7 @@ gdb_caching_proc skip_tsx_tests { =20 # No error message, compilation succeeded so now run it via gdb. =20 - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir - gdb_load "$obj" + clean_restart "$obj" gdb_run_cmd gdb_expect { -re ".*Illegal instruction.*${gdb_prompt} $" { @@ -3130,10 +3121,7 @@ gdb_caching_proc skip_avx512bf16_tests { =20 # No error message, compilation succeeded so now run it via gdb. =20 - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir - gdb_load "$obj" + clean_restart "$obj" gdb_run_cmd gdb_expect { -re ".*Illegal instruction.*${gdb_prompt} $" { @@ -3176,10 +3164,7 @@ gdb_caching_proc skip_btrace_tests { =20 # No error message, compilation succeeded so now run it via gdb. =20 - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir - gdb_load $obj + clean_restart $obj if ![runto_main] { return 1 } @@ -3227,10 +3212,7 @@ gdb_caching_proc skip_btrace_pt_tests { =20 # No error message, compilation succeeded so now run it via gdb. =20 - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir - gdb_load $obj + clean_restart $obj if ![runto_main] { return 1 } @@ -5900,10 +5882,7 @@ gdb_caching_proc gdb_skip_float_test { for {set i 0} {$i < 5} {incr i} { global gdb_prompt srcdir subdir =20 - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir - gdb_load "$exe" + clean_restart "$exe" =20 runto_main gdb_test "break *break_here" @@ -5994,10 +5973,7 @@ gdb_caching_proc gdb_has_argv0 { global srcdir subdir global gdb_prompt hex =20 - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir - gdb_load "$exe" + clean_restart "$exe" =20 # Set breakpoint on main. gdb_test_multiple "break -q main" "break -q main" { --------------94A3975E82F97CF9FB89F91C--