]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Drop -readnow in three gdb.dwarf2 test-cases
authorTom de Vries <tdevries@suse.de>
Sat, 21 Sep 2024 03:55:18 +0000 (05:55 +0200)
committerTom de Vries <tdevries@suse.de>
Sat, 21 Sep 2024 03:55:18 +0000 (05:55 +0200)
When running the testsuite in an enviroment simulating a stressed system, I
ran into timeouts in three test-cases in gdb.dwarf2:
- gdb.dwarf2/count.exp,
- gdb.dwarf2/implptrconst.exp, and
- gdb.dwarf2/implptrpiece.exp.

In all three cases, -readnow is used which results in symtabs being expanded for
the executable, /lib64/libc.so.6 and /lib64/ld-linux-x86-64.so.2.

We could address this by limiting the scope of -readnow to the executable, but
after reviewing the test-cases there doesn't seem to be a clear reason to use
-readnow.

Fix this by dropping the -readnow.

Tested on x86_64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
gdb/testsuite/gdb.dwarf2/count.exp
gdb/testsuite/gdb.dwarf2/implptrconst.exp
gdb/testsuite/gdb.dwarf2/implptrpiece.exp

index 52deb19146bee34266183282ffe3a13551ef64fb..096e0934d3fac31b9eee4551f3b7bf39fa89c0a2 100644 (file)
@@ -124,25 +124,11 @@ Dwarf::assemble $asm_file {
     }
 }
 
-if { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile}1.o \
-         object {nodebug}] != "" } {
+if { [prepare_for_testing "failed to prepare" $testfile \
+         [list $srcfile $asm_file] {nodebug}] } {
     return -1
 }
 
-if { [gdb_compile $asm_file ${binfile}2.o object {nodebug}] != "" } {
-    return -1
-}
-
-if { [gdb_compile [list ${binfile}1.o ${binfile}2.o] \
-         "${binfile}" executable {}] != "" } {
-    return -1
-}
-
-save_vars { GDBFLAGS } {
-    set GDBFLAGS [concat $GDBFLAGS " -readnow"]
-    clean_restart ${testfile}
-}
-
 if ![runto_main] {
     return -1
 }
index 8e6dbf0d2138563a56b2701620581c31843ddb1a..541331c17ae1c84302eb5c53a82058d48c275a37 100644 (file)
@@ -83,18 +83,11 @@ Dwarf::assemble $asm_file {
     }
 }
 
-if { [build_executable ${testfile}.exp ${testfile} \
+if { [prepare_for_testing "failed to prepare" ${testfile} \
          [list $srcfile $asm_file] {nodebug}] } {
     return -1
 }
 
-# We need --readnow because otherwise we never read in the CU we
-# created above.
-save_vars { GDBFLAGS } {
-    set GDBFLAGS "$GDBFLAGS -readnow"
-    clean_restart ${testfile}
-}
-
 if ![runto_main] {
     return -1
 }
index 585cd7497b6ff5e1df825360b7918adb33a30436..867789f71bc13fd9bda5916766b1d3b2ba2b6970 100644 (file)
@@ -101,18 +101,11 @@ Dwarf::assemble $asm_file {
     }
 }
 
-if { [build_executable ${testfile}.exp ${testfile} \
+if { [prepare_for_testing "failed to prepare" ${testfile} \
          [list $srcfile $asm_file] {nodebug}] } {
     return -1
 }
 
-# We need --readnow because otherwise we never read in the CU we
-# created above.
-save_vars { GDBFLAGS } {
-    set GDBFLAGS "$GDBFLAGS -readnow"
-    clean_restart ${testfile}
-}
-
 if ![runto_main] {
     return -1
 }