Blame SOURCES/gdb-rhbz1560010-fix-assertion-symbol-language-dict-language-2of5.patch

4c2ad1
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
4c2ad1
From: Sergio Durigan Junior <sergiodj@redhat.com>
4c2ad1
Date: Fri, 11 Jan 2019 11:25:11 -0500
4c2ad1
Subject: 
4c2ad1
 gdb-rhbz1560010-fix-assertion-symbol-language-dict-language-2of5.patch
4c2ad1
4c2ad1
;; Fix 'Assertion `SYMBOL_LANGUAGE (sym) == DICT_LANGUAGE (dict)->la_language' failed.'
4c2ad1
;; Keith Seitz, RHBZ#1560010.
4c2ad1
4c2ad1
gdb/23712: Use new multidictionary API
4c2ad1
4c2ad1
This patch builds on the previous by enabling the `new' multidictionary
4c2ad1
API.  A lot of the hunks are simply textual replacements of "dict_"
4c2ad1
with "mdict_" and similar transformations.
4c2ad1
4c2ad1
A word of warning, even with the use of multidictionaries, the code
4c2ad1
still does not satisfactorily fix the reported problems with gdb/23712
4c2ad1
(or gdb/23010). We still have additional changes to make before that
4c2ad1
happens.
4c2ad1
4c2ad1
gdb/ChangeLog:
4c2ad1
4c2ad1
	PR gdb/23712
4c2ad1
	PR symtab/23010
4c2ad1
	* dictionary.h (struct dictionary): Replace declaration with
4c2ad1
	multidictionary.
4c2ad1
	(dict_create_hashed, dict_create_hashed_expandable)
4c2ad1
	(dict_create_linear, dict_create_linear_expandable)
4c2ad1
	(dict_free, dict_add_symbol, dict_add_pending, dict_empty)
4c2ad1
	(dict_iterator_first, dict_iterator_next, dict_iter_match_first)
4c2ad1
	(dict_iter_match_next, dict_size): Rename to "mdict_" versions
4c2ad1
	taking multidictionary argument.
4c2ad1
	[ALL_DICT_SYMBOLS]: Update for multidictionary.
4c2ad1
	* block.h (struct block) <dict>: Change to multidictionary
4c2ad1
	and rename `multidict'.
4c2ad1
	* block.c, buildsym.c, jit.c, mdebugread.c, objfiles.c,
4c2ad1
	symmisc.c: Update all dictionary references to multidictionary.
4c2ad1
4c2ad1
diff --git a/gdb/block.c b/gdb/block.c
4c2ad1
--- a/gdb/block.c
4c2ad1
+++ b/gdb/block.c
4c2ad1
@@ -387,9 +387,9 @@ block_global_block (const struct block *block)
4c2ad1
    zero/NULL.  This is useful for creating "dummy" blocks that don't
4c2ad1
    correspond to actual source files.
4c2ad1
 
4c2ad1
-   Warning: it sets the block's BLOCK_DICT to NULL, which isn't a
4c2ad1
+   Warning: it sets the block's BLOCK_MULTIDICT to NULL, which isn't a
4c2ad1
    valid value.  If you really don't want the block to have a
4c2ad1
-   dictionary, then you should subsequently set its BLOCK_DICT to
4c2ad1
+   dictionary, then you should subsequently set its BLOCK_MULTIDICT to
4c2ad1
    dict_create_linear (obstack, NULL).  */
4c2ad1
 
4c2ad1
 struct block *
4c2ad1
@@ -544,10 +544,11 @@ block_iterator_step (struct block_iterator *iterator, int first)
4c2ad1
 
4c2ad1
 	  block = BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (cust),
4c2ad1
 				     iterator->which);
4c2ad1
-	  sym = dict_iterator_first (BLOCK_DICT (block), &iterator->dict_iter);
4c2ad1
+	  sym = mdict_iterator_first (BLOCK_MULTIDICT (block),
4c2ad1
+				      &iterator->mdict_iter);
4c2ad1
 	}
4c2ad1
       else
4c2ad1
-	sym = dict_iterator_next (&iterator->dict_iter);
4c2ad1
+	sym = mdict_iterator_next (&iterator->mdict_iter);
4c2ad1
 
4c2ad1
       if (sym != NULL)
4c2ad1
 	return sym;
4c2ad1
@@ -569,7 +570,7 @@ block_iterator_first (const struct block *block,
4c2ad1
   initialize_block_iterator (block, iterator);
4c2ad1
 
4c2ad1
   if (iterator->which == FIRST_LOCAL_BLOCK)
4c2ad1
-    return dict_iterator_first (block->dict, &iterator->dict_iter);
4c2ad1
+    return mdict_iterator_first (block->multidict, &iterator->mdict_iter);
4c2ad1
 
4c2ad1
   return block_iterator_step (iterator, 1);
4c2ad1
 }
4c2ad1
@@ -580,7 +581,7 @@ struct symbol *
4c2ad1
 block_iterator_next (struct block_iterator *iterator)
