From: Tom de Vries Date: Thu, 4 Sep 2025 14:15:26 +0000 (+0200) Subject: [gdb/testsuite] Fix clean_restart in gdb.arch/aarch64*.exp X-Git-Tag: gdb-17-branchpoint~40 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fa06ea7498fcb2f7b82fde5fc28919b0de2f8515;p=thirdparty%2Fbinutils-gdb.git [gdb/testsuite] Fix clean_restart in gdb.arch/aarch64*.exp Fix clean_restart in gdb.arch/aarch64*.exp. Tested on aarch64-linux, M1 system. There's a large number (44) of unsupported, for the following reasons: - allow_aarch64_gcs_tests - allow_aarch64_mops_tests - allow_aarch64_sve_tests / target does not support SVE - memory tagging unsupported Consequently, we mostly use the simple substitution: ... clean_restart $binfile -> clean_restart gdb_load $binfile ... --- diff --git a/gdb/testsuite/gdb.arch/aarch64-gcs-core.exp b/gdb/testsuite/gdb.arch/aarch64-gcs-core.exp index 2261ac88354..9c4b7d5570c 100644 --- a/gdb/testsuite/gdb.arch/aarch64-gcs-core.exp +++ b/gdb/testsuite/gdb.arch/aarch64-gcs-core.exp @@ -61,7 +61,8 @@ if {!$core_generated} { } if {$core_generated} { - clean_restart $binfile + clean_restart + gdb_load $binfile with_test_prefix "OS corefile" { # Read GCSPR value from saved output of the test program. @@ -78,7 +79,8 @@ if ![gcore_cmd_available] { return } -clean_restart $binfile +clean_restart +gdb_load $binfile if ![runto $linespec] { return @@ -105,7 +107,8 @@ set gcore_generated [gdb_gcore_cmd "$gcore_filename" "generate gcore file"] gdb_assert { $gcore_generated } "gcore corefile created" if {$gcore_generated} { - clean_restart $binfile + clean_restart + gdb_load $binfile with_test_prefix "gcore corefile" { check_core_file $gcore_filename $gcspr_in_gcore diff --git a/gdb/testsuite/gdb.arch/aarch64-gcs-return.exp b/gdb/testsuite/gdb.arch/aarch64-gcs-return.exp index 1d1c2376e45..6f695da50fb 100644 --- a/gdb/testsuite/gdb.arch/aarch64-gcs-return.exp +++ b/gdb/testsuite/gdb.arch/aarch64-gcs-return.exp @@ -37,7 +37,8 @@ if ![runto ${begin_line}] { proc restart_and_run_infcall_call2 {} { global binfile call2_line - clean_restart ${binfile} + clean_restart + gdb_load $binfile if ![runto_main] { return } @@ -79,7 +80,8 @@ with_test_prefix "test return 'above' an inferior call" { gdb_continue_to_end } -clean_restart ${binfile} +clean_restart +gdb_load $binfile if ![runto ${begin_line}] { return } @@ -110,7 +112,8 @@ with_test_prefix "test return from current frame" { gdb_continue_to_end } -clean_restart ${binfile} +clean_restart +gdb_load $binfile if ![runto_main] { return } diff --git a/gdb/testsuite/gdb.arch/aarch64-gcs.exp b/gdb/testsuite/gdb.arch/aarch64-gcs.exp index ad73b413240..b09e010459a 100644 --- a/gdb/testsuite/gdb.arch/aarch64-gcs.exp +++ b/gdb/testsuite/gdb.arch/aarch64-gcs.exp @@ -78,7 +78,8 @@ gdb_test "print \$gcspr == \$gcspr_in_main - 16" ". = 1" \ "test value of gcspr when GCS SIGSEGV happens" # Test writing to GCSPR. -clean_restart ${binfile} +clean_restart +gdb_load $binfile if ![runto normal_function0] { return } diff --git a/gdb/testsuite/gdb.arch/aarch64-mte-core.exp b/gdb/testsuite/gdb.arch/aarch64-mte-core.exp index fdaa0618138..7da836eba24 100644 --- a/gdb/testsuite/gdb.arch/aarch64-mte-core.exp +++ b/gdb/testsuite/gdb.arch/aarch64-mte-core.exp @@ -145,7 +145,8 @@ proc test_mode { mode } { # both correctly. if {$gcore_generated} { - clean_restart ${binfile} + clean_restart + gdb_load $binfile with_test_prefix "gcore corefile" { test_mte_core_file $gcore_filename $mode } @@ -154,7 +155,8 @@ proc test_mode { mode } { } if {$core_generated} { - clean_restart ${binfile} + clean_restart + gdb_load $binfile with_test_prefix "native corefile" { test_mte_core_file $core_filename $mode } diff --git a/gdb/testsuite/gdb.arch/aarch64-pseudo-unwind.exp b/gdb/testsuite/gdb.arch/aarch64-pseudo-unwind.exp index 7ce1fdf3862..e835ddf2c5a 100644 --- a/gdb/testsuite/gdb.arch/aarch64-pseudo-unwind.exp +++ b/gdb/testsuite/gdb.arch/aarch64-pseudo-unwind.exp @@ -29,7 +29,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \ return -1 } -clean_restart ${binfile} +clean_restart $testfile if {![runto_main]} { return diff --git a/gdb/testsuite/gdb.arch/aarch64-sme-core.exp.tcl b/gdb/testsuite/gdb.arch/aarch64-sme-core.exp.tcl index 44d0808c97e..64cfd54c868 100644 --- a/gdb/testsuite/gdb.arch/aarch64-sme-core.exp.tcl +++ b/gdb/testsuite/gdb.arch/aarch64-sme-core.exp.tcl @@ -91,7 +91,8 @@ proc generate_sme_core_files { executable binfile id state vl svl} { # and the native one generated by the Linux Kernel. Make sure GDB can read # both correctly. if {$gcore_generated} { - clean_restart ${binfile} + clean_restart + gdb_load $binfile gdb_test_no_output "set print repeats 1" \ "adjust repeat count post-crash gcore" @@ -103,7 +104,8 @@ proc generate_sme_core_files { executable binfile id state vl svl} { } if {$core_generated} { - clean_restart ${binfile} + clean_restart + gdb_load $binfile gdb_test_no_output "set print repeats 1" \ "adjust repeat count post-crash native core" diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 1652a76b9bf..5ba1c9059d0 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -4994,7 +4994,8 @@ gdb_caching_proc allow_aarch64_sve_tests {} { } # Compilation succeeded so now run it via gdb. - clean_restart $obj + clean_restart + gdb_load $obj gdb_run_cmd gdb_expect { -re ".*Illegal instruction.*${gdb_prompt} $" { @@ -5367,7 +5368,8 @@ gdb_caching_proc allow_aarch64_gcs_tests {} { # Compilation succeeded so now run it via gdb. set allow_gcs_tests 0 - clean_restart $obj + clean_restart + gdb_load $obj gdb_run_cmd gdb_expect { -re ".*$inferior_exited_re normally.*${gdb_prompt} $" {