Rename lookup_symbol_static to lookup_symbol_in_static_block,
[deliverable/binutils-gdb.git] / gdb / cp-namespace.c
index 03eb6a952e8e874893601afa7ce2d34995f733e1..76ffee231d9a24e5ac2b9aab87b076d48a93fb9b 100644 (file)
@@ -23,7 +23,6 @@
 #include "gdb_obstack.h"
 #include "symtab.h"
 #include "symfile.h"
-#include "gdb_assert.h"
 #include "block.h"
 #include "objfiles.h"
 #include "gdbtypes.h"
@@ -616,7 +615,7 @@ lookup_symbol_file (const char *name,
 {
   struct symbol *sym = NULL;
 
-  sym = lookup_symbol_static (name, block, domain);
+  sym = lookup_symbol_in_static_block (name, block, domain);
   if (sym != NULL)
     return sym;
 
@@ -669,6 +668,11 @@ lookup_symbol_file (const char *name,
            }
 
          type = check_typedef (TYPE_TARGET_TYPE (SYMBOL_TYPE (this)));
+         /* If TYPE_NAME is NULL, abandon trying to find this symbol.
+            This can happen for lambda functions compiled with clang++,
+            which outputs no name for the container class.  */
+         if (TYPE_NAME (type) == NULL)
+           return NULL;
          klass = xstrdup (TYPE_NAME (type));
          nested = xstrdup (name);
        }
@@ -767,14 +771,15 @@ find_symbol_in_baseclass (struct type *parent_type, const char *name,
       len = strlen (base_name) + 2 + strlen (name) + 1;
       concatenated_name = xrealloc (concatenated_name, len);
       xsnprintf (concatenated_name, len, "%s::%s", base_name, name);
-      sym = lookup_symbol_static (concatenated_name, block, VAR_DOMAIN);
+      sym = lookup_symbol_in_static_block (concatenated_name, block,
+                                          VAR_DOMAIN);
       if (sym != NULL)
        break;
 
       /* Nope.  We now have to search all static blocks in all objfiles,
         even if block != NULL, because there's no guarantees as to which
         symtab the symbol we want is in.  */
-      sym = lookup_static_symbol_aux (concatenated_name, VAR_DOMAIN);
+      sym = lookup_static_symbol (concatenated_name, VAR_DOMAIN);
       if (sym != NULL)
        break;
 
@@ -845,7 +850,7 @@ cp_lookup_nested_symbol (struct type *parent_type,
        concatenated_name = alloca (size);
        xsnprintf (concatenated_name, size, "%s::%s",
                 parent_name, nested_name);
-       sym = lookup_static_symbol_aux (concatenated_name, VAR_DOMAIN);
+       sym = lookup_static_symbol (concatenated_name, VAR_DOMAIN);
        if (sym != NULL)
          return sym;
 
This page took 0.030576 seconds and 4 git commands to generate.