constify ui_out_impl
[deliverable/binutils-gdb.git] / gdb / dictionary.c
index 29816921d91fb6cc96ccfd8bf022696dc0ed29c7..a24789abb4bbe8cea34eeac6c43b8f5a579f4f21 100644 (file)
@@ -1,7 +1,6 @@
 /* Routines for name->symbol lookups in GDB.
    
-   Copyright (C) 2003, 2007, 2008, 2009, 2010, 2011
-   Free Software Foundation, Inc.
+   Copyright (C) 2003-2014 Free Software Foundation, Inc.
 
    Contributed by David Carlton <carlton@bactrian.org> and by Kealia,
    Inc.
@@ -499,6 +498,22 @@ dict_add_symbol (struct dictionary *dict, struct symbol *sym)
   (DICT_VECTOR (dict))->add_symbol (dict, sym);
 }
 
+/* Utility to add a list of symbols to a dictionary.
+   DICT must be an expandable dictionary.  */
+
+void
+dict_add_pending (struct dictionary *dict, const struct pending *symbol_list)
+{
+  const struct pending *list;
+  int i;
+
+  for (list = symbol_list; list != NULL; list = list->next)
+    {
+      for (i = 0; i < list->nsyms; ++i)
+       dict_add_symbol (dict, list->symbol[i]);
+    }
+}
+
 /* Initialize ITERATOR to point at the first symbol in DICT, and
    return that first symbol, or NULL if DICT is empty.  */
 
@@ -801,6 +816,17 @@ dict_hash (const char *string0)
   hash = 0;
   while (*string)
     {
+      /* Ignore "TKB" suffixes.
+
+        These are used by Ada for subprograms implementing a task body.
+        For instance for a task T inside package Pck, the name of the
+        subprogram implementing T's body is `pck__tTKB'.  We need to
+        ignore the "TKB" suffix because searches for this task body
+        subprogram are going to be performed using `pck__t' (the encoded
+        version of the natural name `pck.t').  */
+      if (strcmp (string, "TKB") == 0)
+       return hash;
+
       switch (*string)
        {
        case '$':
@@ -826,7 +852,7 @@ dict_hash (const char *string0)
            }
          /* FALL THROUGH */
        default:
-         hash = hash * 67 + *string - 113;
+         hash = SYMBOL_HASH_NEXT (hash, *string);
          string += 1;
          break;
        }
This page took 0.023426 seconds and 4 git commands to generate.