From: Tom de Vries Date: Thu, 4 Sep 2025 14:15:26 +0000 (+0200) Subject: [gdb/testsuite] Fix clean_restart in gdb.arch/*.exp X-Git-Tag: gdb-17-branchpoint~36 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9463d3e7563186ea9800ff2ba8ae909c31e5e854;p=thirdparty%2Fbinutils-gdb.git [gdb/testsuite] Fix clean_restart in gdb.arch/*.exp Fix clean_restart in gdb.arch/*.exp. The fixed test-cases are supported on archs sh, ia64, mips, pa and sparc. I haven't tested these. --- diff --git a/gdb/testsuite/gdb.arch/alpha-step.exp b/gdb/testsuite/gdb.arch/alpha-step.exp index e41bd97e39d..bdbfeecd341 100644 --- a/gdb/testsuite/gdb.arch/alpha-step.exp +++ b/gdb/testsuite/gdb.arch/alpha-step.exp @@ -25,7 +25,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {}] ! return -1 } -clean_restart $binfile +clean_restart +gdb_load $binfile proc test_stepi {function } { # Restart the program from scratch. If GDB got confused during one diff --git a/gdb/testsuite/gdb.arch/gdb1291.exp b/gdb/testsuite/gdb.arch/gdb1291.exp index ad3b8f9e26c..9f460c8054b 100644 --- a/gdb/testsuite/gdb.arch/gdb1291.exp +++ b/gdb/testsuite/gdb.arch/gdb1291.exp @@ -33,7 +33,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable ""] ! return -1 } -clean_restart $binfile +clean_restart +gdb_load $binfile # # Run to `main' where we begin our tests. diff --git a/gdb/testsuite/gdb.arch/gdb1431.exp b/gdb/testsuite/gdb.arch/gdb1431.exp index 34bc8d68de9..bc65d261327 100644 --- a/gdb/testsuite/gdb.arch/gdb1431.exp +++ b/gdb/testsuite/gdb.arch/gdb1431.exp @@ -35,7 +35,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable ""] ! return -1 } -clean_restart $binfile +clean_restart +gdb_load $binfile # # Run to `main' where we begin our tests. diff --git a/gdb/testsuite/gdb.arch/gdb1558.exp b/gdb/testsuite/gdb.arch/gdb1558.exp index f6904684b32..3de57230a47 100644 --- a/gdb/testsuite/gdb.arch/gdb1558.exp +++ b/gdb/testsuite/gdb.arch/gdb1558.exp @@ -32,7 +32,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {"add return -1 } -clean_restart $binfile +clean_restart +gdb_load $binfile gdb_test "b -q main" "Breakpoint 1.*" "set breakpoint at main" gdb_test "b -q sub1" "Breakpoint 2.*" "set breakpoint at sub1" diff --git a/gdb/testsuite/gdb.arch/ia64-breakpoint-shadow.exp b/gdb/testsuite/gdb.arch/ia64-breakpoint-shadow.exp index 8e8ed9bb3f6..d6fd14cfbdd 100644 --- a/gdb/testsuite/gdb.arch/ia64-breakpoint-shadow.exp +++ b/gdb/testsuite/gdb.arch/ia64-breakpoint-shadow.exp @@ -23,7 +23,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb return -1 } -clean_restart $binfile +clean_restart +gdb_load $binfile # We need to start the inferior to place the breakpoints in the memory at all. if ![runto_main] { diff --git a/gdb/testsuite/gdb.arch/mips-fpregset-core.exp b/gdb/testsuite/gdb.arch/mips-fpregset-core.exp index aa55ededac3..d67cef2f590 100644 --- a/gdb/testsuite/gdb.arch/mips-fpregset-core.exp +++ b/gdb/testsuite/gdb.arch/mips-fpregset-core.exp @@ -79,7 +79,8 @@ set core_supported [expr {$corefile != ""}] # Generate a core file with "gcore". -clean_restart ${binfile} +clean_restart +gdb_load $binfile runto break_here @@ -116,7 +117,8 @@ proc mips_fpregset_core_test { supported corefile } { upvar host_triplet host_triplet upvar binfile binfile - clean_restart ${binfile} + clean_restart + gdb_load $binfile set test "load core file" if { $supported } { diff --git a/gdb/testsuite/gdb.arch/mips-octeon-bbit.exp b/gdb/testsuite/gdb.arch/mips-octeon-bbit.exp index 3fb6f9ccf6d..f43127d3c8d 100644 --- a/gdb/testsuite/gdb.arch/mips-octeon-bbit.exp +++ b/gdb/testsuite/gdb.arch/mips-octeon-bbit.exp @@ -86,7 +86,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \ pass "compilation" -clean_restart $binfile +clean_restart +gdb_load $binfile # Native needs run. runto_main diff --git a/gdb/testsuite/gdb.arch/pa-nullify.exp b/gdb/testsuite/gdb.arch/pa-nullify.exp index 87afe7a9a99..ad246ca69ea 100644 --- a/gdb/testsuite/gdb.arch/pa-nullify.exp +++ b/gdb/testsuite/gdb.arch/pa-nullify.exp @@ -40,7 +40,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {}] ! return -1 } -clean_restart $binfile +clean_restart +gdb_load $binfile # In the first test, we do a "step" on a function whose last instruction # contains a branch-with-nullify. The instruction in the delay slot belongs diff --git a/gdb/testsuite/gdb.arch/sparc-sysstep.exp b/gdb/testsuite/gdb.arch/sparc-sysstep.exp index 40de862c8c6..4dfc5143714 100644 --- a/gdb/testsuite/gdb.arch/sparc-sysstep.exp +++ b/gdb/testsuite/gdb.arch/sparc-sysstep.exp @@ -28,7 +28,7 @@ set srcfile ${testfile}.c set binfile ${objdir}/${subdir}/${testfile} set opts {} -if {[prepare_for_testing "failed to prepare" ${binfile} $srcfile {additional_flags=-g}]} { +if {[prepare_for_testing "failed to prepare" $testfile $srcfile {additional_flags=-g}]} { return -1 }