[binutils-gdb] testsuite, threads: fix LD_LIBRARY_PATH in 'tls-sepdebug.exp'

Stephan Rohr srohr@sourceware.org
Tue Sep 24 07:05:43 GMT 2024


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7d5702b8fdee17a5b4597b2b03c93e97d5b4c136

commit 7d5702b8fdee17a5b4597b2b03c93e97d5b4c136
Author: Rohr, Stephan <stephan.rohr@intel.com>
Date:   Mon Jan 29 07:05:40 2024 -0800

    testsuite, threads: fix LD_LIBRARY_PATH in 'tls-sepdebug.exp'
    
    Some compilers (e.g. the Intel compiler) may dynamically link against
    dependencies.  The test uses the 'set env' command to set the
    LD_LIBRARY_PATH to a test specific value.  Update the 'set env' command
    to also provide the users LD_LIBARY_PATH to gdb.
    
    Approved-By: Tom Tromey <tom@tromey.com>

Diff:
---
 gdb/testsuite/gdb.threads/tls-sepdebug.exp | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/gdb/testsuite/gdb.threads/tls-sepdebug.exp b/gdb/testsuite/gdb.threads/tls-sepdebug.exp
index 14a0c45c7d9..4a322e05fc0 100644
--- a/gdb/testsuite/gdb.threads/tls-sepdebug.exp
+++ b/gdb/testsuite/gdb.threads/tls-sepdebug.exp
@@ -65,16 +65,21 @@ if  { [gdb_compile_pthreads \
 }
 
 set absdir [file dirname [standard_output_file ${binsharedbase}]]
+if { [info exists ::env(LD_LIBRARY_PATH)] } {
+    set ld_library_path $::env(LD_LIBRARY_PATH)
+} else {
+    set ld_library_path ""
+}
 
-foreach ld_library_path [list $absdir [relative_filename [pwd] $absdir]] \
+foreach library_path [list $absdir [relative_filename [pwd] $absdir]] \
 	name { absolute relative } {
     with_test_prefix $name {
 
 	# Restart, but defer loading until after setting LD_LIBRARY_PATH.
 	clean_restart
-
-	gdb_test_no_output "set env LD_LIBRARY_PATH=$ld_library_path" \
-			   "set env LD_LIBRARY_PATH"
+	gdb_test_no_output \
+	    "set env LD_LIBRARY_PATH=$ld_library_path:$library_path" \
+	    "set env LD_LIBRARY_PATH"
 
 	gdb_load ${binmainfile}


More information about the Gdb-cvs mailing list