public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [pushed] [gdb/testsuite] Add wait-for-index-cache in gdb.dwarf2/per-bfd-sharing.exp
@ 2023-10-26  8:35 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2023-10-26  8:35 UTC (permalink / raw)
  To: gdb-patches

If we make writing an index-cache entry very slow by doing this in
index_cache::store:
...
   try
     {
+      sleep (15);
       index_cache_debug ("writing index cache for objfile %s",
 			 bfd_get_filename (per_bfd->obfd));
...
we run into:
...
FAIL: gdb.dwarf2/per-bfd-sharing.exp: \
  couldn't remove files in temporary cache dir
...

The FAIL happens because there is no index-cache entry in the cache dir.

The problem is that gdb is killed (by gdb_exit) before the index-cache entry
is written.

Fix this by using "maint wait-for-index-cache".

Tested on x86_64-linux.

PR testsuite/30528
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30528
---
 gdb/testsuite/gdb.dwarf2/per-bfd-sharing.exp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gdb/testsuite/gdb.dwarf2/per-bfd-sharing.exp b/gdb/testsuite/gdb.dwarf2/per-bfd-sharing.exp
index dd15e881d0c..6875df5867f 100644
--- a/gdb/testsuite/gdb.dwarf2/per-bfd-sharing.exp
+++ b/gdb/testsuite/gdb.dwarf2/per-bfd-sharing.exp
@@ -48,6 +48,7 @@ with_test_prefix "populate index cache" {
 	"set index-cache directory"
     gdb_test_no_output "set index-cache enabled on"
     gdb_test "file $host_binfile" "Reading symbols from .*" "file"
+    gdb_test_no_output "maint wait-for-index-cache"
 }
 
 proc load_binary { method } {

base-commit: 35ce3b813f879da98341b62e1797b6ea2341411c
-- 
2.35.3


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-10-26  8:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-26  8:35 [pushed] [gdb/testsuite] Add wait-for-index-cache in gdb.dwarf2/per-bfd-sharing.exp Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).