]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Don't use set auto-solib-add off
authorTom de Vries <tdevries@suse.de>
Mon, 10 Jun 2024 08:43:10 +0000 (10:43 +0200)
committerTom de Vries <tdevries@suse.de>
Mon, 10 Jun 2024 08:43:10 +0000 (10:43 +0200)
In test-case gdb.mi/mi-var-child-f.exp, we have:
...
mi_gdb_test "-gdb-set auto-solib-add off" "\\^done"
mi_runto prog_array
mi_gdb_test "nosharedlibrary" ".*\\^done"
...

This was added to avoid a name clash between the array variable as defined in
gdb.mi/array.f90 and debug info in shared libraries, and used in other places
in the testsuite.

The same workaround is also used to ignore symbols from shared libraries when
excercising for instance a command that prints all symbols.

However, this approach can cause problems for targets like arm that require
symbol info for some libraries like ld.so and libc to fully function.

While absense of debug info for shared libraries should be handled gracefully
(which does need fixing, see PR31817), failure to do so should not result
in failures in unrelated test-cases.

Fix this by removing "set auto-solib-add off".

This ensures that we don't run into PR31817, while the presence of
nosharedlibrary still ensures that in the rest of the test-case we're not
bothered by shared library symbols.

Likewise in other test-cases.

Approved-by: Kevin Buettner <kevinb@redhat.com>
Tested on arm-linux.

14 files changed:
gdb/testsuite/gdb.base/gold-gdb-index.exp
gdb/testsuite/gdb.base/info-types.exp.tcl
gdb/testsuite/gdb.base/print-symbol-loading.exp
gdb/testsuite/gdb.dwarf2/dw2-zero-range.exp
gdb/testsuite/gdb.fortran/allocated.exp
gdb/testsuite/gdb.fortran/array-slices-bad.exp
gdb/testsuite/gdb.fortran/array-slices-sub-slices.exp
gdb/testsuite/gdb.fortran/array-slices.exp
gdb/testsuite/gdb.fortran/info-modules.exp
gdb/testsuite/gdb.fortran/lbound-ubound.exp
gdb/testsuite/gdb.fortran/module.exp
gdb/testsuite/gdb.fortran/subarray.exp
gdb/testsuite/gdb.mi/mi-fortran-modules.exp
gdb/testsuite/gdb.mi/mi-var-child-f.exp

index c9c6598c3faa96b316f268a6c81c576f1f6737a4..0309dd353ad0436af4d3a6f1f190ebd7c71b3e63 100644 (file)
@@ -32,12 +32,12 @@ if { [have_index $binfile] != "gdb_index" } {
     return -1
 }
 
-gdb_test_no_output "set auto-solib-add off"
-
 if {![runto_main]} {
     return 0
 }
 
+gdb_test_no_output "nosharedlibrary"
+
 gdb_test_no_output "set breakpoint pending off"
 gdb_test "break N1::misspelled" "Function \"N1::misspelled\" not defined\."
 
index 69d53b9f8de12398498a62cc78df33f5af42f86e..0a33afedf867c865f6afec7448480f3271af3cc2 100644 (file)
@@ -32,12 +32,13 @@ proc run_test { lang } {
             "${testfile}" $srcfile "debug $lang"]} {
        return -1
     }
-    gdb_test_no_output "set auto-solib-add off"
 
     if ![runto_main] then {
        return 0
     }
 
