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