List the frame unwinders currently in effect, starting with the highest
priority.
+maintenance wait-for-index-cache
+ Wait until all pending writes to the index cache have completed.
+
set always-read-ctf on|off
show always-read-ctf
When off, CTF is only read if DWARF is not present. When on, CTF is
For platforms that do support creating the backtrace this feature is
@code{on} by default.
+@kindex maint wait-for-index-cache
+@item maint wait-for-index-cache
+Wait until all pending writes to the index cache have completed. This
+is used by the test suite to avoid races when the index cache is being
+updated by a worker thread.
+
@kindex maint with
@item maint with @var{setting} [@var{value}] [-- @var{command}]
Like the @code{with} command, but works with @code{maintenance set}
#include "gdbsupport/selftest.h"
#include <chrono>
#include <unordered_set>
+#include "cli/cli-cmds.h"
/* We don't want gdb to exit while it is in the process of writing to
the index cache. So, all live cooked index vectors are stored
item->wait_completely ();
}
+/* A maint command to wait for the cache. */
+
+static void
+maintenance_wait_for_index_cache (const char *args, int from_tty)
+{
+ wait_for_index_cache (0);
+}
+
void _initialize_cooked_index ();
void
_initialize_cooked_index ()
selftests::register_test ("cooked_index_entry::compare", test_compare);
#endif
+ add_cmd ("wait-for-index-cache", class_maintenance,
+ maintenance_wait_for_index_cache, _("\
+Usage: maintenance wait-for-index-cache\n\
+Wait until all pending writes to the index cache have completed."),
+ &maintenancelist);
+
gdb::observers::gdb_exiting.attach (wait_for_index_cache, "cooked-index");
}
clean_restart ${testfile}
+ # The tests generally want to check the cache, so make sure it
+ # has completed its work.
+ gdb_test_no_output "maintenance wait-for-index-cache"
+
uplevel 1 $code
}
}
global expecting_index_cache_use
# Just to populate the cache.
- run_test_with_flags $cache_dir on {}
+ with_test_prefix "populate cache" {
+ run_test_with_flags $cache_dir on {}
+ }
lassign [ls_host $cache_dir] ret files_before