Fix -Werror -Wuninitialized warnings.
[deliverable/binutils-gdb.git] / gdb / symtab.c
index 832fb019a9016c97e5696cf5385b4ed92296dbd9..515612e5ba66f5ec797761c6e2cc95010d978046 100644 (file)
@@ -1,5 +1,6 @@
 /* Symbol table lookup for the GNU debugger, GDB.
-   Copyright 1986, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1998
+   Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+   1996, 1997, 1998, 1999, 2000, 2001
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -949,8 +950,8 @@ lookup_symbol_aux (const char *name, const struct block *block,
                   && MSYMBOL_TYPE (msymbol) != mst_file_text
                   && !STREQ (name, SYMBOL_NAME (msymbol)))
            {
-             return lookup_symbol (SYMBOL_NAME (msymbol), block,
-                                   namespace, is_a_field_of_this, symtab);
+             return lookup_symbol_aux (SYMBOL_NAME (msymbol), block,
+                                       namespace, is_a_field_of_this, symtab);
            }
        }
     }
@@ -998,7 +999,7 @@ lookup_partial_symbol (struct partial_symtab *pst, const char *name, int global,
        {
          center = bottom + (top - bottom) / 2;
          if (!(center < top))
-           abort ();
+           internal_error (__FILE__, __LINE__, "failed internal consistency check");
          if (!do_linear_search
              && (SYMBOL_LANGUAGE (*center) == language_java))
            {
@@ -1014,7 +1015,7 @@ lookup_partial_symbol (struct partial_symtab *pst, const char *name, int global,
            }
        }
       if (!(top == bottom))
-       abort ();
+       internal_error (__FILE__, __LINE__, "failed internal consistency check");
 
       /* djb - 2000-06-03 - Use SYMBOL_MATCHES_NAME, not a strcmp, so
         we don't have to force a linear search on C++. Probably holds true
@@ -1259,8 +1260,11 @@ lookup_block_symbol (register const struct block *block, const char *name,
       while (bot < top)
        {
          sym = BLOCK_SYM (block, bot);
-         if (SYMBOL_MATCHES_NAME (sym, name))
-           return sym;
+         if (SYMBOL_NAMESPACE (sym) == namespace &&
+             SYMBOL_MATCHES_NAME (sym, name))
+           {
+             return sym;
+           }
          bot++;
        }
     }
@@ -2345,7 +2349,7 @@ search_symbols (char *regexp, namespace_enum kind, int nfiles, char *files[],
   struct symbol_search *tail;
   struct cleanup *old_chain = NULL;
 
-  if (kind < LABEL_NAMESPACE)
+  if (kind < VARIABLES_NAMESPACE)
     error ("must search on specific namespace");
 
   ourtype = types[(int) (kind - VARIABLES_NAMESPACE)];
This page took 0.025512 seconds and 4 git commands to generate.