aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-01-25 10:39:53 -0700
committerTom Tromey <tom@tromey.com>2023-01-26 18:28:31 -0700
commit888438e2b4146f9b1021ea240f78f04975a9d925 (patch)
treec0c11231616b7f8c80a7187dd03d62e9d7992537 /gdb/testsuite
parenta30f2b7b7e689b3f1bd93c29a1e00c8d852145d3 (diff)
downloadgdb-888438e2b4146f9b1021ea240f78f04975a9d925.zip
gdb-888438e2b4146f9b1021ea240f78f04975a9d925.tar.gz
gdb-888438e2b4146f9b1021ea240f78f04975a9d925.tar.bz2
Use clean_restart in gdb.guile
Change gdb.guile to use clean_restart more consistently.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/gdb.guile/guile.exp5
-rw-r--r--gdb/testsuite/gdb.guile/scm-gsmob.exp6
-rw-r--r--gdb/testsuite/gdb.guile/scm-objfile-script.exp6
-rw-r--r--gdb/testsuite/gdb.guile/scm-parameter.exp5
-rw-r--r--gdb/testsuite/gdb.guile/scm-pretty-print.exp15
-rw-r--r--gdb/testsuite/gdb.guile/scm-progspace.exp6
-rw-r--r--gdb/testsuite/gdb.guile/scm-section-script.exp10
-rw-r--r--gdb/testsuite/gdb.guile/scm-symbol.exp6
-rw-r--r--gdb/testsuite/gdb.guile/scm-type.exp5
9 files changed, 11 insertions, 53 deletions
diff --git a/gdb/testsuite/gdb.guile/guile.exp b/gdb/testsuite/gdb.guile/guile.exp
index 7c7dd3a..4db2f7c 100644
--- a/gdb/testsuite/gdb.guile/guile.exp
+++ b/gdb/testsuite/gdb.guile/guile.exp
@@ -18,10 +18,7 @@
load_lib gdb-guile.exp
-# Start with a fresh gdb.
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
+clean_restart
# 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-gsmob.exp b/gdb/testsuite/gdb.guile/scm-gsmob.exp
index a7c95c0..726c97c 100644
--- a/gdb/testsuite/gdb.guile/scm-gsmob.exp
+++ b/gdb/testsuite/gdb.guile/scm-gsmob.exp
@@ -20,11 +20,7 @@ load_lib gdb-guile.exp
require allow_guile_tests
-# Start with a fresh gdb.
-gdb_exit
-gdb_start
-
-gdb_reinitialize_dir $srcdir/$subdir
+clean_restart
gdb_install_guile_utils
gdb_install_guile_module
diff --git a/gdb/testsuite/gdb.guile/scm-objfile-script.exp b/gdb/testsuite/gdb.guile/scm-objfile-script.exp
index 5b480d1..6a935d7 100644
--- a/gdb/testsuite/gdb.guile/scm-objfile-script.exp
+++ b/gdb/testsuite/gdb.guile/scm-objfile-script.exp
@@ -26,10 +26,6 @@ if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} {
return
}
-# Start with a fresh gdb.
-gdb_exit
-gdb_start
-
# Make the -gdb.scm script available to gdb, it is automagically loaded by gdb.
# Care is taken to put it in the same directory as the binary so that
# gdb will find it.
@@ -37,7 +33,7 @@ set remote_guile_file [remote_download host \
${srcdir}/${subdir}/${testfile}-gdb.in \
[standard_output_file ${testfile}-gdb.scm]]
-gdb_reinitialize_dir $srcdir/$subdir
+clean_restart
gdb_test_no_output "set auto-load safe-path ${remote_guile_file}" \
"set auto-load safe-path"
gdb_load ${binfile}
diff --git a/gdb/testsuite/gdb.guile/scm-parameter.exp b/gdb/testsuite/gdb.guile/scm-parameter.exp
index 9ee50d1..2e9d9ed 100644
--- a/gdb/testsuite/gdb.guile/scm-parameter.exp
+++ b/gdb/testsuite/gdb.guile/scm-parameter.exp
@@ -20,10 +20,7 @@ load_lib gdb-guile.exp
require allow_guile_tests
-# Start with a fresh gdb.
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
+clean_restart
gdb_install_guile_utils
gdb_install_guile_module
diff --git a/gdb/testsuite/gdb.guile/scm-pretty-print.exp b/gdb/testsuite/gdb.guile/scm-pretty-print.exp
index 3c20edf..41c840b 100644
--- a/gdb/testsuite/gdb.guile/scm-pretty-print.exp
+++ b/gdb/testsuite/gdb.guile/scm-pretty-print.exp
@@ -22,10 +22,6 @@ require allow_guile_tests
standard_testfile
-# Start with a fresh gdb.
-gdb_exit
-gdb_start
-
proc run_lang_tests {exefile lang} {
with_test_prefix "lang=$lang" {
global srcdir subdir srcfile testfile hex
@@ -37,10 +33,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 ![gdb_guile_runto_main] {
return
@@ -121,11 +114,7 @@ run_lang_tests "${binfile}-cxx" "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 ![gdb_guile_runto_main] {
return
diff --git a/gdb/testsuite/gdb.guile/scm-progspace.exp b/gdb/testsuite/gdb.guile/scm-progspace.exp
index c12a81e..0007f37 100644
--- a/gdb/testsuite/gdb.guile/scm-progspace.exp
+++ b/gdb/testsuite/gdb.guile/scm-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_install_guile_utils
gdb_install_guile_module
diff --git a/gdb/testsuite/gdb.guile/scm-section-script.exp b/gdb/testsuite/gdb.guile/scm-section-script.exp
index 9e52939..ae0e484 100644
--- a/gdb/testsuite/gdb.guile/scm-section-script.exp
+++ b/gdb/testsuite/gdb.guile/scm-section-script.exp
@@ -46,11 +46,7 @@ if {[build_executable $testfile.exp $testfile $srcfile \
return
}
-# 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 guile-scripts" "$test_name" {
# Try again with a working safe-path.
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
+clean_restart
gdb_test_no_output "set auto-load safe-path ${remote_guile_file}:${binfile}" \
"set auto-load safe-path"
diff --git a/gdb/testsuite/gdb.guile/scm-symbol.exp b/gdb/testsuite/gdb.guile/scm-symbol.exp
index fa2cf77..5680a7f 100644
--- a/gdb/testsuite/gdb.guile/scm-symbol.exp
+++ b/gdb/testsuite/gdb.guile/scm-symbol.exp
@@ -141,11 +141,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}-cxx" executable "
return -1
}
-# Start with a fresh gdb.
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}-cxx
+clean_restart ${binfile}-cxx
if ![gdb_guile_runto_main] {
return
diff --git a/gdb/testsuite/gdb.guile/scm-type.exp b/gdb/testsuite/gdb.guile/scm-type.exp
index 45139cb..a5eec3a 100644
--- a/gdb/testsuite/gdb.guile/scm-type.exp
+++ b/gdb/testsuite/gdb.guile/scm-type.exp
@@ -38,10 +38,7 @@ proc build_inferior {exefile lang} {
proc restart_gdb {exefile} {
global srcdir subdir
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_load ${exefile}
+ clean_restart $exefile
if { ![allow_guile_tests] } {
return 0