Comments
Patch
@@ -47,7 +47,7 @@ if [get_compiler_info] {
# This is a test of the error cases for gdb's ability to attach to a running process.
-proc do_attach_failure_tests {} {
+proc_with_prefix do_attach_failure_tests {} {
global gdb_prompt
global binfile
global escapedbinfile
@@ -56,8 +56,8 @@ proc do_attach_failure_tests {} {
global subdir
global timeout
global decimal
-
- gdb_load ${binfile}
+
+ clean_restart $binfile
# Figure out a regular expression that will match the sysroot,
# noting that the default sysroot is "target:", and also noting
@@ -198,7 +198,7 @@ proc do_attach_failure_tests {} {
# This is a test of gdb's ability to attach to a running process.
-proc do_attach_tests {} {
+proc_with_prefix do_attach_tests {} {
global gdb_prompt
global binfile
global escapedbinfile
@@ -208,7 +208,7 @@ proc do_attach_tests {} {
global timeout
global decimal
- gdb_load ${binfile}
+ clean_restart $binfile
# Figure out a regular expression that will match the sysroot,
# noting that the default sysroot is "target:", and also noting
@@ -387,10 +387,12 @@ proc do_attach_tests {} {
# Test attaching when the target is inside a system call
-proc do_call_attach_tests {} {
+proc_with_prefix do_call_attach_tests {} {
global gdb_prompt
global binfile2
-
+
+ clean_restart
+
set test_spawn_id [spawn_wait_for_attach $binfile2]
set testpid [spawn_id_get_pid $test_spawn_id]
@@ -432,7 +434,7 @@ proc do_call_attach_tests {} {
kill_wait_spawned_process $test_spawn_id
}
-proc do_command_attach_tests {} {
+proc_with_prefix do_command_attach_tests {} {
global gdb_prompt
global binfile
global verbose
@@ -509,14 +511,9 @@ proc test_command_line_attach_run {} {
}
}
-foreach_with_prefix test { "do_attach_tests"
- "do_attach_failure_tests"
- "do_call_attach_tests" } {
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
- $test
-}
+do_attach_tests
+do_attach_failure_tests
+do_call_attach_tests
# Test "gdb --pid"