From: Tom de Vries Date: Wed, 3 Sep 2025 12:52:17 +0000 (+0200) Subject: [gdb/testsuite] Fix clean_restart in gdb.multi X-Git-Tag: gdb-17-branchpoint~64 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=37e91976250feff58468e893715f8698d87a4143;p=thirdparty%2Fbinutils-gdb.git [gdb/testsuite] Fix clean_restart in gdb.multi Fix clean_restart in the test-cases in gdb.multi. Tested on x86_64-linux. --- diff --git a/gdb/testsuite/gdb.multi/attach-no-multi-process.exp b/gdb/testsuite/gdb.multi/attach-no-multi-process.exp index 502f30940cc..2813fa9c1aa 100644 --- a/gdb/testsuite/gdb.multi/attach-no-multi-process.exp +++ b/gdb/testsuite/gdb.multi/attach-no-multi-process.exp @@ -44,7 +44,7 @@ proc test {target_non_stop} { "${::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. diff --git a/gdb/testsuite/gdb.multi/attach-while-running.exp b/gdb/testsuite/gdb.multi/attach-while-running.exp index 723ebb2e4ee..4eb500e3d34 100644 --- a/gdb/testsuite/gdb.multi/attach-while-running.exp +++ b/gdb/testsuite/gdb.multi/attach-while-running.exp @@ -46,7 +46,7 @@ if { [build_executable "failed to prepare" ${testfile} ${srcfile}] } { 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 &" diff --git a/gdb/testsuite/gdb.multi/gdb-settings.exp b/gdb/testsuite/gdb.multi/gdb-settings.exp index b1acca00573..368eddecb7c 100644 --- a/gdb/testsuite/gdb.multi/gdb-settings.exp +++ b/gdb/testsuite/gdb.multi/gdb-settings.exp @@ -44,7 +44,7 @@ set run [expr {![use_gdb_stub]}] 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.*" \ diff --git a/gdb/testsuite/gdb.multi/inferior-specific-bp.exp b/gdb/testsuite/gdb.multi/inferior-specific-bp.exp index db090952ddf..6d2fc9e04f3 100644 --- a/gdb/testsuite/gdb.multi/inferior-specific-bp.exp +++ b/gdb/testsuite/gdb.multi/inferior-specific-bp.exp @@ -22,8 +22,10 @@ if {[use_gdb_stub]} { } 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 @@ -34,7 +36,7 @@ if {[build_executable ${testfile}.exp ${binfile2} "${srcfile2}"] != 0} { } # Start the first inferior. -clean_restart ${binfile1} +clean_restart $testfile1 if {![runto_main]} { return } diff --git a/gdb/testsuite/gdb.multi/multi-exit.exp b/gdb/testsuite/gdb.multi/multi-exit.exp index 8393067e532..fcd7cd2f8c9 100644 --- a/gdb/testsuite/gdb.multi/multi-exit.exp +++ b/gdb/testsuite/gdb.multi/multi-exit.exp @@ -36,7 +36,7 @@ if {[build_executable "failed to prepare" $testfile $srcfile]} { # 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. diff --git a/gdb/testsuite/gdb.multi/multi-kill.exp b/gdb/testsuite/gdb.multi/multi-kill.exp index 7d66ab0152a..1473372da75 100644 --- a/gdb/testsuite/gdb.multi/multi-kill.exp +++ b/gdb/testsuite/gdb.multi/multi-kill.exp @@ -36,7 +36,7 @@ if {[build_executable "failed to prepare" $testfile $srcfile {debug}]} { # 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. diff --git a/gdb/testsuite/gdb.multi/multi-re-run.exp b/gdb/testsuite/gdb.multi/multi-re-run.exp index 4caadeafde5..89d43a4b0d9 100644 --- a/gdb/testsuite/gdb.multi/multi-re-run.exp +++ b/gdb/testsuite/gdb.multi/multi-re-run.exp @@ -24,23 +24,23 @@ require allow_multi_inferior_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 } @@ -55,7 +55,7 @@ proc test_re_run {re_run_inf} { global gdb_prompt global last_loaded_file - clean_restart ${binfile1} + clean_restart $::testfile1 delete_breakpoints diff --git a/gdb/testsuite/gdb.multi/multi-target.exp.tcl b/gdb/testsuite/gdb.multi/multi-target.exp.tcl index dc88ca4b2e6..d90dc7edaa0 100644 --- a/gdb/testsuite/gdb.multi/multi-target.exp.tcl +++ b/gdb/testsuite/gdb.multi/multi-target.exp.tcl @@ -65,7 +65,7 @@ proc prepare_core {} { global gcorefile gcore_created global binfile - clean_restart ${binfile} + clean_restart ${::testfile} if ![runto all_started] then { return -1 @@ -114,7 +114,7 @@ proc setup {non-stop {multi_process ""}} { # 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 @@ -184,7 +184,7 @@ proc multi_target_prepare {} { return 0 } - if { [prepare_for_testing "failed to prepare" ${binfile} "${srcfile}" \ + if { [prepare_for_testing "failed to prepare" $::testfile $srcfile \ {debug pthreads}] } { return 0 } diff --git a/gdb/testsuite/gdb.multi/multi-term-settings.exp b/gdb/testsuite/gdb.multi/multi-term-settings.exp index 38322be5c44..8618f1a279a 100644 --- a/gdb/testsuite/gdb.multi/multi-term-settings.exp +++ b/gdb/testsuite/gdb.multi/multi-term-settings.exp @@ -138,7 +138,7 @@ proc coretest {inf1_how inf2_how} { 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] diff --git a/gdb/testsuite/gdb.multi/pending-bp-del-inferior.exp b/gdb/testsuite/gdb.multi/pending-bp-del-inferior.exp index a7055d7ed8c..781937d2127 100644 --- a/gdb/testsuite/gdb.multi/pending-bp-del-inferior.exp +++ b/gdb/testsuite/gdb.multi/pending-bp-del-inferior.exp @@ -37,7 +37,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} { # # Return true after a successful setup, otherwise, return false. proc test_setup {} { - clean_restart $::binfile + clean_restart $::testfile if {![runto_main]} { return 0 diff --git a/gdb/testsuite/gdb.multi/pending-bp.exp b/gdb/testsuite/gdb.multi/pending-bp.exp index 2458cd798c7..30a75b9d3bf 100644 --- a/gdb/testsuite/gdb.multi/pending-bp.exp +++ b/gdb/testsuite/gdb.multi/pending-bp.exp @@ -45,7 +45,7 @@ if { [build_executable "failed to prepare" $testfile $srcfile \ # '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 diff --git a/gdb/testsuite/gdb.multi/remove-inferiors.exp b/gdb/testsuite/gdb.multi/remove-inferiors.exp index 586d958d885..52e6cb060a6 100644 --- a/gdb/testsuite/gdb.multi/remove-inferiors.exp +++ b/gdb/testsuite/gdb.multi/remove-inferiors.exp @@ -32,7 +32,7 @@ proc add_inferior { expected_num message } { 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" diff --git a/gdb/testsuite/gdb.multi/run-only-second-inf.exp b/gdb/testsuite/gdb.multi/run-only-second-inf.exp index 7b6532cabf0..3645962a4a9 100644 --- a/gdb/testsuite/gdb.multi/run-only-second-inf.exp +++ b/gdb/testsuite/gdb.multi/run-only-second-inf.exp @@ -31,7 +31,7 @@ if {[build_executable "failed to prepare" $testfile $srcfile {debug}]} { # 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. diff --git a/gdb/testsuite/gdb.multi/start-inferior-specific.exp b/gdb/testsuite/gdb.multi/start-inferior-specific.exp index 74f984cccd4..39621f070de 100644 --- a/gdb/testsuite/gdb.multi/start-inferior-specific.exp +++ b/gdb/testsuite/gdb.multi/start-inferior-specific.exp @@ -30,7 +30,8 @@ require allow_multi_inferior_tests 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 @@ -48,7 +49,7 @@ proc do_test {} { 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" diff --git a/gdb/testsuite/gdb.multi/watchpoint-multi-exit.exp b/gdb/testsuite/gdb.multi/watchpoint-multi-exit.exp index 3446296e3fb..431132e8ae9 100644 --- a/gdb/testsuite/gdb.multi/watchpoint-multi-exit.exp +++ b/gdb/testsuite/gdb.multi/watchpoint-multi-exit.exp @@ -31,7 +31,7 @@ if {[build_executable "failed to build" $testfile $srcfile {debug}]} { 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"