]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Fix clean_restart <absolute filename> in gdb.debuginfod
authorTom de Vries <tdevries@suse.de>
Wed, 3 Sep 2025 16:20:47 +0000 (18:20 +0200)
committerTom de Vries <tdevries@suse.de>
Wed, 3 Sep 2025 16:20:47 +0000 (18:20 +0200)
Fix clean_restart <absolute filename> in the test-cases in gdb.debuginfod.

Tested on x86_64-linux.

gdb/testsuite/gdb.debuginfod/corefile-mapped-file.exp
gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp
gdb/testsuite/gdb.debuginfod/solib-with-soname.exp

index dac4e6c5e585587db392856bace21e59a45bea21..204b924d02eabc425eadaebd50a51d67d54807de 100644 (file)
@@ -69,14 +69,15 @@ standard_testfile -1.c -2.c -3.c
 # shared library, then use GDB to figure out the offset of the
 # variable 'library_ptr' within the library.
 set library_filename [standard_output_file "libfoo.so"]
-set binfile2 [standard_output_file "library_loader"]
+set testfile2 "library_loader"
+set binfile2 [standard_output_file $testfile2]
 
 if {[prepare_for_testing_full "build exec which loads the shared library" \
         [list $library_filename \
              { debug shlib build-id \
                    additional_flags=-DPOINTER_VALUE=0x12345678 } \
              $srcfile2 {}] \
-        [list $binfile2 [list debug shlib=$library_filename ] \
+        [list $testfile2 [list debug shlib=$library_filename ] \
              $srcfile { debug }]] != 0} {
     return
 }
@@ -160,7 +161,7 @@ if { $ptr_expected_value eq "" } {
 # Load this executable within GDB and confirm that we can use the
 # offset we calculated previously to view the value of 'library_ptr'.
 set opts [list debug additional_flags=-DSHLIB_FILENAME=\"$library_filename\"]
-if {[prepare_for_testing "prepare second executable" $binfile \
+if {[prepare_for_testing "prepare second executable" $testfile \
         $srcfile3 $opts] != 0} {
     return
 }
@@ -268,7 +269,7 @@ proc load_core_file { testname { line_re "" } } {
 # And now restart GDB, load the core-file and check that the library shows as
 # being mapped in, and that we can still read the library_ptr value from
 # memory.
-clean_restart $binfile
+clean_restart $::testfile
 
 load_core_file "load core file"
 
@@ -287,7 +288,7 @@ gdb_assert { $ptr_value == $ptr_expected_value } \
 set library_backup_filename [standard_output_file "libfoo.so.backup"]
 remote_exec build "mv \"$library_filename\" \"$library_backup_filename\""
 
-clean_restart $binfile
+clean_restart $::testfile
 
 load_core_file "load corefile with library file missing" \
     "warning: Can't open file [string_to_regexp $library_filename] during file-backed mapping note processing"
@@ -309,7 +310,7 @@ set build_id_filename \
 remote_exec build "mkdir -p [file dirname $build_id_filename]"
 remote_exec build "ln -sf $library_backup_filename $build_id_filename"
 
-clean_restart $binfile
+clean_restart $::testfile
 
 gdb_test_no_output "set debug-file-directory $debugdir" \
     "set debug-file-directory"
@@ -331,7 +332,7 @@ if {[build_executable "build second version of shared library" \
     return
 }
 
-clean_restart $binfile
+clean_restart $::testfile
 
 load_core_file "load corefile with wrong library in place" \
     "warning: File [string_to_regexp $library_filename] doesn't match build-id from core-file during file-backed mapping processing"
index 4b3894e1baab0e1cf6497b7bb70ac69fecf61e0f..569519be66a317d1eb520f30da3f3bc8a14b01ae 100644 (file)
@@ -107,7 +107,7 @@ proc_with_prefix no_url { } {
     setenv DEBUGINFOD_URLS ""
 
     # Test that GDB cannot find source without debuginfod.
-    clean_restart $binfile
+    clean_restart $::testfile
     gdb_test_no_output "set substitute-path $outputdir /dev/null" \
        "set substitute-path"
     gdb_test "list" ".*No such file or directory.*"
@@ -126,7 +126,7 @@ proc_with_prefix no_url { } {
     file rename -force $debuginfo $debugdir
 
     # Test that GDB cannot find symbols without debuginfod.
-    clean_restart $binfile
+    clean_restart $::testfile
     gdb_test "file" ".*No symbol file.*"
 
     set buildid "01234567890abcdef0123456"
@@ -157,7 +157,7 @@ proc_with_prefix no_url { } {
 
     # Generate a core file and test that GDB cannot find the
     # executable.
-    clean_restart ${binfile}2
+    clean_restart ${::testfile}2
     if ![runto_main] {
        return -1
     }
index 1008e462a7f6d5933ffb172aabbc43389de45453..67d9237d43c6ad1b1631ca08f7433614acf0a1b1 100644 (file)
@@ -132,7 +132,7 @@ if {$corefile eq ""} {
 proc load_exec_and_core_file { expect_warning expect_download testname \
                                   {debugdir ""} } {
     with_test_prefix $testname {
-       clean_restart $::binfile
+       clean_restart $::testfile
 
        if { $debugdir ne "" } {
            gdb_test_no_output "set debug-file-directory $debugdir" \