4c2ad1
 {
4c2ad1
   if (iterator->which == FIRST_LOCAL_BLOCK)
4c2ad1
-    return dict_iterator_next (&iterator->dict_iter);
4c2ad1
+    return mdict_iterator_next (&iterator->mdict_iter);
4c2ad1
 
4c2ad1
   return block_iterator_step (iterator, 0);
4c2ad1
 }
4c2ad1
@@ -612,11 +613,11 @@ block_iter_match_step (struct block_iterator *iterator,
4c2ad1
 
4c2ad1
 	  block = BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (cust),
4c2ad1
 				     iterator->which);
4c2ad1
-	  sym = dict_iter_match_first (BLOCK_DICT (block), name,
4c2ad1
-				       &iterator->dict_iter);
4c2ad1
+	  sym = mdict_iter_match_first (BLOCK_MULTIDICT (block), name,
4c2ad1
+					&iterator->mdict_iter);
4c2ad1
 	}
4c2ad1
       else
4c2ad1
-	sym = dict_iter_match_next (name, &iterator->dict_iter);
4c2ad1
+	sym = mdict_iter_match_next (name, &iterator->mdict_iter);
4c2ad1
 
4c2ad1
       if (sym != NULL)
4c2ad1
 	return sym;
4c2ad1
@@ -639,7 +640,8 @@ block_iter_match_first (const struct block *block,
4c2ad1
   initialize_block_iterator (block, iterator);
4c2ad1
 
4c2ad1
   if (iterator->which == FIRST_LOCAL_BLOCK)
4c2ad1
-    return dict_iter_match_first (block->dict, name, &iterator->dict_iter);
4c2ad1
+    return mdict_iter_match_first (block->multidict, name,
4c2ad1
+				   &iterator->mdict_iter);
4c2ad1
 
4c2ad1
   return block_iter_match_step (iterator, name, 1);
4c2ad1
 }
4c2ad1
@@ -651,7 +653,7 @@ block_iter_match_next (const lookup_name_info &name,
4c2ad1
 		       struct block_iterator *iterator)
4c2ad1
 {
4c2ad1
   if (iterator->which == FIRST_LOCAL_BLOCK)
4c2ad1
-    return dict_iter_match_next (name, &iterator->dict_iter);
4c2ad1
+    return mdict_iter_match_next (name, &iterator->mdict_iter);
4c2ad1
 
4c2ad1
   return block_iter_match_step (iterator, name, 0);
4c2ad1
 }
4c2ad1
@@ -731,7 +733,7 @@ block_lookup_symbol_primary (const struct block *block, const char *name,
4c2ad1
 			     const domain_enum domain)
