aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/testsuite/gdb.python/py-format-string.exp5
-rw-r--r--gdb/testsuite/gdb.python/py-function.exp6
-rw-r--r--gdb/testsuite/gdb.python/py-lookup-type.exp4
-rw-r--r--gdb/testsuite/gdb.python/py-prettyprint.exp11
-rw-r--r--gdb/testsuite/gdb.python/py-progspace.exp6
-rw-r--r--gdb/testsuite/gdb.python/py-section-script.exp10
-rw-r--r--gdb/testsuite/gdb.python/py-template.exp6
-rw-r--r--gdb/testsuite/gdb.python/py-type.exp7
-rw-r--r--gdb/testsuite/gdb.python/python.exp5
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 f343ce3..1d50f59 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
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_load ${exefile}
+ clean_restart $exefile
if {![runto_main]} {
return
diff --git a/gdb/testsuite/gdb.python/py-function.exp b/gdb/testsuite/gdb.python/py-function.exp
index 25b83a7..3a6e302 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
require allow_python_tests
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
+clean_restart
gdb_test_multiline "input convenience function" \
"python" "" \
diff --git a/gdb/testsuite/gdb.python/py-lookup-type.exp b/gdb/testsuite/gdb.python/py-lookup-type.exp
index c914ea1..63f603c 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.
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
+clean_restart
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/gdb.python/py-prettyprint.exp
index 674a4ed..b7661ff 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\]+"
# Start with a fresh gdb.
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_load ${exefile}
+ clean_restart $exefile
if {![runto_main]} {
return
@@ -190,11 +187,7 @@ with_test_prefix c++ {
# Run various other tests.
-# Start with a fresh gdb.
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart $binfile
if {![runto_main]} {
return
diff --git a/gdb/testsuite/gdb.python/py-progspace.exp b/gdb/testsuite/gdb.python/py-progspace.exp
index c7be948..638b279 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 debug] == -1} {
return -1
}
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
+clean_restart
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 24d2074..fec7b00 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
}
-# Start with a fresh gdb.
-gdb_exit
-gdb_start
-
-gdb_reinitialize_dir $srcdir/$subdir
+clean_restart
# Try first with a restrictive safe-path.
@@ -71,9 +67,7 @@ gdb_test_multiple "info auto-load python-scripts" "$test_name" {
# Try again with a working safe-path.
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
+clean_restart
# 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.python/py-template.exp
index a89a813..9bc392d 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}" "${binfile}" executable \
return -1
}
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
+clean_restart
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.python/py-type.exp
index e7837d7..c245d41 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} {
# Restart GDB.
proc restart_gdb {exefile} {
- global srcdir subdir srcfile testfile hex
-
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_load ${exefile}
+ clean_restart $exefile
if {![runto_main]} {
return
diff --git a/gdb/testsuite/gdb.python/python.exp b/gdb/testsuite/gdb.python/python.exp
index b8a4718..8fe119f 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
}
-# Start with a fresh gdb.
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
+clean_restart
set remote_source2_py [gdb_remote_download host \
${srcdir}/${subdir}/source2.py]