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

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