4c2ad1
 {
4c2ad1
   struct symbol *sym, *other;
4c2ad1
-  struct dict_iterator dict_iter;
4c2ad1
+  struct mdict_iterator mdict_iter;
4c2ad1
 
4c2ad1
   lookup_name_info lookup_name (name, symbol_name_match_type::FULL);
4c2ad1
 
4c2ad1
@@ -740,9 +742,10 @@ block_lookup_symbol_primary (const struct block *block, const char *name,
4c2ad1
 	      || BLOCK_SUPERBLOCK (BLOCK_SUPERBLOCK (block)) == NULL);
4c2ad1
 
4c2ad1
   other = NULL;
4c2ad1
-  for (sym = dict_iter_match_first (block->dict, lookup_name, &dict_iter);
4c2ad1
+  for (sym
4c2ad1
+	 = mdict_iter_match_first (block->multidict, lookup_name, &mdict_iter);
4c2ad1
        sym != NULL;
4c2ad1
-       sym = dict_iter_match_next (lookup_name, &dict_iter))
4c2ad1
+       sym = mdict_iter_match_next (lookup_name, &mdict_iter))
4c2ad1
     {
4c2ad1
       if (SYMBOL_DOMAIN (sym) == domain)
4c2ad1
 	return sym;
4c2ad1
diff --git a/gdb/block.h b/gdb/block.h
4c2ad1
--- a/gdb/block.h
4c2ad1
+++ b/gdb/block.h
4c2ad1
@@ -111,7 +111,7 @@ struct block
4c2ad1
 
4c2ad1
   /* This is used to store the symbols in the block.  */
4c2ad1
 
4c2ad1
-  struct dictionary *dict;
4c2ad1
+  struct multidictionary *multidict;
4c2ad1
 
4c2ad1
   /* Contains information about namespace-related info relevant to this block:
4c2ad1
      using directives and the current namespace scope.  */
4c2ad1
@@ -143,7 +143,7 @@ struct global_block
4c2ad1
 #define BLOCK_END(bl)		(bl)->endaddr
4c2ad1
 #define BLOCK_FUNCTION(bl)	(bl)->function
4c2ad1
 #define BLOCK_SUPERBLOCK(bl)	(bl)->superblock
4c2ad1
-#define BLOCK_DICT(bl)		(bl)->dict
4c2ad1
+#define BLOCK_MULTIDICT(bl)	(bl)->multidict
4c2ad1
 #define BLOCK_NAMESPACE(bl)	(bl)->namespace_info
4c2ad1
 
4c2ad1
 /* Accessor for ranges field within block BL.  */
4c2ad1
@@ -298,9 +298,9 @@ struct block_iterator
4c2ad1
 
4c2ad1
   enum block_enum which;
4c2ad1
 
4c2ad1
-  /* The underlying dictionary iterator.  */
4c2ad1
+  /* The underlying multidictionary iterator.  */
4c2ad1
 
4c2ad1
-  struct dict_iterator dict_iter;
4c2ad1
+  struct mdict_iterator mdict_iter;
4c2ad1
 };
4c2ad1
 
4c2ad1
 /* Initialize ITERATOR to point at the first symbol in BLOCK, and
4c2ad1
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
4c2ad1
--- a/gdb/buildsym.c
4c2ad1
+++ b/gdb/buildsym.c
4c2ad1
@@ -349,23 +349,21 @@ finish_block_internal (struct symbol *symbol,
4c2ad1
 
4c2ad1
   if (symbol)
4c2ad1
     {
4c2ad1
-      BLOCK_DICT (block)
4c2ad1
-	= dict_create_linear (&objfile->objfile_obstack,
4c2ad1
-			      buildsym_compunit->language, *listhead);
4c2ad1
+      BLOCK_MULTIDICT (block)
4c2ad1
+	= mdict_create_linear (&objfile->objfile_obstack, *listhead);
4c2ad1
     }
4c2ad1
   else
4c2ad1
     {
4c2ad1
       if (expandable)
4c2ad1
 	{
4c2ad1
-	  BLOCK_DICT (block)
4c2ad1
-	    = dict_create_hashed_expandable (buildsym_compunit->language);
4c2ad1
-	  dict_add_pending (BLOCK_DICT (block), *listhead);
4c2ad1
+	  BLOCK_MULTIDICT (block)
4c2ad1
+	    = mdict_create_hashed_expandable (buildsym_compunit->language);
4c2ad1
+	  mdict_add_pending (BLOCK_MULTIDICT (block), *listhead);
4c2ad1
 	}
4c2ad1
       else
4c2ad1
 	{
4c2ad1
-	  BLOCK_DICT (block) =
4c2ad1
-	    dict_create_hashed (&objfile->objfile_obstack,
4c2ad1
-				buildsym_compunit->language, *listhead);
4c2ad1
+	  BLOCK_MULTIDICT (block) =
4c2ad1
+	    mdict_create_hashed (&objfile->objfile_obstack, *listhead);
4c2ad1
 	}
4c2ad1
     }
4c2ad1
 
4c2ad1
@@ -377,7 +375,7 @@ finish_block_internal (struct symbol *symbol,
4c2ad1
   if (symbol)
4c2ad1
     {
4c2ad1
       struct type *ftype = SYMBOL_TYPE (symbol);
4c2ad1
-      struct dict_iterator iter;
4c2ad1
+      struct mdict_iterator miter;
4c2ad1
       SYMBOL_BLOCK_VALUE (symbol) = block;
4c2ad1
       BLOCK_FUNCTION (block) = symbol;
4c2ad1
 
4c2ad1
@@ -391,7 +389,7 @@ finish_block_internal (struct symbol *symbol,
4c2ad1
 
4c2ad1
 	  /* Here we want to directly access the dictionary, because
4c2ad1
 	     we haven't fully initialized the block yet.  */
4c2ad1
-	  ALL_DICT_SYMBOLS (BLOCK_DICT (block), iter, sym)
4c2ad1
+	  ALL_DICT_SYMBOLS (BLOCK_MULTIDICT (block), miter, sym)
4c2ad1
 	    {
4c2ad1
 	      if (SYMBOL_IS_ARGUMENT (sym))
4c2ad1
 		nparams++;
4c2ad1
@@ -405,7 +403,7 @@ finish_block_internal (struct symbol *symbol,
4c2ad1
 	      iparams = 0;
4c2ad1
 	      /* Here we want to directly access the dictionary, because
4c2ad1
 		 we haven't fully initialized the block yet.  */
4c2ad1
-	      ALL_DICT_SYMBOLS (BLOCK_DICT (block), iter, sym)
4c2ad1
+	      ALL_DICT_SYMBOLS (BLOCK_MULTIDICT (block), miter, sym)
4c2ad1
 		{
4c2ad1
 		  if (iparams == nparams)
4c2ad1
 		    break;
4c2ad1
@@ -1448,7 +1446,7 @@ end_symtab_with_blockvector (struct block *static_block,
4c2ad1
       {
4c2ad1
 	struct block *block = BLOCKVECTOR_BLOCK (blockvector, block_i);
4c2ad1
 	struct symbol *sym;
4c2ad1
-	struct dict_iterator iter;
4c2ad1
+	struct mdict_iterator miter;
4c2ad1
 
4c2ad1
 	/* Inlined functions may have symbols not in the global or
4c2ad1
 	   static symbol lists.  */
4c2ad1
@@ -1459,7 +1457,7 @@ end_symtab_with_blockvector (struct block *static_block,
4c2ad1
 	/* Note that we only want to fix up symbols from the local
4c2ad1
 	   blocks, not blocks coming from included symtabs.  That is why
4c2ad1
 	   we use ALL_DICT_SYMBOLS here and not ALL_BLOCK_SYMBOLS.  */
4c2ad1
-	ALL_DICT_SYMBOLS (BLOCK_DICT (block), iter, sym)
4c2ad1
+	ALL_DICT_SYMBOLS (BLOCK_MULTIDICT (block), miter, sym)
4c2ad1
 	  if (symbol_symtab (sym) == NULL)
4c2ad1
 	    symbol_set_symtab (sym, symtab);
4c2ad1
       }
4c2ad1
@@ -1598,7 +1596,7 @@ augment_type_symtab (void)
4c2ad1
 	 to the primary symtab.  */
4c2ad1
       set_missing_symtab (file_symbols, cust);
4c2ad1
 
4c2ad1
-      dict_add_pending (BLOCK_DICT (block), file_symbols);
4c2ad1
+      mdict_add_pending (BLOCK_MULTIDICT (block), file_symbols);
4c2ad1
     }
4c2ad1
 
4c2ad1
   if (global_symbols != NULL)
4c2ad1
@@ -1609,7 +1607,7 @@ augment_type_symtab (void)
4c2ad1
 	 to the primary symtab.  */
4c2ad1
       set_missing_symtab (global_symbols, cust);
4c2ad1
 
4c2ad1
-      dict_add_pending (BLOCK_DICT (block), global_symbols);
4c2ad1
+      mdict_add_pending (BLOCK_MULTIDICT (block), global_symbols);
4c2ad1
     }
4c2ad1
 
4c2ad1
   reset_symtab_globals ();
4c2ad1
diff --git a/gdb/dictionary.h b/gdb/dictionary.h
4c2ad1
--- a/gdb/dictionary.h
4c2ad1
+++ b/gdb/dictionary.h
4c2ad1
@@ -25,10 +25,10 @@
4c2ad1
 
4c2ad1
 #include "symfile.h"
4c2ad1
 
4c2ad1
-/* An opaque type for dictionaries; only dictionary.c should know
4c2ad1
-   about its innards.  */
4c2ad1
+/* An opaque type for multi-language dictionaries; only dictionary.c should
4c2ad1
+   know about its innards.  */
4c2ad1
 
4c2ad1
-struct dictionary;
4c2ad1
+struct multidictionary;
4c2ad1
 
4c2ad1
 /* Other types needed for declarations.  */
4c2ad1
 
4c2ad1
@@ -38,65 +38,64 @@ struct pending;
4c2ad1
 struct language_defn;
4c2ad1
 
4c2ad1
 /* The creation functions for various implementations of
4c2ad1
-   dictionaries.  */
4c2ad1
+   multi-language dictionaries.  */
4c2ad1
 
4c2ad1
-/* Create a dictionary of symbols of language LANGUAGE implemented via
4c2ad1
+/* Create a multi-language dictionary of symbols implemented via
4c2ad1
    a fixed-size hashtable.  All memory it uses is allocated on
4c2ad1
    OBSTACK; the environment is initialized from SYMBOL_LIST.  */
4c2ad1
 
4c2ad1
-extern struct dictionary *dict_create_hashed (struct obstack *obstack,
4c2ad1
-					      enum language language,
4c2ad1
-					      const struct pending
4c2ad1
-					      *symbol_list);
4c2ad1
+extern struct multidictionary *
4c2ad1
+  mdict_create_hashed (struct obstack *obstack,
4c2ad1
+		       const struct pending *symbol_list);
4c2ad1
 
4c2ad1
-/* Create a dictionary of symbols of language LANGUAGE, implemented
4c2ad1
-   via a hashtable that grows as necessary.  The dictionary is
4c2ad1
-   initially empty; to add symbols to it, call dict_add_symbol().
4c2ad1
-   Call dict_free() when you're done with it.  */
4c2ad1
+/* Create a multi-language dictionary of symbols, implemented
4c2ad1
+   via a hashtable that grows as necessary.  The initial dictionary of
4c2ad1
+   LANGUAGE is empty; to add symbols to it, call mdict_add_symbol().
4c2ad1
+   Call mdict_free() when you're done with it.  */
4c2ad1
 
4c2ad1
-extern struct dictionary *
4c2ad1
-  dict_create_hashed_expandable (enum language language);
4c2ad1
+extern struct multidictionary *
4c2ad1
+  mdict_create_hashed_expandable (enum language language);
4c2ad1
 
4c2ad1
-/* Create a dictionary of symbols of language LANGUAGE, implemented
4c2ad1
+/* Create a multi-language dictionary of symbols, implemented
4c2ad1
    via a fixed-size array.  All memory it uses is allocated on
4c2ad1
    OBSTACK; the environment is initialized from the SYMBOL_LIST.  The
4c2ad1
    symbols are ordered in the same order that they're found in
4c2ad1
    SYMBOL_LIST.  */
4c2ad1
 
4c2ad1
-extern struct dictionary *dict_create_linear (struct obstack *obstack,
4c2ad1
-					      enum language language,
4c2ad1
-					      const struct pending
4c2ad1
-					      *symbol_list);
4c2ad1
+extern struct multidictionary *
4c2ad1
+  mdict_create_linear (struct obstack *obstack,
4c2ad1
+		       const struct pending *symbol_list);
4c2ad1
 
4c2ad1
-/* Create a dictionary of symbols of language LANGUAGE, implemented
4c2ad1
-   via an array that grows as necessary.  The dictionary is initially
4c2ad1
-   empty; to add symbols to it, call dict_add_symbol().  Call
4c2ad1
-   dict_free() when you're done with it.  */
4c2ad1
+/* Create a multi-language dictionary of symbols, implemented
4c2ad1
+   via an array that grows as necessary.  The multidictionary initially
4c2ad1
+   contains a single empty dictionary of LANGUAGE; to add symbols to it,
4c2ad1
+   call mdict_add_symbol().  Call mdict_free() when you're done with it.  */
4c2ad1
 
4c2ad1
-extern struct dictionary *
4c2ad1
-  dict_create_linear_expandable (enum language language);
4c2ad1
+extern struct multidictionary *
4c2ad1
+  mdict_create_linear_expandable (enum language language);
4c2ad1
 
4c2ad1
-/* The functions providing the interface to dictionaries.  Note that
4c2ad1
-   the most common parts of the interface, namely symbol lookup, are
4c2ad1
-   only provided via iterator functions.  */
4c2ad1
+/* The functions providing the interface to multi-language dictionaries.
4c2ad1
+   Note that the most common parts of the interface, namely symbol lookup,
4c2ad1
+   are only provided via iterator functions.  */
4c2ad1
 
4c2ad1
-/* Free the memory used by a dictionary that's not on an obstack.  (If
4c2ad1
+/* Free the memory used by a multidictionary that's not on an obstack.  (If
4c2ad1
    any.)  */
4c2ad1
 
4c2ad1
-extern void dict_free (struct dictionary *dict);
4c2ad1
+extern void mdict_free (struct multidictionary *mdict);
4c2ad1
 
4c2ad1
-/* Add a symbol to an expandable dictionary.  */
4c2ad1
+/* Add a symbol to an expandable multidictionary.  */
4c2ad1
 
4c2ad1
-extern void dict_add_symbol (struct dictionary *dict, struct symbol *sym);
4c2ad1
+extern void mdict_add_symbol (struct multidictionary *mdict,
4c2ad1
+			      struct symbol *sym);
4c2ad1
 
4c2ad1
-/* Utility to add a list of symbols to a dictionary.  */
4c2ad1
+/* Utility to add a list of symbols to a multidictionary.  */
4c2ad1
 
4c2ad1
-extern void dict_add_pending (struct dictionary *dict,
4c2ad1
-			      const struct pending *symbol_list);
4c2ad1
+extern void mdict_add_pending (struct multidictionary *mdict,
4c2ad1
+			       const struct pending *symbol_list);
4c2ad1
 
4c2ad1
-/* Is the dictionary empty?  */
4c2ad1
+/* Is the multidictionary empty?  */
4c2ad1
 
4c2ad1
-extern int dict_empty (struct dictionary *dict);
4c2ad1
+extern int mdict_empty (struct multidictionary *mdict);
4c2ad1
 
4c2ad1
 /* A type containing data that is used when iterating over all symbols
4c2ad1
    in a dictionary.  Don't ever look at its innards; this type would
4c2ad1
@@ -128,44 +127,46 @@ struct mdict_iterator
4c2ad1
   unsigned short current_idx;
4c2ad1
 };
4c2ad1
 
4c2ad1
-/* Initialize ITERATOR to point at the first symbol in DICT, and
4c2ad1
-   return that first symbol, or NULL if DICT is empty.  */
4c2ad1
+/* Initialize ITERATOR to point at the first symbol in MDICT, and
4c2ad1
+   return that first symbol, or NULL if MDICT is empty.  */
4c2ad1
 
4c2ad1
-extern struct symbol *dict_iterator_first (const struct dictionary *dict,
4c2ad1
-					   struct dict_iterator *iterator);
4c2ad1
+extern struct symbol *
4c2ad1
+  mdict_iterator_first (const struct multidictionary *mdict,
4c2ad1
+			struct mdict_iterator *miterator);
4c2ad1
 
4c2ad1
-/* Advance ITERATOR, and return the next symbol, or NULL if there are
4c2ad1
+/* Advance MITERATOR, and return the next symbol, or NULL if there are
4c2ad1
    no more symbols.  Don't call this if you've previously received
4c2ad1
-   NULL from dict_iterator_first or dict_iterator_next on this
4c2ad1
+   NULL from mdict_iterator_first or mdict_iterator_next on this
4c2ad1
    iteration.  */
4c2ad1
 
4c2ad1
-extern struct symbol *dict_iterator_next (struct dict_iterator *iterator);
4c2ad1
+extern struct symbol *mdict_iterator_next (struct mdict_iterator *miterator);
4c2ad1
 
4c2ad1
-/* Initialize ITERATOR to point at the first symbol in DICT whose
4c2ad1
+/* Initialize MITERATOR to point at the first symbol in MDICT whose
4c2ad1
    SYMBOL_SEARCH_NAME is NAME, as tested using COMPARE (which must use
4c2ad1
    the same conventions as strcmp_iw and be compatible with any
4c2ad1
    dictionary hashing function), and return that first symbol, or NULL
4c2ad1
    if there are no such symbols.  */
4c2ad1
 
4c2ad1
-extern struct symbol *dict_iter_match_first (const struct dictionary *dict,
4c2ad1
-					     const lookup_name_info &name,
4c2ad1
-					     struct dict_iterator *iterator);
4c2ad1
+extern struct symbol *
4c2ad1
+  mdict_iter_match_first (const struct multidictionary *mdict,
4c2ad1
+			  const lookup_name_info &name,
4c2ad1
+			  struct mdict_iterator *miterator);
4c2ad1
 
4c2ad1
-/* Advance ITERATOR to point at the next symbol in DICT whose
4c2ad1
+/* Advance MITERATOR to point at the next symbol in MDICT whose
4c2ad1
    SYMBOL_SEARCH_NAME is NAME, as tested using COMPARE (see
4c2ad1
    dict_iter_match_first), or NULL if there are no more such symbols.
4c2ad1
    Don't call this if you've previously received NULL from 
4c2ad1
-   dict_iterator_match_first or dict_iterator_match_next on this
4c2ad1
-   iteration.  And don't call it unless ITERATOR was created by a
4c2ad1
-   previous call to dict_iter_match_first with the same NAME and COMPARE.  */
4c2ad1
+   mdict_iterator_match_first or mdict_iterator_match_next on this
4c2ad1
+   iteration.  And don't call it unless MITERATOR was created by a
4c2ad1
+   previous call to mdict_iter_match_first with the same NAME and COMPARE.  */
4c2ad1
 
4c2ad1
-extern struct symbol *dict_iter_match_next (const lookup_name_info &name,
4c2ad1
-					    struct dict_iterator *iterator);
4c2ad1
+extern struct symbol *mdict_iter_match_next (const lookup_name_info &name,
4c2ad1
+					     struct mdict_iterator *miterator);
4c2ad1
 
4c2ad1
-/* Return some notion of the size of the dictionary: the number of
4c2ad1
+/* Return some notion of the size of the multidictionary: the number of
4c2ad1
    symbols if we have that, the number of hash buckets otherwise.  */
4c2ad1
 
4c2ad1
-extern int dict_size (const struct dictionary *dict);
4c2ad1
+extern int mdict_size (const struct multidictionary *mdict);
4c2ad1
 
4c2ad1
 /* Macro to loop through all symbols in a dictionary DICT, in no
4c2ad1
    particular order.  ITER is a struct dict_iterator (NOTE: __not__ a
4c2ad1
@@ -175,8 +176,8 @@ extern int dict_size (const struct dictionary *dict);
4c2ad1
    early by a break if you desire.  */
4c2ad1
 
4c2ad1
 #define ALL_DICT_SYMBOLS(dict, iter, sym)			\
4c2ad1
-	for ((sym) = dict_iterator_first ((dict), &(iter));	\
4c2ad1
+	for ((sym) = mdict_iterator_first ((dict), &(iter));	\
4c2ad1
 	     (sym);						\
4c2ad1
-	     (sym) = dict_iterator_next (&(iter)))
4c2ad1
+	     (sym) = mdict_iterator_next (&(iter)))
4c2ad1
 
4c2ad1
 #endif /* DICTIONARY_H */
4c2ad1
diff --git a/gdb/jit.c b/gdb/jit.c
4c2ad1
--- a/gdb/jit.c
4c2ad1
+++ b/gdb/jit.c
4c2ad1
@@ -651,14 +651,12 @@ finalize_symtab (struct gdb_symtab *stab, struct objfile *objfile)
4c2ad1
   size_t blockvector_size;
4c2ad1
   CORE_ADDR begin, end;
4c2ad1
   struct blockvector *bv;
4c2ad1
-  enum language language;
4c2ad1
 
4c2ad1
   actual_nblocks = FIRST_LOCAL_BLOCK + stab->nblocks;
4c2ad1
 
4c2ad1
   cust = allocate_compunit_symtab (objfile, stab->file_name);
4c2ad1
   allocate_symtab (cust, stab->file_name);
4c2ad1
   add_compunit_symtab_to_objfile (cust);
4c2ad1
-  language = compunit_language (cust);
4c2ad1
 
4c2ad1
   /* JIT compilers compile in memory.  */
4c2ad1
   COMPUNIT_DIRNAME (cust) = NULL;
4c2ad1
@@ -702,8 +700,8 @@ finalize_symtab (struct gdb_symtab *stab, struct objfile *objfile)
4c2ad1
 					   TARGET_CHAR_BIT,
4c2ad1
 					   "void");
4c2ad1
 
4c2ad1
-      BLOCK_DICT (new_block) = dict_create_linear (&objfile->objfile_obstack,
4c2ad1
-						   language, NULL);
4c2ad1
+      BLOCK_MULTIDICT (new_block)
4c2ad1
+	= mdict_create_linear (&objfile->objfile_obstack, NULL);
4c2ad1
       /* The address range.  */
4c2ad1
       BLOCK_START (new_block) = (CORE_ADDR) gdb_block_iter->begin;
4c2ad1
       BLOCK_END (new_block) = (CORE_ADDR) gdb_block_iter->end;
4c2ad1
@@ -740,8 +738,8 @@ finalize_symtab (struct gdb_symtab *stab, struct objfile *objfile)
4c2ad1
       new_block = (i == GLOBAL_BLOCK
4c2ad1
 		   ? allocate_global_block (&objfile->objfile_obstack)
4c2ad1
 		   : allocate_block (&objfile->objfile_obstack));
4c2ad1
-      BLOCK_DICT (new_block) = dict_create_linear (&objfile->objfile_obstack,
4c2ad1
-						   language, NULL);
4c2ad1
+      BLOCK_MULTIDICT (new_block)
4c2ad1
+	= mdict_create_linear (&objfile->objfile_obstack, NULL);
4c2ad1
       BLOCK_SUPERBLOCK (new_block) = block_iter;
4c2ad1
       block_iter = new_block;
4c2ad1
 
4c2ad1
diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c
4c2ad1
--- a/gdb/mdebugread.c
4c2ad1
+++ b/gdb/mdebugread.c
4c2ad1
@@ -4534,7 +4534,7 @@ static void
4c2ad1
 add_symbol (struct symbol *s, struct symtab *symtab, struct block *b)
4c2ad1
 {
4c2ad1
   symbol_set_symtab (s, symtab);
4c2ad1
-  dict_add_symbol (BLOCK_DICT (b), s);
4c2ad1
+  mdict_add_symbol (BLOCK_MULTIDICT (b), s);
4c2ad1
 }
4c2ad1
 
4c2ad1
 /* Add a new block B to a symtab S.  */
4c2ad1
@@ -4762,7 +4762,7 @@ new_bvect (int nblocks)
4c2ad1
 }
4c2ad1
 
4c2ad1
 /* Allocate and zero a new block of language LANGUAGE, and set its
4c2ad1
-   BLOCK_DICT.  If function is non-zero, assume the block is
4c2ad1
+   BLOCK_MULTIDICT.  If function is non-zero, assume the block is
4c2ad1
    associated to a function, and make sure that the symbols are stored
4c2ad1
    linearly; otherwise, store them hashed.  */
4c2ad1
 
4c2ad1
@@ -4775,9 +4775,9 @@ new_block (enum block_type type, enum language language)
4c2ad1
   struct block *retval = XCNEW (struct block);
4c2ad1
 
4c2ad1
   if (type == FUNCTION_BLOCK)
4c2ad1
-    BLOCK_DICT (retval) = dict_create_linear_expandable (language);
4c2ad1
+    BLOCK_MULTIDICT (retval) = mdict_create_linear_expandable (language);
4c2ad1
   else
4c2ad1
-    BLOCK_DICT (retval) = dict_create_hashed_expandable (language);
4c2ad1
+    BLOCK_MULTIDICT (retval) = mdict_create_hashed_expandable (language);
4c2ad1
 
4c2ad1
   return retval;
4c2ad1
 }
4c2ad1
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
4c2ad1
--- a/gdb/objfiles.c
4c2ad1
+++ b/gdb/objfiles.c
4c2ad1
@@ -813,40 +813,40 @@ objfile_relocate1 (struct objfile *objfile,
4c2ad1
     }
4c2ad1
 
4c2ad1
     ALL_OBJFILE_COMPUNITS (objfile, cust)
4c2ad1
-    {
4c2ad1
-      const struct blockvector *bv = COMPUNIT_BLOCKVECTOR (cust);
4c2ad1
-      int block_line_section = COMPUNIT_BLOCK_LINE_SECTION (cust);
4c2ad1
-
4c2ad1
-      if (BLOCKVECTOR_MAP (bv))
4c2ad1
-	addrmap_relocate (BLOCKVECTOR_MAP (bv),
4c2ad1
-			  ANOFFSET (delta, block_line_section));
4c2ad1
-
4c2ad1
-      for (i = 0; i < BLOCKVECTOR_NBLOCKS (bv); ++i)
4c2ad1
-	{
4c2ad1
-	  struct block *b;
4c2ad1
-	  struct symbol *sym;
4c2ad1
-	  struct dict_iterator iter;
4c2ad1
-
4c2ad1
-	  b = BLOCKVECTOR_BLOCK (bv, i);
4c2ad1
-	  BLOCK_START (b) += ANOFFSET (delta, block_line_section);
4c2ad1
-	  BLOCK_END (b) += ANOFFSET (delta, block_line_section);
4c2ad1
-
4c2ad1
-	  if (BLOCK_RANGES (b) != nullptr)
4c2ad1
-	    for (int j = 0; j < BLOCK_NRANGES (b); j++)
4c2ad1
+      {
4c2ad1
+	const struct blockvector *bv = COMPUNIT_BLOCKVECTOR (cust);
4c2ad1
+	int block_line_section = COMPUNIT_BLOCK_LINE_SECTION (cust);
4c2ad1
+
4c2ad1
+	if (BLOCKVECTOR_MAP (bv))
4c2ad1
+	  addrmap_relocate (BLOCKVECTOR_MAP (bv),
4c2ad1
+			    ANOFFSET (delta, block_line_section));
4c2ad1
+
4c2ad1
+	for (int i = 0; i < BLOCKVECTOR_NBLOCKS (bv); ++i)
4c2ad1
+	  {
4c2ad1
+	    struct block *b;
4c2ad1
+	    struct symbol *sym;
4c2ad1
+	    struct mdict_iterator miter;
4c2ad1
+
4c2ad1
+	    b = BLOCKVECTOR_BLOCK (bv, i);
4c2ad1
+	    BLOCK_START (b) += ANOFFSET (delta, block_line_section);
4c2ad1
+	    BLOCK_END (b) += ANOFFSET (delta, block_line_section);
4c2ad1
+
4c2ad1
+	    if (BLOCK_RANGES (b) != nullptr)
4c2ad1
+	      for (int j = 0; j < BLOCK_NRANGES (b); j++)
4c2ad1
+		{
4c2ad1
+		  BLOCK_RANGE_START (b, j)
4c2ad1
+		    += ANOFFSET (delta, block_line_section);
4c2ad1
+		  BLOCK_RANGE_END (b, j) += ANOFFSET (delta, block_line_section);
4c2ad1
+		}
4c2ad1
+
4c2ad1
+	    /* We only want to iterate over the local symbols, not any
4c2ad1
+	       symbols in included symtabs.  */
4c2ad1
+	    ALL_DICT_SYMBOLS (BLOCK_MULTIDICT (b), miter, sym)
4c2ad1
 	      {
4c2ad1
-		BLOCK_RANGE_START (b, j)
4c2ad1
-		  += ANOFFSET (delta, block_line_section);
4c2ad1
-		BLOCK_RANGE_END (b, j) += ANOFFSET (delta, block_line_section);
4c2ad1
+		relocate_one_symbol (sym, objfile, delta);
4c2ad1
 	      }
4c2ad1
-
4c2ad1
-	  /* We only want to iterate over the local symbols, not any
4c2ad1
-	     symbols in included symtabs.  */
4c2ad1
-	  ALL_DICT_SYMBOLS (BLOCK_DICT (b), iter, sym)
4c2ad1
-	    {
4c2ad1
-	      relocate_one_symbol (sym, objfile, delta);
4c2ad1
-	    }
4c2ad1
-	}
4c2ad1
-    }
4c2ad1
+	  }
4c2ad1
+      }
4c2ad1
   }
