Add GPL copyright notices to uncopyrighted files.
[deliverable/binutils-gdb.git] / gdb / symtab.c
index 41c23aa6b1438b7b711afe55aea2d4d95c72dc9a..4e15cbcb35ccab6ed7bd39e3b7d7542f7f7ec433 100644 (file)
@@ -77,9 +77,9 @@ char *operator_chars (char *, char **);
 
 static int find_line_common (struct linetable *, int, int *);
 
-static struct partial_symbol *lookup_partial_symbol PARAMS
-  ((struct partial_symtab *, const char *,
-    int, namespace_enum));
+static struct partial_symbol *lookup_partial_symbol (struct partial_symtab *,
+                                                    const char *, int,
+                                                    namespace_enum);
 
 static struct partial_symbol *fixup_psymbol_section (struct
                                                     partial_symbol *,
@@ -954,7 +954,7 @@ lookup_symbol (name, block, namespace, is_a_field_of_this, symtab)
     *symtab = NULL;
   return 0;
 }
-
+                                                               
 /* Look, in partial_symtab PST, for symbol NAME.  Check the global
    symbols if GLOBAL, the static symbols if not */
 
@@ -965,20 +965,20 @@ lookup_partial_symbol (pst, name, global, namespace)
      int global;
      namespace_enum namespace;
 {
+  struct partial_symbol *temp;
   struct partial_symbol **start, **psym;
   struct partial_symbol **top, **bottom, **center;
   int length = (global ? pst->n_global_syms : pst->n_static_syms);
   int do_linear_search = 1;
-
+  
   if (length == 0)
     {
       return (NULL);
     }
-
   start = (global ?
           pst->objfile->global_psymbols.list + pst->globals_offset :
           pst->objfile->static_psymbols.list + pst->statics_offset);
-
+  
   if (global)                  /* This means we can use a binary search. */
     {
       do_linear_search = 0;
@@ -996,9 +996,7 @@ lookup_partial_symbol (pst, name, global, namespace)
          if (!(center < top))
            abort ();
          if (!do_linear_search
-             && (SYMBOL_LANGUAGE (*center) == language_cplus
-                 || SYMBOL_LANGUAGE (*center) == language_java
-             ))
+             && (SYMBOL_LANGUAGE (*center) == language_java))
            {
              do_linear_search = 1;
            }
@@ -1013,11 +1011,15 @@ lookup_partial_symbol (pst, name, global, namespace)
        }
       if (!(top == bottom))
        abort ();
-      while (STREQ (SYMBOL_NAME (*top), name))
+
+      /* 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
+        for JAVA as well, no way to check.*/
+      while (SYMBOL_MATCHES_NAME (*top,name))
        {
          if (SYMBOL_NAMESPACE (*top) == namespace)
            {
-             return (*top);
+                 return (*top);
            }
          top++;
        }
@@ -1027,7 +1029,7 @@ lookup_partial_symbol (pst, name, global, namespace)
      we should also do a linear search. */
 
   if (do_linear_search)
-    {
+    {                  
       for (psym = start; psym < start + length; psym++)
        {
          if (namespace == SYMBOL_NAMESPACE (*psym))
@@ -1470,10 +1472,9 @@ find_pc_sect_symtab (pc, section)
        /* Might want to error() here (in case symtab is corrupt and
           will cause a core dump), but maybe we can successfully
           continue, so let's not.  */
-       /* FIXME-32x64: assumes pc fits in a long */
        warning ("\
-(Internal error: pc 0x%lx in read in psymtab, but not in symtab.)\n",
-                (unsigned long) pc);
+(Internal error: pc 0x%s in read in psymtab, but not in symtab.)\n",
+                paddr_nz (pc));
       s = PSYMTAB_TO_SYMTAB (ps);
     }
   return (s);
@@ -4018,6 +4019,7 @@ functions_info (regexp, from_tty)
   symtab_symbol_info (regexp, FUNCTIONS_NAMESPACE, from_tty);
 }
 
+
 static void
 types_info (regexp, from_tty)
      char *regexp;
@@ -4664,6 +4666,7 @@ _initialize_symtab ()
   add_info ("functions", functions_info,
            "All function names, or those matching REGEXP.");
 
+  
   /* FIXME:  This command has at least the following problems:
      1.  It prints builtin types (in a very strange and confusing fashion).
      2.  It doesn't print right, e.g. with
This page took 0.02509 seconds and 4 git commands to generate.