+    gdb_test_no_output "nosharedlibrary"
+
     set file_re "File .*[string_to_regexp $srcfile]:"
 
     if { $lang == "c++" } {
index b61dba333771a908fc58face501caf9311d69219..b3520f1e032a62986b4f0a243ff51f1005a4bdcb 100644 (file)
@@ -95,10 +95,12 @@ proc test_load_shlib { print_symbol_loading } {
     global gdb_prompt
     with_test_prefix "shlib ${print_symbol_loading}" {
        clean_restart ${binfile}
-       gdb_test_no_output "set auto-solib-add off"
        if ![runto_main] {
            return -1
        }
+
+       gdb_test_no_output "nosharedlibrary"
+
        gdb_test_no_output "set print symbol-loading $print_symbol_loading"
        set test_name "load shared-lib"
        set libc_re \
index 59840b8d0e2bfbf9d61737d84a1c0e0dc61bc840..e2e4f240c8832785561949118ac21ad410c80376 100644 (file)
@@ -29,14 +29,12 @@ proc_with_prefix test_relocated { exec_path lib_path complaint_re readnow_p } {
     clean_restart $exec_path
     gdb_load_shlib $lib_path
 
-    # Don't load the symbols for $lib_path during runto_main.
-    # Instead, we do this afterwards using "sharedlibrary $lib_path".
-    gdb_test_no_output "set auto-solib-add off"
-
     if { ![runto_main] } {
        return
     }
 
+    gdb_test_no_output "nosharedlibrary"
+
     # Test for presence of complaint.
     with_complaints 1 {
        set have_complaint 0
index d8aee441d7f6e6d3ee0c9f784ea165693692aecd..1d87bf76244eddca3708a90d2bfd96acc2dc8f93 100644 (file)
@@ -25,9 +25,6 @@ if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
     return -1
 }
 
-# Avoid shared lib symbols.
-gdb_test_no_output "set auto-solib-add off"
-
 if ![fortran_runto_main] {
     return -1
 }
index 8f23b38599fbdab0b5f00eb0164afcd153a0ba8d..ac4a77d2e399b4a22e3dff09ff5562d23d87f449 100644 (file)
@@ -30,9 +30,6 @@ if {![runto [gdb_get_line_number "First Breakpoint"]]} {
     return -1
 }
 
-# Avoid shared lib symbols.
-gdb_test_no_output "set auto-solib-add off"
-
 # Avoid libc symbols, in particular the 'array' type.
 gdb_test_no_output "nosharedlibrary"
 
index 5bdc7d59f1678d5d673755080718b0773c46af48..5a0f0406afe424bc9749483ea6d8aa1632f9357e 100644 (file)
@@ -25,9 +25,6 @@ if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
     return -1
 }
 
-# Avoid shared lib symbols.
-gdb_test_no_output "set auto-solib-add off"
-
 if ![fortran_runto_main] {
     return -1
 }
index f2928676bf331511a443754ef0f0b68686c13ce3..919a2c6e7ebbc8d871aaf343592b8bf9ba8e97c5 100644 (file)
@@ -58,9 +58,6 @@ proc run_test { repack } {
 
     clean_restart ${binfile}
 
-    # Avoid shared lib symbols.
-    gdb_test_no_output "set auto-solib-add off"
-
     if ![fortran_runto_main] {
        return -1
     }
index e6c515ff70fdff2b2bfe843cc00d3de35c2b5439..c8ae73622237db9419b6295ebebdd6e6e4cfea64 100644 (file)
@@ -28,9 +28,6 @@ if { [prepare_for_testing "failed to prepare" $testfile \
     return -1
 }
 
-# Avoid shared lib symbols.
-gdb_test_no_output "set auto-solib-add off"
-
 if { ![fortran_runto_main] } {
     perror "Could not run to main."
     return
index 01597ca23ff8a08d53dc7c9c4c396083d942e7a7..781d3614f4c32dc6de5a994ae9e7f27319a22f27 100644 (file)
@@ -25,9 +25,6 @@ if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
     return -1
 }
 
-# Avoid shared lib symbols.
-gdb_test_no_output "set auto-solib-add off"
-
 if ![fortran_runto_main] {
     return -1
 }
index eea83ad71f132e398d850071f6e7894539fe17dc..df7ee3b9605ba592ce17acec29b949cef77993e5 100644 (file)
@@ -31,9 +31,6 @@ gdb_test "p modmany::var_i" " = 14" "stopped language detection"
 
 gdb_test "print mod1::var_const" " = 20" "fully qualified name of DW_TAG_constant"
 
-# Avoid shared lib symbols.
-gdb_test_no_output "set auto-solib-add off"
-
 if {![fortran_runto_main]} {
     return
 }
index 1ec80e78fe43c23b06671fbe39e87e8dfe6fcccb..70a7a2345bafb9ee196bee5ff8da50fd1f1119d6 100644 (file)
@@ -27,9 +27,6 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} {
     return -1
 }
 
-# Avoid shared lib symbols.
-gdb_test_no_output "set auto-solib-add off"
-
 if {![fortran_runto_main]} {
     return
 }
index 13996b9547f8cbd13d8e30d61917740040616c2e..5441d8f15e5fa69ec78ea4eb8338bd16b4f7c999 100644 (file)
@@ -30,9 +30,6 @@ if {[build_executable "failed to prepare" ${testfile} \
 
 mi_clean_restart $binfile
 
-# Avoid shared lib symbols.
-mi_gdb_test "-gdb-set auto-solib-add off" "\\^done"
-
 mi_runto_main
 
 # Avoid libc symbols.
index 258cbe7cb40c0e8d3d151be967a5ccdb0673ed16..441c3a09366fcf4258aa44507895ae4349ec5bd1 100644 (file)
@@ -32,9 +32,6 @@ if {[mi_clean_restart $binfile]} {
     return
 }
 
-# Avoid shared lib symbols.
-mi_gdb_test "-gdb-set auto-solib-add off" "\\^done"
-
 mi_runto prog_array
 
 # Avoid libc symbols, in particular the 'array' type.