]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Fix clean_restart <absolute filename> in gdb.arch/amd64*.exp
authorTom de Vries <tdevries@suse.de>
Thu, 4 Sep 2025 14:15:26 +0000 (16:15 +0200)
committerTom de Vries <tdevries@suse.de>
Thu, 4 Sep 2025 14:15:26 +0000 (16:15 +0200)
Fix clean_restart <absolute filename> 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.

12 files changed:
gdb/testsuite/gdb.arch/amd64-byte.exp
gdb/testsuite/gdb.arch/amd64-dword.exp
gdb/testsuite/gdb.arch/amd64-init-x87-values.exp
gdb/testsuite/gdb.arch/amd64-invalid-stack-middle.exp
gdb/testsuite/gdb.arch/amd64-invalid-stack-top.exp
gdb/testsuite/gdb.arch/amd64-prologue-skip.exp
gdb/testsuite/gdb.arch/amd64-prologue-xmm.exp
gdb/testsuite/gdb.arch/amd64-pseudo-unwind.exp
gdb/testsuite/gdb.arch/amd64-shadow-stack-cmds.exp
gdb/testsuite/gdb.arch/amd64-shadow-stack-corefile.exp
gdb/testsuite/gdb.arch/amd64-shadow-stack.exp
gdb/testsuite/gdb.arch/amd64-word.exp

index ac70672832e91f4b9e4809d49d5cf710d81f7fb1..d0843031efa627e0269a89d92f73b08a59a12fa1 100644 (file)
@@ -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
index e8a527dc4f8c76a49c90584eba5a57b366e319c9..cd3d76b295ea2756e49b38ef6c2206c45c9d26aa 100644 (file)
@@ -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
index 11004fa222350e9e9943b370f4ff3b9bb8b0c076..871972c0426872ec4374194123064ed992a9fbf4 100644 (file)
@@ -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
index 03ecba6d05dec433b980bdc57eb7378f11cea156..451c84b847506823ae625cfcf8dcc2f71c21cc3e 100644 (file)
@@ -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
index 134dfda1f2217e2775bb15e1978609e04b1b6e34..b715ecf410a5ec964f1fdb4e35da1ea8e28fb1ae 100644 (file)
@@ -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
index 04f3266261781e6644af73d342af30b27dcd3868..c96c0c70494077fcf4b556850050fadceaf1e9f1 100644 (file)
@@ -14,7 +14,8 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 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 .*"
index 7c16238d99c2e8f5dcb897835b2e4084df47d2f0..844797393c93dd69c5c6c766db7421d03cf45382 100644 (file)
@@ -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
 }
 
index 6333311942f4b0c5550e8eb9333dde7d8702a953..49721ddd0b6c3b5b1f51d746b8cab9cbbc96f83b 100644 (file)
@@ -32,7 +32,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-clean_restart ${binfile}
+clean_restart ${::testfile}
 
 if {![runto_main]} {
     return
index c819cbc25e2546923c415726c7a92bc24d7d3e15..0ae172d7c41a0d7f8f8e0a2af827fcfa3009f7f0 100644 (file)
@@ -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
     }
index a45cd06dc9f3b832af4a36140129d378a81b3e75..039f528ad27acb78e7bc9de52086925cc2d5d005 100644 (file)
@@ -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
index a72334a391bd42d1ad3b349b1c23e4a5273cc1b2..e9f6fa6d34d5b823648ca01044a9efb0d0fdb9ad 100644 (file)
@@ -51,7 +51,7 @@ save_vars { ::env(GLIBC_TUNABLES) } {
            "continue to SIGSEGV"
     }
 
-    clean_restart ${binfile}
+    clean_restart ${::testfile}
     if { ![runto_main] } {
        return
     }
index d5dfb02407ff40453fa1dc5cab88f3111365c4eb..8a6b28d714cf7b1fed90c5ba8902b83732460062 100644 (file)
@@ -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