From: Tom de Vries Date: Wed, 3 Sep 2025 16:56:37 +0000 (+0200) Subject: [gdb/testsuite] Fix clean_restart in gdb.cp X-Git-Tag: gdb-17-branchpoint~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d47956f3e4a457311386bd81a050dea68737a91;p=thirdparty%2Fbinutils-gdb.git [gdb/testsuite] Fix clean_restart in gdb.cp Fix clean_restart in the test-cases in gdb.cp. Tested on x86_64-linux. --- diff --git a/gdb/testsuite/gdb.cp/call-c.exp b/gdb/testsuite/gdb.cp/call-c.exp index f99d1712e12..6d240c86545 100644 --- a/gdb/testsuite/gdb.cp/call-c.exp +++ b/gdb/testsuite/gdb.cp/call-c.exp @@ -27,7 +27,7 @@ if {[gdb_compile "$srcdir/$subdir/${srcfile2}" "${objfilec}" object {debug}] != return -1 } -clean_restart ${binfile} +clean_restart ${::testfile} runto_main diff --git a/gdb/testsuite/gdb.cp/gdb2384.exp b/gdb/testsuite/gdb.cp/gdb2384.exp index 204bdeb3aa1..a53ec3a8ccc 100644 --- a/gdb/testsuite/gdb.cp/gdb2384.exp +++ b/gdb/testsuite/gdb.cp/gdb2384.exp @@ -35,7 +35,7 @@ if { [gdb_compile_shlib $srcdir/$subdir/$srcfile2 $sofile {debug c++}] != "" return -1 } -clean_restart ${binfile} +clean_restart ${::testfile} gdb_load_shlib ${sofile} diff --git a/gdb/testsuite/gdb.cp/infcall-nodebug.exp.tcl b/gdb/testsuite/gdb.cp/infcall-nodebug.exp.tcl index 0a7bc76002d..46e48d0983e 100644 --- a/gdb/testsuite/gdb.cp/infcall-nodebug.exp.tcl +++ b/gdb/testsuite/gdb.cp/infcall-nodebug.exp.tcl @@ -71,7 +71,7 @@ proc build_and_run_test { lang symbols } { # Startup and run to main. - clean_restart $binfile + clean_restart $::testfile if ![runto_main] then { return diff --git a/gdb/testsuite/gdb.cp/pr10728.exp b/gdb/testsuite/gdb.cp/pr10728.exp index 0525ac1b61d..8201e243996 100644 --- a/gdb/testsuite/gdb.cp/pr10728.exp +++ b/gdb/testsuite/gdb.cp/pr10728.exp @@ -42,7 +42,7 @@ if { [gdb_compile "${tfx}.o ${tfy}.o" ${binfile} executable {debug c++}] != "" return -1 } -clean_restart $binfile +clean_restart $::testfile if {![runto_main]} { return diff --git a/gdb/testsuite/gdb.cp/print-global-stub.exp b/gdb/testsuite/gdb.cp/print-global-stub.exp index 139e8b158a8..d847c006876 100644 --- a/gdb/testsuite/gdb.cp/print-global-stub.exp +++ b/gdb/testsuite/gdb.cp/print-global-stub.exp @@ -19,14 +19,15 @@ require allow_cplus_tests standard_testfile .cc -set objfile [standard_output_file ${testfile}.o] +set testfile $testfile.o +set binfile [standard_output_file $testfile] -if { [gdb_compile $srcdir/$subdir/$srcfile $objfile object \ +if { [gdb_compile $srcdir/$subdir/$srcfile $binfile object \ {c++ debug}] != "" } { untested "failed to compile" return -1 } -clean_restart $objfile +clean_restart $testfile gdb_test "print s" " = " diff --git a/gdb/testsuite/gdb.cp/psmang.exp b/gdb/testsuite/gdb.cp/psmang.exp index acc7b3bf634..67bc9cd935d 100644 --- a/gdb/testsuite/gdb.cp/psmang.exp +++ b/gdb/testsuite/gdb.cp/psmang.exp @@ -190,6 +190,6 @@ gdb_test "break s::method1" "Breakpoint .* at .*: file .*psmang1.cc.*" # We have to exit and restart GDB here, to make sure that all the # compilation units are psymtabs again. -clean_restart ${binfile} +clean_restart ${::testfile} gdb_test "break s::method2" "Breakpoint .* at .*: file .*psmang2.cc.*" diff --git a/gdb/testsuite/gdb.cp/ref-params.exp b/gdb/testsuite/gdb.cp/ref-params.exp index 97a56ab252c..4f2cbb5dace 100644 --- a/gdb/testsuite/gdb.cp/ref-params.exp +++ b/gdb/testsuite/gdb.cp/ref-params.exp @@ -32,7 +32,7 @@ proc gdb_start_again { text } { global binfile global srcfile - clean_restart $binfile + clean_restart $::testfile runto ${srcfile}:[gdb_get_line_number $text] } diff --git a/gdb/testsuite/gdb.cp/rvalue-ref-params.exp b/gdb/testsuite/gdb.cp/rvalue-ref-params.exp index 8a5e66f68cb..267dbc71758 100644 --- a/gdb/testsuite/gdb.cp/rvalue-ref-params.exp +++ b/gdb/testsuite/gdb.cp/rvalue-ref-params.exp @@ -30,7 +30,7 @@ proc gdb_start_again {text prefix} { global srcfile with_test_prefix $prefix { - clean_restart $binfile + clean_restart $::testfile runto ${srcfile}:[gdb_get_line_number $text] }