Skip to content

Commit

Permalink
[gdb/testsuite] Add wait-for-index-cache in gdb.dwarf2/per-bfd-sharin…
Browse files Browse the repository at this point in the history
…g.exp

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
  • Loading branch information
vries committed Oct 26, 2023
1 parent 35ce3b8 commit 743d3f0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions gdb/testsuite/gdb.dwarf2/per-bfd-sharing.exp
Original file line number Diff line number Diff line change
Expand Up @@ -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 } {
Expand Down

0 comments on commit 743d3f0

Please sign in to comment.