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

gdb/testsuite/gdb.threads/attach-stopped.exp
gdb/testsuite/gdb.threads/fork-thread-pending.exp
gdb/testsuite/gdb.threads/schedlock.exp
gdb/testsuite/gdb.threads/watchthreads.exp

index a3080c054af20f00ce5fffe7b60c49b43f4413a1..acdfcb5d8c5e676ecf16c0511c5057cdb33f653f 100644 (file)
@@ -32,11 +32,8 @@ remote_exec build "rm -f ${binfile}"
 #log_user 1
 
 proc corefunc { threadtype } {
-    global srcfile
     global binfile
     global escapedbinfile
-    global srcdir
-    global subdir
     global gdb_prompt
 
     set test_spawn_id [spawn_wait_for_attach $binfile]
@@ -45,11 +42,7 @@ proc corefunc { threadtype } {
     # Stop the program 
     remote_exec build "kill -s STOP ${testpid}"
 
-    # Start with clean gdb
-    gdb_exit
-    gdb_start
-    gdb_reinitialize_dir $srcdir/$subdir
-    gdb_load ${binfile}
+    clean_restart $binfile
 
     # Verify that we can attach to the stopped process.
        
index db72fb2679bd90221e2a2243911adadee95e4df2..3ab2d31402c44d04563574e410c2e683a4ee1449 100644 (file)
@@ -79,11 +79,7 @@ gdb_test_multiple "info threads" "$test" {
 
 # Start over, but this time, don't switch away from the fork event thread.
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-
-gdb_load ${binfile}
+clean_restart $binfile
 if {![runto_main]} {
    return 0
 }
index fa095508fb9743db5e094b080483d20ee2d19ad6..08435015f14297b46a79eaf3bd4527486faa1bdb 100644 (file)
@@ -146,11 +146,7 @@ proc step_ten_loops { cmd } {
     }
 }
 
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
+clean_restart
 
 # We'll need this when we send_gdb a ^C to GDB.  Need to do it before we
 # run the program and gdb starts saving and restoring tty states.
index 1aa7957c867fe4cbd4618fa0aeea494d9ddb16e7..e80c60b8167fd71aa5f15419fcf4b3a9bc40de55 100644 (file)
@@ -31,11 +31,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab
     return -1
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
+clean_restart $binfile
 gdb_test_no_output "set can-use-hw-watchpoints 1" ""
 
 #