From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id 4D89E3858404; Fri, 27 Jan 2023 01:30:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4D89E3858404 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1674783057; bh=Lni/uvHiKzOWKc2UWun7hRAAYIL69QJQY+DuzB8YuwU=; h=From:To:Subject:Date:From; b=eM3o/Vg/xJVphzz0i72NeiJTyI3oiiuPUgkdvn7X9My0JNyUKBCIvgx0j7t6zNLvF 8OHpWRtPKKCDkXl4CjCYpVyJd8f6uHrLJ9AhBqbVsD+LkzHg1FZkCxO29l6p5/G20N NgNf6eIb5E//i+f8Kt0U+KpgESmFdvvZ1Ywz54ww= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Use clean_restart in gdb.python X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: e125b182783d729a9a29f6389a7661366a8dbd14 X-Git-Newrev: 9b2234b063eb8e08be1fccc7d830fb7065cd06ae Message-Id: <20230127013057.4D89E3858404@sourceware.org> Date: Fri, 27 Jan 2023 01:30:57 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D9b2234b063eb= 8e08be1fccc7d830fb7065cd06ae commit 9b2234b063eb8e08be1fccc7d830fb7065cd06ae Author: Tom Tromey Date: Wed Jan 25 14:48:55 2023 -0700 Use clean_restart in gdb.python =20 Change gdb.python to use clean_restart more consistently. Diff: --- gdb/testsuite/gdb.python/py-format-string.exp | 5 +---- gdb/testsuite/gdb.python/py-function.exp | 6 +----- gdb/testsuite/gdb.python/py-lookup-type.exp | 4 +--- gdb/testsuite/gdb.python/py-prettyprint.exp | 11 ++--------- gdb/testsuite/gdb.python/py-progspace.exp | 6 +----- gdb/testsuite/gdb.python/py-section-script.exp | 10 ++-------- gdb/testsuite/gdb.python/py-template.exp | 6 +----- gdb/testsuite/gdb.python/py-type.exp | 7 +------ gdb/testsuite/gdb.python/python.exp | 5 +---- 9 files changed, 11 insertions(+), 49 deletions(-) diff --git a/gdb/testsuite/gdb.python/py-format-string.exp b/gdb/testsuite/= gdb.python/py-format-string.exp index f343ce31a46..1d50f59dee3 100644 --- a/gdb/testsuite/gdb.python/py-format-string.exp +++ b/gdb/testsuite/gdb.python/py-format-string.exp @@ -47,10 +47,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]} { return diff --git a/gdb/testsuite/gdb.python/py-function.exp b/gdb/testsuite/gdb.p= ython/py-function.exp index 25b83a797aa..3a6e30259fd 100644 --- a/gdb/testsuite/gdb.python/py-function.exp +++ b/gdb/testsuite/gdb.python/py-function.exp @@ -20,11 +20,7 @@ load_lib gdb-python.exp =20 require allow_python_tests =20 -# Start with a fresh gdb. - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 gdb_test_multiline "input convenience function" \ "python" "" \ diff --git a/gdb/testsuite/gdb.python/py-lookup-type.exp b/gdb/testsuite/gd= b.python/py-lookup-type.exp index c914ea1068b..63f603cc009 100644 --- a/gdb/testsuite/gdb.python/py-lookup-type.exp +++ b/gdb/testsuite/gdb.python/py-lookup-type.exp @@ -25,9 +25,7 @@ require allow_python_tests # 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 proc test_lookup_type { lang type_name } { gdb_test_no_output "set language ${lang}" diff --git a/gdb/testsuite/gdb.python/py-prettyprint.exp b/gdb/testsuite/gd= b.python/py-prettyprint.exp index 674a4edd0d2..b7661ff14ed 100644 --- a/gdb/testsuite/gdb.python/py-prettyprint.exp +++ b/gdb/testsuite/gdb.python/py-prettyprint.exp @@ -36,10 +36,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]} { return @@ -190,11 +187,7 @@ with_test_prefix c++ { =20 # 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]} { return diff --git a/gdb/testsuite/gdb.python/py-progspace.exp b/gdb/testsuite/gdb.= python/py-progspace.exp index c7be9489601..638b27927c6 100644 --- a/gdb/testsuite/gdb.python/py-progspace.exp +++ b/gdb/testsuite/gdb.python/py-progspace.exp @@ -26,11 +26,7 @@ if {[build_executable $testfile.exp $testfile $srcfile d= ebug] =3D=3D -1} { return -1 } =20 -# Start with a fresh gdb. - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 gdb_test "python print (gdb.current_progspace().filename)" "None" \ "current progspace filename (None)" diff --git a/gdb/testsuite/gdb.python/py-section-script.exp b/gdb/testsuite= /gdb.python/py-section-script.exp index 24d207416af..fec7b007317 100644 --- a/gdb/testsuite/gdb.python/py-section-script.exp +++ b/gdb/testsuite/gdb.python/py-section-script.exp @@ -46,11 +46,7 @@ if {[build_executable $testfile.exp $testfile $srcfile \ return -1 } =20 -# Start with a fresh gdb. -gdb_exit -gdb_start - -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 # Try first with a restrictive safe-path. =20 @@ -71,9 +67,7 @@ gdb_test_multiple "info auto-load python-scripts" "$test_= 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-template.exp b/gdb/testsuite/gdb.p= ython/py-template.exp index a89a813578d..9bc392dcb8d 100644 --- a/gdb/testsuite/gdb.python/py-template.exp +++ b/gdb/testsuite/gdb.python/py-template.exp @@ -25,11 +25,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${bi= nfile}" executable \ return -1 } =20 -# Start with a fresh gdb. - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 proc test_template_arg {exefile type} { global testfile srcdir subdir srcfile diff --git a/gdb/testsuite/gdb.python/py-type.exp b/gdb/testsuite/gdb.pytho= n/py-type.exp index e7837d7405f..c245d41a1ac 100644 --- a/gdb/testsuite/gdb.python/py-type.exp +++ b/gdb/testsuite/gdb.python/py-type.exp @@ -34,12 +34,7 @@ proc build_inferior {exefile lang} { =20 # Restart GDB. proc restart_gdb {exefile} {=20 - global srcdir subdir srcfile testfile hex - - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir - gdb_load ${exefile} + clean_restart $exefile =20 if {![runto_main]} { return diff --git a/gdb/testsuite/gdb.python/python.exp b/gdb/testsuite/gdb.python= /python.exp index b8a4718ef6c..8fe119fead1 100644 --- a/gdb/testsuite/gdb.python/python.exp +++ b/gdb/testsuite/gdb.python/python.exp @@ -25,10 +25,7 @@ if {[build_executable $testfile.exp $testfile \ return -1 } =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]