]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Use clean_restart in gdb.objc
authorTom Tromey <tom@tromey.com>
Wed, 25 Jan 2023 17:31:34 +0000 (10:31 -0700)
committerTom Tromey <tom@tromey.com>
Fri, 27 Jan 2023 01:28:31 +0000 (18:28 -0700)
Change gdb.objc to use clean_restart more consistently.

gdb/testsuite/gdb.objc/basicclass.exp
gdb/testsuite/gdb.objc/nondebug.exp
gdb/testsuite/gdb.objc/objcdecode.exp
gdb/testsuite/gdb.objc/print.exp

index c09d852f0064074945fce8df6e850c850360645a..05432a18a39c1027422537f66a198ae83d654292 100644 (file)
@@ -70,18 +70,9 @@ proc deduce_language_of_main {} {
 }
 
 proc do_objc_tests {} {
-    global subdir
-    global srcdir
     global binfile
-    global gdb_prompt
-
-
-    # Start with a fresh gdb.
 
-    gdb_exit
-    gdb_start
-    gdb_reinitialize_dir $srcdir/$subdir
-    gdb_load $binfile
+    clean_restart $binfile
 
     deduce_language_of_main
 }
index d08c3d4b24472d56acffbfb3298d4d9d48dec73c..c1ab4f62d02c0f8c12a1ace9eddd94abf6d94838 100644 (file)
@@ -28,19 +28,8 @@ if {[gdb_compile_objc "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [
 }
 
 proc do_objc_tests {} {
-    global subdir
-    global srcdir
     global binfile
-    global gdb_prompt
-
-
-    # Start with a fresh gdb.
-
-    gdb_exit
-    gdb_start
-    gdb_reinitialize_dir $srcdir/$subdir
-    gdb_load $binfile
-
+    clean_restart $binfile
 }
 
 do_objc_tests
index 6a713ad34508c1907888313d7ba8af5b313dd46a..abed6709aef261a51fffe3f80089540859af26f2 100644 (file)
@@ -28,19 +28,8 @@ if {[gdb_compile_objc "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [
 }
 
 proc do_objc_tests {} {
-    global subdir
-    global srcdir
     global binfile
-    global gdb_prompt
-
-
-    # Start with a fresh gdb.
-
-    gdb_exit
-    gdb_start
-    gdb_reinitialize_dir $srcdir/$subdir
-    gdb_load $binfile
-
+    clean_restart $binfile
 }
 
 do_objc_tests
index 8dc83780b500447eb9e1c971f9471b5e9816a318..c311853c1e804a883145b3b88f657c5447305d20 100644 (file)
@@ -57,11 +57,7 @@ proc test_float_rejected {} {
     test_print_reject "p 1.1ll"
 }
 
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
+clean_restart
 
 if [set_lang_objc] {
     test_float_accepted