Change gdb.python to use clean_restart more consistently.
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
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" "" \
# 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}"
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
# 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
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)"
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.
# 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.
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
# 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
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]