]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Clear Ada symbol cache
authorTom Tromey <tromey@adacore.com>
Wed, 4 Sep 2024 16:32:00 +0000 (10:32 -0600)
committerTom Tromey <tromey@adacore.com>
Fri, 6 Sep 2024 17:08:41 +0000 (11:08 -0600)
This patch changes "maint flush symbol-cache" to also flush the
Ada-specific symbol cache.  This can be helpful when working on the
Ada code.

Approved-By: Tom de Vries <tdevries@suse.de>
gdb/ada-lang.c
gdb/ada-lang.h
gdb/symtab.c

index d77fa3c54b801cc138e22dfdab88cee9b2cfc617..51112a1ab021b6087410cd83d5d657d4ff79a93b 100644 (file)
@@ -4690,9 +4690,9 @@ make_array_descriptor (struct type *type, struct value *arr)
    even in this case, some expensive name-based symbol searches are still
    sometimes necessary - to find an XVZ variable, mostly.  */
 
-/* Clear all entries from the symbol cache.  */
+/* See ada-lang.h.  */
 
-static void
+void
 ada_clear_symbol_cache (program_space *pspace)
 {
   ada_pspace_data_handle.clear (pspace);
index 77193ef78b4485761981c99b42489446e8f4d686..050d2980203a2a5eb33c32d259cb819eaebcdec5 100644 (file)
@@ -433,4 +433,8 @@ extern block_symbol ada_resolve_variable (struct symbol *sym,
 extern struct type *ada_index_type (struct type *type, int n,
                                    const char *name);
 
+/* Clear the Ada symbol cache.  */
+
+extern void ada_clear_symbol_cache (program_space *pspace);
+
 #endif
index ce5e2520bd174aa4a7e3a52b5b2eefa36815575d..b955cc873e26faafe4935924a89222f56625e989 100644 (file)
@@ -1563,6 +1563,7 @@ symbol_cache_mark_not_found (struct block_symbol_cache *bsc,
 static void
 symbol_cache_flush (struct program_space *pspace)
 {
+  ada_clear_symbol_cache (pspace);
   struct symbol_cache *cache = symbol_cache_key.get (pspace);
   int pass;