[PATCH] [gdb/testsuite] Fix timeout in gdb.fortran/info-types.exp

Tom de Vries tdevries@suse.de
Sun Sep 22 14:19:36 GMT 2024


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

...

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.fortran/info-types.exp | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/gdb/testsuite/gdb.fortran/info-types.exp b/gdb/testsuite/gdb.fortran/info-types.exp
index 52ce7ace89d..332552b8acd 100644
--- a/gdb/testsuite/gdb.fortran/info-types.exp
+++ b/gdb/testsuite/gdb.fortran/info-types.exp
@@ -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 scope of "info types" to include
+# debug info of shared libraries like libc, libgcc, libgfortran etc.
 
 set integer4 [fortran_int4]
 set integer8 [fortran_int8]

base-commit: 104ee502450af85428012e1d3bde42d033024f22
-- 
2.35.3



More information about the Gdb-patches mailing list