Change gdb.guile to use clean_restart more consistently.
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.
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
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.
${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}
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
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
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
# 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
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
return
}
-# Start with a fresh gdb.
-gdb_exit
-gdb_start
-
-gdb_reinitialize_dir $srcdir/$subdir
+clean_restart
# Try first with a restrictive safe-path.
# 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"
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
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