[gdb/testsuite] Use shlib gdb_compile option in gdb.base/skip-solib.exp
authorTom de Vries <tdevries@suse.de>
Tue, 7 Mar 2023 14:45:47 +0000 (15:45 +0100)
committerTom de Vries <tdevries@suse.de>
Tue, 7 Mar 2023 14:45:47 +0000 (15:45 +0100)
In test-case gdb.base/skip-solib.exp the linking against a shared library is
done manually:
...
if {[gdb_compile "${binfile_main}.o" "${binfile_main}" executable \
        [list debug "additional_flags=-L$testobjdir" \
             "additional_flags=-l${test}" \
             "ldflags=-Wl,-rpath=$testobjdir"]] != ""} {
...

Instead, use the shlib gdb_compile option such that we simply have:
...
        [list debug shlib=$binfile_lib]] != ""} {
...

Tested on x86_64-linux.

gdb/testsuite/gdb.base/skip-solib.exp

index 3cdb455bb595823a81e2c1d489ea4b5162fce5c6..f01196c3fed180ded8a6722a309d6c58ba458484 100644 (file)
@@ -51,9 +51,7 @@ if {[gdb_compile "${srcdir}/${subdir}/${srcfile_main}" "${binfile_main}.o" \
 
 set testobjdir [standard_output_file {}]
 if {[gdb_compile "${binfile_main}.o" "${binfile_main}" executable \
-        [list debug "additional_flags=-L$testobjdir" \
-             "additional_flags=-l${test}" \
-             "ldflags=-Wl,-rpath=$testobjdir"]] != ""} {
+        [list debug shlib=$binfile_lib]] != ""} {
     return -1
 }