Fix clean_restart <absolute filename> in the test-cases in gdb.multi.
Tested on x86_64-linux.
"${::GDBFLAGS} -ex \"set remote multiprocess-feature-packet off\""
set ::GDBFLAGS \
"${::GDBFLAGS} -ex \"maint set target-non-stop ${target_non_stop}\""
- clean_restart ${binfile}
+ clean_restart ${::testfile}
}
# Start the first inferior.
proc do_test {} {
save_vars { ::GDBFLAGS } {
append ::GDBFLAGS " -ex \"maint set target-non-stop on\""
- clean_restart $::binfile
+ clean_restart $::testfile
}
gdb_test -no-prompt-anchor "run &"
set inferiors {1 2}
# Start all the inferiors.
-clean_restart $binfile
+clean_restart $::testfile
foreach_with_prefix inf $inferiors {
if { $inf > 1 } {
gdb_test "add-inferior -exec $binfile" "Added inferior 2.*" \
}
set srcfile1 ${srcfile}
-set binfile1 ${binfile}-1
-set binfile2 ${binfile}-2
+set testfile1 $testfile-1
+set testfile2 $testfile-2
+set binfile1 [standard_output_file $testfile1]
+set binfile2 [standard_output_file $testfile2]
if {[build_executable ${testfile}.exp ${binfile1} "${srcfile1}"] != 0} {
return -1
}
# Start the first inferior.
-clean_restart ${binfile1}
+clean_restart $testfile1
if {![runto_main]} {
return
}
# Hence, go with the all-stop-on-top-of-non-stop mode.
save_vars { GDBFLAGS } {
append GDBFLAGS " -ex \"maint set target-non-stop on\""
- clean_restart ${binfile}
+ clean_restart ${::testfile}
}
# Start inferior NUM.
# Hence, go with the all-stop-on-top-of-non-stop mode.
save_vars { GDBFLAGS } {
append GDBFLAGS " -ex \"maint set target-non-stop on\""
- clean_restart ${binfile}
+ clean_restart ${::testfile}
}
# Wrap the entire test in a namespace to avoid contaminating other tests.
# Build two executables, with different symbols.
-set exec1 "multi-re-run-1"
+set testfile1 "multi-re-run-1"
set srcfile1 multi-re-run-1.c
-set binfile1 [standard_output_file ${exec1}]
+set binfile1 [standard_output_file $testfile1]
-set exec2 "multi-re-run-2"
+set testfile2 "multi-re-run-2"
set srcfile2 multi-re-run-2.c
-set binfile2 [standard_output_file ${exec2}]
+set binfile2 [standard_output_file $testfile2]
with_test_prefix "exec1" {
- if { [build_executable "failed to prepare" ${exec1} "${srcfile1}" \
+ if { [build_executable "failed to prepare" $testfile1 $srcfile1 \
[list pthreads debug]] } {
return -1
}
}
with_test_prefix "exec2" {
- if { [build_executable "failed to prepare" ${exec2} "${srcfile2}" \
+ if { [build_executable "failed to prepare" $testfile2 $srcfile2 \
[list pthreads debug]] } {
return -1
}
global gdb_prompt
global last_loaded_file
- clean_restart ${binfile1}
+ clean_restart $::testfile1
delete_breakpoints
global gcorefile gcore_created
global binfile
- clean_restart ${binfile}
+ clean_restart ${::testfile}
if ![runto all_started] then {
return -1
# Make GDB read files from the local file system, not through the
# remote targets, to speed things up.
set ::GDBFLAGS "${::GDBFLAGS} -ex \"set sysroot\""
- clean_restart ${binfile}
+ clean_restart ${::testfile}
}
# multi-target depends on target running in non-stop mode. Force
return 0
}
- if { [prepare_for_testing "failed to prepare" ${binfile} "${srcfile}" \
+ if { [prepare_for_testing "failed to prepare" $::testfile $srcfile \
{debug pthreads}] } {
return 0
}
global gdb_spawn_id
global decimal
- clean_restart $binfile
+ clean_restart $::testfile
with_test_prefix "inf1" {
set inf1_spawn_id [create_inferior 1 $inf1_how]
#
# Return true after a successful setup, otherwise, return false.
proc test_setup {} {
- clean_restart $::binfile
+ clean_restart $::testfile
if {![runto_main]} {
return 0
# 'breakpoint pending' flag is enabled, so pending breakpoints can be created
# without GDB prompting the user.
proc do_test_setup { inf_1_stop inf_2_stop } {
- clean_restart ${::binfile}
+ clean_restart ${::testfile}
gdb_locate_shlib $::binfile_lib
proc test_remove_inferiors { } {
global binfile
- clean_restart ${binfile}
+ clean_restart ${::testfile}
# Add another inferior and switch to it.
add_inferior 2 "add second inferior"
# So, start GDB with this setting.
save_vars { GDBFLAGS } {
append GDBFLAGS " -ex \"maint set target-non-stop on\""
- clean_restart ${binfile}
+ clean_restart ${::testfile}
}
# Add and start the second inferior.
require !use_gdb_stub
set srcfile_other ${srcfile2}
-set binfile_other ${binfile}-other
+set testfile_other $testfile-other
+set binfile_other [standard_output_file $testfile_other]
if { [build_executable ${testfile}.exp ${binfile} "${srcfile}" {debug}] != 0 } {
return -1
append ::GDBFLAGS " -ex \"maintenance set target-non-stop on\""
}
- clean_restart ${::binfile_other}
+ clean_restart $::testfile_other
}
gdb_test -no-prompt-anchor "run&" "Starting program: .*" "start background inferior"
proc do_test {dispose} {
global binfile bkptno_numopt_re
- clean_restart $binfile
+ clean_restart $::testfile
gdb_test_no_output "set follow-fork child"
gdb_test_no_output "set detach-on-fork off"