]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Fix timeout in gdb.fortran/info-types.exp
authorTom de Vries <tdevries@suse.de>
Mon, 23 Sep 2024 19:40:16 +0000 (21:40 +0200)
committerTom de Vries <tdevries@suse.de>
Mon, 23 Sep 2024 19:40:16 +0000 (21:40 +0200)
When running the testsuite in an enviroment that simulates a stressed system,
I ran into a timeout in test-case gdb.fortran/info-types.exp:
...
(gdb) info types^M
FAIL: gdb.fortran/info-types.exp: info types (timeout)
...

This is mainly due the presence of glibc debug info.

With it installed, I get:
...
$ time gdb -q -batch -x outputs/gdb.fortran/info-types/gdb.in.1 > /dev/null
real 0m35.969s
user 0m38.231s
sys 0m1.007s
...
and without:
...
$ time gdb -q -batch -x outputs/gdb.fortran/info-types/gdb.in.1 > /dev/null
real 0m4.782s
user 0m5.014s
sys 0m0.304s
...

Fix this by not running to main, which gets us:
...
$ time gdb -q -batch -x outputs/gdb.fortran/info-types/gdb.in.1 > /dev/null
real 0m0.808s
user 0m0.789s
sys 0m0.137s
...

Likewise in gdb.mi/mi-sym-info.exp and gdb.mi/mi-complete.exp.

Tested on x86_64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
gdb/testsuite/gdb.fortran/info-types.exp
gdb/testsuite/gdb.mi/mi-complete.exp
gdb/testsuite/gdb.mi/mi-sym-info.exp

index 52ce7ace89d9e20ceb50a4ba3c90e8e7eb8a81ed..ad2c9889ec91365a7bc1422d5bde434ad7e3874f 100644 (file)
@@ -27,10 +27,8 @@ if { [prepare_for_testing "failed to prepare" $testfile \
     return -1
 }
 
-if { ![fortran_runto_main] } {
-    perror "Could not run to main."
-    return
-}
+# Don't run to main to avoid increasing the search scope to include
+# debug info of shared libraries like libc, libgcc, libgfortran etc.
 
 set integer4 [fortran_int4]
 set integer8 [fortran_int8]
index 91564a43302971e5866d0b6424cdcf5b08849136..7fccaa22545f1bb9c3c103fdcdf4929e2d5315a2 100644 (file)
@@ -28,7 +28,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debu
 
 mi_clean_restart $binfile
 
-mi_runto_main
+# Don't run to main to avoid increasing the search scope to include
+# debug info of shared libraries like glibc, libgcc, etc.
 
 mi_gdb_test "1-complete br" \
             "1\\^done,completion=\"break\",matches=\\\[.*\"break\",.*\"break-range\".*\\\],max_completions_reached=\"0\"" \
index 40c06443509c6adb2781fb046eb95b2050e78b4d..b8db2af0d0ba4c1444da891824540fa4577a0405 100644 (file)
@@ -35,7 +35,8 @@ if {[build_executable "failed to prepare" ${testfile} \
 
 mi_clean_restart $binfile
 
-mi_runto_main
+# Don't run to main to avoid increasing the search scope to include
+# debug info of shared libraries like libc, libgcc, etc.
 
 set qstr "\"\[^\"\]+\""
 set fun_re \