From: Tom de Vries Date: Thu, 4 Sep 2025 14:15:26 +0000 (+0200) Subject: [gdb/testsuite] Fix clean_restart in gdb.arch/amd64*.exp X-Git-Tag: gdb-17-branchpoint~42 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=55050c2f7e13c31122d0dcb554cb4458f8c05775;p=thirdparty%2Fbinutils-gdb.git [gdb/testsuite] Fix clean_restart in gdb.arch/amd64*.exp Fix clean_restart in gdb.arch/amd64*.exp. Tested on x86_64-linux, with kernel version 6.16.3. The only unsupported test-case is gdb.arch/amd64-lam.exp, which isn't changed by this commit. --- diff --git a/gdb/testsuite/gdb.arch/amd64-byte.exp b/gdb/testsuite/gdb.arch/amd64-byte.exp index ac70672832e..d0843031efa 100644 --- a/gdb/testsuite/gdb.arch/amd64-byte.exp +++ b/gdb/testsuite/gdb.arch/amd64-byte.exp @@ -27,7 +27,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list return } -clean_restart ${binfile} +clean_restart ${::testfile} if {![runto_main]} { return 0 diff --git a/gdb/testsuite/gdb.arch/amd64-dword.exp b/gdb/testsuite/gdb.arch/amd64-dword.exp index e8a527dc4f8..cd3d76b295e 100644 --- a/gdb/testsuite/gdb.arch/amd64-dword.exp +++ b/gdb/testsuite/gdb.arch/amd64-dword.exp @@ -27,7 +27,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list return } -clean_restart ${binfile} +clean_restart ${::testfile} if {![runto_main]} { return 0 diff --git a/gdb/testsuite/gdb.arch/amd64-init-x87-values.exp b/gdb/testsuite/gdb.arch/amd64-init-x87-values.exp index 11004fa2223..871972c0426 100644 --- a/gdb/testsuite/gdb.arch/amd64-init-x87-values.exp +++ b/gdb/testsuite/gdb.arch/amd64-init-x87-values.exp @@ -40,7 +40,7 @@ if { [build_executable "failed to prepare" ${testfile} ${srcfile} $options] } { proc_with_prefix check_x87_regs_around_init {} { global binfile - clean_restart ${binfile} + clean_restart ${::testfile} # Get things started. if {![runto_main]} { @@ -115,7 +115,7 @@ proc_with_prefix check_x87_regs_around_init {} { proc_with_prefix check_setting_mxcsr_before_enable {} { global binfile gdb_prompt - clean_restart ${binfile} + clean_restart ${::testfile} if {![runto_main]} { return 0 @@ -149,7 +149,7 @@ proc_with_prefix check_setting_mxcsr_before_enable {} { proc_with_prefix check_setting_x87_regs_before_enable {} { global binfile - clean_restart ${binfile} + clean_restart ${::testfile} if {![runto_main]} { return 0 diff --git a/gdb/testsuite/gdb.arch/amd64-invalid-stack-middle.exp b/gdb/testsuite/gdb.arch/amd64-invalid-stack-middle.exp index 03ecba6d05d..451c84b8475 100644 --- a/gdb/testsuite/gdb.arch/amd64-invalid-stack-middle.exp +++ b/gdb/testsuite/gdb.arch/amd64-invalid-stack-middle.exp @@ -45,7 +45,7 @@ gdb_test "bt" "^#0 +breakpt *\\(\\) \[^\r\n\]*\r\n#1 +0x\[0-9a-f\]+ in func5\[^\ gdb_test "bt" "^#0 +breakpt *\\(\\) \[^\r\n\]*\r\n#1 +0x\[0-9a-f\]+ in func5\[^\r\n\]*\r\n#2 +0x\[0-9a-f\]+ in func4\[^\r\n\]*\r\n#3 +0x\[0-9a-f\]+ in func3\[^\r\n\]*\r\nBacktrace stopped: Cannot access memory at address 0x\[0-9a-f\]+" \ "second backtrace, with error message" -clean_restart ${binfile} +clean_restart ${::testfile} if ![runto breakpt] { return -1 @@ -59,7 +59,7 @@ gdb_test "interpreter-exec mi \"-stack-info-depth\"" \ "\\^done,depth=\"4\"" \ "check mi -stack-info-depth command, second time" -clean_restart ${binfile} +clean_restart ${::testfile} if ![runto breakpt] { return -1 diff --git a/gdb/testsuite/gdb.arch/amd64-invalid-stack-top.exp b/gdb/testsuite/gdb.arch/amd64-invalid-stack-top.exp index 134dfda1f22..b715ecf410a 100644 --- a/gdb/testsuite/gdb.arch/amd64-invalid-stack-top.exp +++ b/gdb/testsuite/gdb.arch/amd64-invalid-stack-top.exp @@ -49,7 +49,7 @@ gdb_test "bt no-filters" "^#0 +$hex in func2 \\(\\)\r\nBacktrace stopped: Cannot gdb_test "bt no-filters" "^#0 +$hex in func2 \\(\\)\r\nBacktrace stopped: Cannot access memory at address 0x\[0-9a-f\]+" \ "second backtrace, with error message" -clean_restart ${binfile} +clean_restart ${::testfile} if ![runto breakpt] { return -1 @@ -63,7 +63,7 @@ gdb_test "interpreter-exec mi \"-stack-info-depth\"" \ "\\^done,depth=\"1\"" \ "check mi -stack-info-depth command, second time" -clean_restart ${binfile} +clean_restart ${::testfile} if ![runto breakpt] { return -1 diff --git a/gdb/testsuite/gdb.arch/amd64-prologue-skip.exp b/gdb/testsuite/gdb.arch/amd64-prologue-skip.exp index 04f32662617..c96c0c70494 100644 --- a/gdb/testsuite/gdb.arch/amd64-prologue-skip.exp +++ b/gdb/testsuite/gdb.arch/amd64-prologue-skip.exp @@ -14,7 +14,8 @@ # along with this program. If not, see . standard_testfile .S -set binfile ${binfile}.o +set testfile $testfile.o +set binfile [standard_output_file $testfile] require is_x86_64_m64_target @@ -23,7 +24,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {debug}] return } -clean_restart ${binfile} +clean_restart ${::testfile} gdb_test "break *pushrbp" " at 0x1: file .*" gdb_test "break pushrbp" " at 0x1: file .*" diff --git a/gdb/testsuite/gdb.arch/amd64-prologue-xmm.exp b/gdb/testsuite/gdb.arch/amd64-prologue-xmm.exp index 7c16238d99c..844797393c9 100644 --- a/gdb/testsuite/gdb.arch/amd64-prologue-xmm.exp +++ b/gdb/testsuite/gdb.arch/amd64-prologue-xmm.exp @@ -28,7 +28,7 @@ if [info exists COMPILE] { require is_x86_64_m64_target } -if {[prepare_for_testing "failed to prepare" ${binfile} $srcfile $opts]} { +if {[prepare_for_testing "failed to prepare" ${testfile} $srcfile $opts]} { return -1 } diff --git a/gdb/testsuite/gdb.arch/amd64-pseudo-unwind.exp b/gdb/testsuite/gdb.arch/amd64-pseudo-unwind.exp index 6333311942f..49721ddd0b6 100644 --- a/gdb/testsuite/gdb.arch/amd64-pseudo-unwind.exp +++ b/gdb/testsuite/gdb.arch/amd64-pseudo-unwind.exp @@ -32,7 +32,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/amd64-shadow-stack-cmds.exp b/gdb/testsuite/gdb.arch/amd64-shadow-stack-cmds.exp index c819cbc25e2..0ae172d7c41 100644 --- a/gdb/testsuite/gdb.arch/amd64-shadow-stack-cmds.exp +++ b/gdb/testsuite/gdb.arch/amd64-shadow-stack-cmds.exp @@ -27,7 +27,7 @@ standard_testfile amd64-shadow-stack.c proc restart_and_run_infcall_call2 {} { global binfile - clean_restart ${binfile} + clean_restart ${::testfile} if { ![runto_main] } { return -1 } @@ -47,7 +47,7 @@ save_vars { ::env(GLIBC_TUNABLES) } { return -1 } - clean_restart ${binfile} + clean_restart ${::testfile} if { ![runto_main] } { return -1 } @@ -83,7 +83,7 @@ save_vars { ::env(GLIBC_TUNABLES) } { gdb_continue_to_end } - clean_restart ${binfile} + clean_restart ${::testfile} if { ![runto_main] } { return -1 } @@ -120,7 +120,7 @@ save_vars { ::env(GLIBC_TUNABLES) } { gdb_continue_to_end } - clean_restart ${binfile} + clean_restart ${::testfile} if { ![runto_main] } { return -1 } diff --git a/gdb/testsuite/gdb.arch/amd64-shadow-stack-corefile.exp b/gdb/testsuite/gdb.arch/amd64-shadow-stack-corefile.exp index a45cd06dc9f..039f528ad27 100644 --- a/gdb/testsuite/gdb.arch/amd64-shadow-stack-corefile.exp +++ b/gdb/testsuite/gdb.arch/amd64-shadow-stack-corefile.exp @@ -67,7 +67,7 @@ save_vars { ::env(GLIBC_TUNABLES) } { # Load the core file and check the value of the shadow stack pointer. if {$core_generated} { - clean_restart $binfile + clean_restart $::testfile with_test_prefix "OS corefile" { # Read ssp value from saved output of the test program. @@ -83,7 +83,7 @@ save_vars { ::env(GLIBC_TUNABLES) } { return } - clean_restart $binfile + clean_restart $::testfile if ![runto $linespec] { return @@ -110,7 +110,7 @@ save_vars { ::env(GLIBC_TUNABLES) } { gdb_assert { $gcore_generated } "gcore corefile created" if { $gcore_generated } { - clean_restart $binfile + clean_restart $::testfile with_test_prefix "gcore corefile" { check_core_file $gcore_filename $ssp_in_gcore diff --git a/gdb/testsuite/gdb.arch/amd64-shadow-stack.exp b/gdb/testsuite/gdb.arch/amd64-shadow-stack.exp index a72334a391b..e9f6fa6d34d 100644 --- a/gdb/testsuite/gdb.arch/amd64-shadow-stack.exp +++ b/gdb/testsuite/gdb.arch/amd64-shadow-stack.exp @@ -51,7 +51,7 @@ save_vars { ::env(GLIBC_TUNABLES) } { "continue to SIGSEGV" } - clean_restart ${binfile} + clean_restart ${::testfile} if { ![runto_main] } { return } diff --git a/gdb/testsuite/gdb.arch/amd64-word.exp b/gdb/testsuite/gdb.arch/amd64-word.exp index d5dfb02407f..8a6b28d714c 100644 --- a/gdb/testsuite/gdb.arch/amd64-word.exp +++ b/gdb/testsuite/gdb.arch/amd64-word.exp @@ -27,7 +27,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list return } -clean_restart ${binfile} +clean_restart ${::testfile} if {![runto_main]} { return 0