Fix tagged pointer support
[deliverable/binutils-gdb.git] / gdb / dictionary.c
index 8277c5d7263d61d6e6fbc081347c71376ec71de1..da8b7da2085ed775b4cd80c7c83d3ff243171a33 100644 (file)
@@ -1,6 +1,6 @@
 /* Routines for name->symbol lookups in GDB.
    
-   Copyright (C) 2003-2017 Free Software Foundation, Inc.
+   Copyright (C) 2003-2018 Free Software Foundation, Inc.
 
    Contributed by David Carlton <carlton@bactrian.org> and by Kealia,
    Inc.
@@ -26,6 +26,7 @@
 #include "symtab.h"
 #include "buildsym.h"
 #include "dictionary.h"
+#include "safe-ctype.h"
 
 /* This file implements dictionaries, which are tables that associate
    symbols to names.  They are represented by an opaque type 'struct
@@ -630,7 +631,7 @@ iter_match_first_hashed (const struct dictionary *dict,
   unsigned int hash_index = (name.search_name_hash (lang->la_language)
                             % DICT_HASHED_NBUCKETS (dict));
   symbol_name_matcher_ftype *matches_name
-    = language_get_symbol_name_matcher (lang, name);
+    = get_symbol_name_matcher (lang, name);
   struct symbol *sym;
 
   DICT_ITERATOR_DICT (iterator) = dict;
@@ -658,7 +659,7 @@ iter_match_next_hashed (const lookup_name_info &name,
 {
   const language_defn *lang = DICT_LANGUAGE (DICT_ITERATOR_DICT (iterator));
   symbol_name_matcher_ftype *matches_name
-    = language_get_symbol_name_matcher (lang, name);
+    = get_symbol_name_matcher (lang, name);
   struct symbol *next;
 
   for (next = DICT_ITERATOR_CURRENT (iterator)->hash_next;
@@ -790,17 +791,6 @@ default_search_name_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 '$':
@@ -822,14 +812,25 @@ default_search_name_hash (const char *string0)
                return hash;
              hash = 0;
              string += 2;
-             break;
+             continue;
            }
-         /* FALL THROUGH */
-       default:
-         hash = SYMBOL_HASH_NEXT (hash, *string);
-         string += 1;
+         break;
+       case 'T':
+         /* 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;
          break;
        }
+
+      hash = SYMBOL_HASH_NEXT (hash, *string);
+      string += 1;
     }
   return hash;
 }
@@ -874,7 +875,7 @@ iter_match_next_linear (const lookup_name_info &name,
   const struct dictionary *dict = DICT_ITERATOR_DICT (iterator);
   const language_defn *lang = DICT_LANGUAGE (dict);
   symbol_name_matcher_ftype *matches_name
-    = language_get_symbol_name_matcher (lang, name);
+    = get_symbol_name_matcher (lang, name);
 
   int i, nsyms = DICT_LINEAR_NSYMS (dict);
   struct symbol *sym, *retval = NULL;
This page took 0.024932 seconds and 4 git commands to generate.