# 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
}
# 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
}
# 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"
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"
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"
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"
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.*"
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"
# 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
}