4c2ad1
 
4c2ad1
   /* Relocate isolated symbols.  */
4c2ad1
diff --git a/gdb/symmisc.c b/gdb/symmisc.c
4c2ad1
--- a/gdb/symmisc.c
4c2ad1
+++ b/gdb/symmisc.c
4c2ad1
@@ -275,7 +275,7 @@ dump_symtab_1 (struct symtab *symtab, struct ui_file *outfile)
4c2ad1
   struct objfile *objfile = SYMTAB_OBJFILE (symtab);
4c2ad1
   struct gdbarch *gdbarch = get_objfile_arch (objfile);
4c2ad1
   int i;
4c2ad1
-  struct dict_iterator iter;
4c2ad1
+  struct mdict_iterator miter;
4c2ad1
   int len;
4c2ad1
   struct linetable *l;
4c2ad1
   const struct blockvector *bv;
4c2ad1
@@ -331,7 +331,7 @@ dump_symtab_1 (struct symtab *symtab, struct ui_file *outfile)
4c2ad1
 	     even if we're using a hashtable, but nothing else but this message
4c2ad1
 	     wants it.  */
4c2ad1
 	  fprintf_filtered (outfile, ", %d syms/buckets in ",
4c2ad1
-			    dict_size (BLOCK_DICT (b)));
4c2ad1
+			    mdict_size (BLOCK_MULTIDICT (b)));
4c2ad1
 	  fputs_filtered (paddress (gdbarch, BLOCK_START (b)), outfile);
4c2ad1
 	  fprintf_filtered (outfile, "..");
4c2ad1
 	  fputs_filtered (paddress (gdbarch, BLOCK_END (b)), outfile);
4c2ad1
@@ -349,7 +349,7 @@ dump_symtab_1 (struct symtab *symtab, struct ui_file *outfile)
4c2ad1
 	  /* Now print each symbol in this block (in no particular order, if
4c2ad1
 	     we're using a hashtable).  Note that we only want this
4c2ad1
 	     block, not any blocks from included symtabs.  */
4c2ad1
-	  ALL_DICT_SYMBOLS (BLOCK_DICT (b), iter, sym)
4c2ad1
+	  ALL_DICT_SYMBOLS (BLOCK_MULTIDICT (b), miter, sym)
4c2ad1
 	    {
4c2ad1
 	      TRY
4c2ad1
 		{