2003-05-19 David Carlton <carlton@bactrian.org>
authorDavid Carlton <carlton@bactrian.org>
Tue, 20 May 2003 01:55:18 +0000 (01:55 +0000)
committerDavid Carlton <carlton@bactrian.org>
Tue, 20 May 2003 01:55:18 +0000 (01:55 +0000)
* language.h (struct language_defn): Add 'la_value_of_this'
and 'la_lookup_symbol_nonlocal' members.
* symtab.h: Declare basic_lookup_symbol_nonlocal,
lookup_symbol_static, lookup_symbol_global,
lookup_symbol_aux_block.
* symtab.c (lookup_symbol_aux): Call language hooks to determine
if we should search fields of this and how to do static/global
lookup.
(lookup_symbol_aux_block): Make extern.
(basic_lookup_symbol_nonlocal): New.
(lookup_symbol_static, lookup_symbol_global): Ditto.
* ada-lang.c (ada_language_defn): Set 'la_value_of_this' and
'la_lookup_symbol_nonlocal' members.
* c-lang.c (c_language_defn, cplus_language_defn)
(asm_language_defn, minimal_language_defn): Ditto.
* jv-lang.c (java_language_defn): Ditto.
* language.c (unknown_language_defn, auto_language_defn)
(local_language_defn): Ditto.
* m2-lang.c (m2_language_defn): Ditto.
* objc-lang.c (objc_language_defn): Ditto.
* scm-lang.c (scm_language_defn): Ditto.
* f-lang.c (f_language_defn): Ditto, and include value.h as well.
* p-lang.c (pascal_language_defn): Ditto for both.
* Makefile.in (f-lang.o): Depend on value_h.
(p-lang.o): Ditto.

14 files changed:
gdb/ChangeLog
gdb/Makefile.in
gdb/ada-lang.c
gdb/c-lang.c
gdb/f-lang.c
gdb/jv-lang.c
gdb/language.c
gdb/language.h
gdb/m2-lang.c
gdb/objc-lang.c
gdb/p-lang.c
gdb/scm-lang.c
gdb/symtab.c
gdb/symtab.h

index 3dd4a52d2bac59874c52e6b0af14145c89f666a2..8f1ab3dc211dd2af0995f4f3f665cf5c5a3419df 100644 (file)
@@ -1,3 +1,31 @@
+2003-05-19  David Carlton  <carlton@bactrian.org>
+
+       * language.h (struct language_defn): Add 'la_value_of_this'
+       and 'la_lookup_symbol_nonlocal' members.
+       * symtab.h: Declare basic_lookup_symbol_nonlocal,
+       lookup_symbol_static, lookup_symbol_global,
+       lookup_symbol_aux_block.
+       * symtab.c (lookup_symbol_aux): Call language hooks to determine
+       if we should search fields of this and how to do static/global
+       lookup.
+       (lookup_symbol_aux_block): Make extern.
+       (basic_lookup_symbol_nonlocal): New.
+       (lookup_symbol_static, lookup_symbol_global): Ditto.
+       * ada-lang.c (ada_language_defn): Set 'la_value_of_this' and
+       'la_lookup_symbol_nonlocal' members.
+       * c-lang.c (c_language_defn, cplus_language_defn)
+       (asm_language_defn, minimal_language_defn): Ditto.
+       * jv-lang.c (java_language_defn): Ditto.
+       * language.c (unknown_language_defn, auto_language_defn)
+       (local_language_defn): Ditto.
+       * m2-lang.c (m2_language_defn): Ditto.
+       * objc-lang.c (objc_language_defn): Ditto.
+       * scm-lang.c (scm_language_defn): Ditto.
+       * f-lang.c (f_language_defn): Ditto, and include value.h as well.
+       * p-lang.c (pascal_language_defn): Ditto for both.
+       * Makefile.in (f-lang.o): Depend on value_h.
+       (p-lang.o): Ditto.
+
 2003-05-19  David Carlton  <carlton@bactrian.org>
 
        * block.h: Declare block_static_block.
index dd416972e98de85be4a720af25256cae3627f08a..197d17704f40ad5ef444390982c5064b667e4bad 100644 (file)
@@ -1703,7 +1703,7 @@ expprint.o: expprint.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \
        $(block_h)
 f-lang.o: f-lang.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \
        $(expression_h) $(parser_defs_h) $(language_h) $(f_lang_h) \
-       $(valprint_h)
+       $(valprint_h) $(value_h)
 f-typeprint.o: f-typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) $(symtab_h) \
        $(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) $(target_h) \
        $(f_lang_h) $(gdb_string_h)
@@ -2022,7 +2022,7 @@ osabi.o: osabi.c $(defs_h) $(gdb_string_h) $(osabi_h) $(elf_bfd_h) \
        $(gdbcmd_h) $(command_h) $(arch_utils_h)
 p-lang.o: p-lang.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \
        $(expression_h) $(parser_defs_h) $(language_h) $(p_lang_h) \
-       $(valprint_h)
+       $(valprint_h) $(value_h)
 p-typeprint.o: p-typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) $(symtab_h) \
        $(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) $(target_h) \
        $(language_h) $(p_lang_h) $(typeprint_h) $(gdb_string_h)
index 8d8998bfdf5f9aa45cf4ab55708c576dafbae41e..12bda8049cfacb280040f26b47c0cf3497f1f108 100644 (file)
@@ -8082,6 +8082,8 @@ const struct language_defn ada_language_defn = {
   ada_val_print,               /* Print a value using appropriate syntax */
   ada_value_print,             /* Print a top-level value */
   NULL,                                /* Language specific skip_trampoline */
+  value_of_this,               /* value_of_this */
+  basic_lookup_symbol_nonlocal,        /* lookup_symbol_nonlocal  */
   NULL,                                /* Language specific symbol demangler */
   {"", "", "", ""},            /* Binary format info */
 #if 0
index 5ce0bcbbe87f963eb2a54719b0cd7ed7cd5e179d..9f7ba8ef7e65dc794aaba96d13c2e43a94a7548a 100644 (file)
@@ -553,6 +553,8 @@ const struct language_defn c_language_defn =
   c_val_print,                 /* Print a value using appropriate syntax */
   c_value_print,               /* Print a top-level value */
   NULL,                                /* Language specific skip_trampoline */
+  NULL,                                /* value_of_this */
+  basic_lookup_symbol_nonlocal,        /* lookup_symbol_nonlocal */
   NULL,                                /* Language specific symbol demangler */
   {"", "", "", ""},            /* Binary format info */
   {"0%lo", "0", "o", ""},      /* Octal format info */
@@ -607,6 +609,8 @@ const struct language_defn cplus_language_defn =
   c_val_print,                 /* Print a value using appropriate syntax */
   c_value_print,               /* Print a top-level value */
   NULL,                                /* Language specific skip_trampoline */
+  value_of_this,               /* value_of_this */
+  basic_lookup_symbol_nonlocal,        /* lookup_symbol_nonlocal */
   cplus_demangle,              /* Language specific symbol demangler */
   {"", "", "", ""},            /* Binary format info */
   {"0%lo", "0", "o", ""},      /* Octal format info */
@@ -638,6 +642,8 @@ const struct language_defn asm_language_defn =
   c_val_print,                 /* Print a value using appropriate syntax */
   c_value_print,               /* Print a top-level value */
   NULL,                                /* Language specific skip_trampoline */
+  NULL,                                /* value_of_this */
+  basic_lookup_symbol_nonlocal,        /* lookup_symbol_nonlocal */
   NULL,                                /* Language specific symbol demangler */
   {"", "", "", ""},            /* Binary format info */
   {"0%lo", "0", "o", ""},      /* Octal format info */
@@ -674,6 +680,8 @@ const struct language_defn minimal_language_defn =
   c_val_print,                 /* Print a value using appropriate syntax */
   c_value_print,               /* Print a top-level value */
   NULL,                                /* Language specific skip_trampoline */
+  NULL,                                /* value_of_this */
+  basic_lookup_symbol_nonlocal,        /* lookup_symbol_nonlocal */
   NULL,                                /* Language specific symbol demangler */
   {"", "", "", ""},            /* Binary format info */
   {"0%lo", "0", "o", ""},      /* Octal format info */
index 1a1986fece48c558803a9ccd063ba433856bfbe7..9ed2d6f15052ad11c5e6e980c76fbd428f43c390 100644 (file)
@@ -30,6 +30,7 @@
 #include "language.h"
 #include "f-lang.h"
 #include "valprint.h"
+#include "value.h"
 
 /* The built-in types of F77.  FIXME: integer*4 is missing, plain
    logical is missing (builtin_type_logical is logical*4).  */
@@ -472,6 +473,8 @@ const struct language_defn f_language_defn =
   f_val_print,                 /* Print a value using appropriate syntax */
   c_value_print,               /* FIXME */
   NULL,                                /* Language specific skip_trampoline */
+  value_of_this,               /* value_of_this */
+  basic_lookup_symbol_nonlocal,        /* lookup_symbol_nonlocal */
   NULL,                                /* Language specific symbol demangler */
   {"", "", "", ""},            /* Binary format info */
   {"0%o", "0", "o", ""},       /* Octal format info */
index e436094d582aa78c2144b3dbb46747b9da5948ca..a2a44f0543ee518fb3ad5f9b9fd9fba79e07f0be 100644 (file)
@@ -1063,6 +1063,8 @@ const struct language_defn java_language_defn =
   java_val_print,              /* Print a value using appropriate syntax */
   java_value_print,            /* Print a top-level value */
   NULL,                                /* Language specific skip_trampoline */
+  value_of_this,               /* value_of_this */
+  basic_lookup_symbol_nonlocal,        /* lookup_symbol_nonlocal */
   java_demangle,               /* Language specific symbol demangler */
   {"", "", "", ""},            /* Binary format info */
   {"0%lo", "0", "o", ""},      /* Octal format info */
index 26136330ed87ea545c80d3a47c964aedc566767d..eb203dc587ce4260d9fccb02345e31f8d99926ec 100644 (file)
@@ -1479,6 +1479,8 @@ const struct language_defn unknown_language_defn =
   unk_lang_val_print,          /* Print a value using appropriate syntax */
   unk_lang_value_print,                /* Print a top-level value */
   unk_lang_trampoline,         /* Language specific skip_trampoline */
+  value_of_this,               /* value_of_this */
+  basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
   unk_lang_demangle,           /* Language specific symbol demangler */
   {"", "", "", ""},            /* Binary format info */
   {"0%lo", "0", "o", ""},      /* Octal format info */
@@ -1511,6 +1513,8 @@ const struct language_defn auto_language_defn =
   unk_lang_val_print,          /* Print a value using appropriate syntax */
   unk_lang_value_print,                /* Print a top-level value */
   unk_lang_trampoline,         /* Language specific skip_trampoline */
+  value_of_this,               /* value_of_this */
+  basic_lookup_symbol_nonlocal,        /* lookup_symbol_nonlocal */
   unk_lang_demangle,           /* Language specific symbol demangler */
   {"", "", "", ""},            /* Binary format info */
   {"0%lo", "0", "o", ""},      /* Octal format info */
@@ -1542,6 +1546,8 @@ const struct language_defn local_language_defn =
   unk_lang_val_print,          /* Print a value using appropriate syntax */
   unk_lang_value_print,                /* Print a top-level value */
   unk_lang_trampoline,         /* Language specific skip_trampoline */
+  value_of_this,               /* value_of_this */
+  basic_lookup_symbol_nonlocal,        /* lookup_symbol_nonlocal */
   unk_lang_demangle,           /* Language specific symbol demangler */
   {"", "", "", ""},            /* Binary format info */
   {"0%lo", "0", "o", ""},      /* Octal format info */
index f55c9f0a2f995ec379336e03d74b09c86a757e1a..a1a73a575e9877869a36bc4f877d66affafbf6d0 100644 (file)
@@ -211,6 +211,27 @@ struct language_defn
        if it isn't a language tramp for this language.  */
     CORE_ADDR (*skip_trampoline) (CORE_ADDR pc);
 
+    /* Now come some hooks for lookup_symbol.  */
+
+    /* If this is non-NULL, lookup_symbol will do the 'field_of_this'
+       check, using this function to find the value of this.  */
+
+    /* FIXME: carlton/2003-05-19: Audit all the language_defn structs
+       to make sure we're setting this appropriately: I'm sure it
+       could be NULL in more languages.  */
+
+    struct value *(*la_value_of_this) (int complain);
+
+    /* This is a function that lookup_symbol will call when it gets to
+       the part of symbol lookup where C looks up static and global
+       variables.  */
+
+    struct symbol *(*la_lookup_symbol_nonlocal) (const char *,
+                                                const char *,
+                                                const struct block *,
+                                                const domain_enum,
+                                                struct symtab **);
+
     /* Return demangled language symbol, or NULL.  */
     char *(*la_demangle) (const char *mangled, int options);
 
index a7c4bd7bcfd7e0bc16ad771a0c87e75ed1f57f4b..528484f0f27144f56954387704d72792c7a27c70 100644 (file)
@@ -426,6 +426,8 @@ const struct language_defn m2_language_defn =
   m2_val_print,                        /* Print a value using appropriate syntax */
   c_value_print,               /* Print a top-level value */
   NULL,                                /* Language specific skip_trampoline */
+  value_of_this,               /* value_of_this */
+  basic_lookup_symbol_nonlocal,        /* lookup_symbol_nonlocal */
   NULL,                                /* Language specific symbol demangler */
   {"", "", "", ""},            /* Binary format info */
   {"%loB", "", "o", "B"},      /* Octal format info */
index 1c23c01d2809dd433839fa0f0f52ae7c432a6fb5..0b98a96b3e6716d88a936160afb3a26379660e17 100644 (file)
@@ -701,6 +701,8 @@ const struct language_defn objc_language_defn = {
   c_val_print,                 /* Print a value using appropriate syntax */
   c_value_print,               /* Print a top-level value */
   objc_skip_trampoline,        /* Language specific skip_trampoline */
+  value_of_this,               /* value_of_this */
+  basic_lookup_symbol_nonlocal,        /* lookup_symbol_nonlocal */
   objc_demangle,               /* Language specific symbol demangler */
   {"",     "",    "",  ""},    /* Binary format info */
   {"0%lo",  "0",   "o", ""},   /* Octal format info */
index 8cfa2b00d3efd51dc0530452b68bfcf3258edba8..59e196aa4b310856ddae7c4f2f489ac777e6b54a 100644 (file)
@@ -28,6 +28,7 @@
 #include "language.h"
 #include "p-lang.h"
 #include "valprint.h"
+#include "value.h"
 #include <ctype.h>
  
 extern void _initialize_pascal_language (void);
@@ -461,6 +462,8 @@ const struct language_defn pascal_language_defn =
   pascal_val_print,            /* Print a value using appropriate syntax */
   pascal_value_print,          /* Print a top-level value */
   NULL,                                /* Language specific skip_trampoline */
+  value_of_this,               /* value_of_this */
+  basic_lookup_symbol_nonlocal,        /* lookup_symbol_nonlocal */
   NULL,                                /* Language specific symbol demangler */
   {"", "%", "b", ""},          /* Binary format info */
   {"0%lo", "0", "o", ""},      /* Octal format info */
index 0d0691526e434e0d19cc2f97a6f3efde44915930..0a59ea94aeb883b2ddc577bbffa4cf31cf380e49 100644 (file)
@@ -252,6 +252,8 @@ const struct language_defn scm_language_defn =
   scm_val_print,               /* Print a value using appropriate syntax */
   scm_value_print,             /* Print a top-level value */
   NULL,                                /* Language specific skip_trampoline */
+  value_of_this,               /* value_of_this */
+  basic_lookup_symbol_nonlocal,        /* lookup_symbol_nonlocal */
   NULL,                                /* Language specific symbol demangler */
   {"", "", "", ""},            /* Binary format info */
   {"#o%lo", "#o", "o", ""},    /* Octal format info */
index 62e37b8f46886bc7efa38b3ac776b2e51042425c..1e1b5def91bbb25364cb58ab358d2357ef4f02d6 100644 (file)
@@ -95,13 +95,6 @@ struct symbol *lookup_symbol_aux_local (const char *name,
                                        const domain_enum domain,
                                        struct symtab **symtab);
 
-static
-struct symbol *lookup_symbol_aux_block (const char *name,
-                                       const char *linkage_name,
-                                       const struct block *block,
-                                       const domain_enum domain,
-                                       struct symtab **symtab);
-
 static
 struct symbol *lookup_symbol_aux_symtabs (int block_index,
                                          const char *name,
@@ -957,7 +950,6 @@ lookup_symbol_aux (const char *name, const char *linkage_name,
                   int *is_a_field_of_this, struct symtab **symtab)
 {
   struct symbol *sym;
-  const struct block *static_block;
 
   /* Search specified block and its superiors.  Don't search
      STATIC_BLOCK or GLOBAL_BLOCK.  */
@@ -967,11 +959,13 @@ lookup_symbol_aux (const char *name, const char *linkage_name,
   if (sym != NULL)
     return sym;
 
-  /* C++/Java/Objective-C: If requested to do so by the caller, 
-     check to see if NAME is a field of `this'. */
-  if (is_a_field_of_this)
+  /* If requested to do so by the caller and if appropriate for the
+     current language, check to see if NAME is a field of `this'. */
+
+  if (current_language->la_value_of_this != NULL
+      && is_a_field_of_this != NULL)
     {
-      struct value *v = value_of_this (0);
+      struct value *v = current_language->la_value_of_this (0);
 
       *is_a_field_of_this = 0;
       if (v && check_field (v, name))
@@ -983,51 +977,12 @@ lookup_symbol_aux (const char *name, const char *linkage_name,
        }
     }
 
-  /* If there's a static block to search, search it next.  */
+  /* Now do whatever is appropriate for the current language to look
+     up static and global variables.  */
 
-  /* NOTE: carlton/2002-12-05: There is a question as to whether or
-     not it would be appropriate to search the current global block
-     here as well.  (That's what this code used to do before the
-     is_a_field_of_this check was moved up.)  On the one hand, it's
-     redundant with the lookup_symbol_aux_symtabs search that happens
-     next.  On the other hand, if decode_line_1 is passed an argument
-     like filename:var, then the user presumably wants 'var' to be
-     searched for in filename.  On the third hand, there shouldn't be
-     multiple global variables all of which are named 'var', and it's
-     not like decode_line_1 has ever restricted its search to only
-     global variables in a single filename.  All in all, only
-     searching the static block here seems best: it's correct and it's
-     cleanest.  */
-
-  /* NOTE: carlton/2002-12-05: There's also a possible performance
-     issue here: if you usually search for global symbols in the
-     current file, then it would be slightly better to search the
-     current global block before searching all the symtabs.  But there
-     are other factors that have a much greater effect on performance
-     than that one, so I don't think we should worry about that for
-     now.  */
-
-  static_block = block_static_block (block);
-  if (static_block != NULL)
-    {
-      sym = lookup_symbol_aux_block (name, linkage_name, static_block,
-                                    domain, symtab);
-      if (sym != NULL)
-       return sym;
-    }
-
-  /* Now search all global blocks.  Do the symtab's first, then
-     check the psymtab's. If a psymtab indicates the existence
-     of the desired name as a global, then do psymtab-to-symtab
-     conversion on the fly and return the found symbol. */
-
-  sym = lookup_symbol_aux_symtabs (GLOBAL_BLOCK, name, linkage_name,
-                                  domain, symtab);
-  if (sym != NULL)
-    return sym;
-
-  sym = lookup_symbol_aux_psymtabs (GLOBAL_BLOCK, name, linkage_name,
-                                   domain, symtab);
+  sym = current_language->la_lookup_symbol_nonlocal (name, linkage_name,
+                                                    block, domain,
+                                                    symtab);
   if (sym != NULL)
     return sym;
 
@@ -1086,7 +1041,7 @@ lookup_symbol_aux_local (const char *name, const char *linkage_name,
 /* Look up a symbol in a block; if found, locate its symtab, fixup the
    symbol, and set block_found appropriately.  */
 
-static struct symbol *
+struct symbol *
 lookup_symbol_aux_block (const char *name, const char *linkage_name,
                         const struct block *block,
                         const domain_enum domain,
@@ -1344,6 +1299,93 @@ lookup_symbol_aux_minsyms (const char *name,
 }
 #endif /* 0 */
 
+/* A default version of lookup_symbol_nonlocal for use by languages
+   that can't think of anything better to do.  This implements the C
+   lookup rules.  */
+
+struct symbol *
+basic_lookup_symbol_nonlocal (const char *name,
+                             const char *linkage_name,
+                             const struct block *block,
+                             const domain_enum domain,
+                             struct symtab **symtab)
+{
+  struct symbol *sym;
+
+  /* NOTE: carlton/2003-05-19: The comments below were written when
+     this (or what turned into this) was part of lookup_symbol_aux;
+     I'm much less worried about these questions now, since these
+     decisions have turned out well, but I leave these comments here
+     for posterity.  */
+
+  /* NOTE: carlton/2002-12-05: There is a question as to whether or
+     not it would be appropriate to search the current global block
+     here as well.  (That's what this code used to do before the
+     is_a_field_of_this check was moved up.)  On the one hand, it's
+     redundant with the lookup_symbol_aux_symtabs search that happens
+     next.  On the other hand, if decode_line_1 is passed an argument
+     like filename:var, then the user presumably wants 'var' to be
+     searched for in filename.  On the third hand, there shouldn't be
+     multiple global variables all of which are named 'var', and it's
+     not like decode_line_1 has ever restricted its search to only
+     global variables in a single filename.  All in all, only
+     searching the static block here seems best: it's correct and it's
+     cleanest.  */
+
+  /* NOTE: carlton/2002-12-05: There's also a possible performance
+     issue here: if you usually search for global symbols in the
+     current file, then it would be slightly better to search the
+     current global block before searching all the symtabs.  But there
+     are other factors that have a much greater effect on performance
+     than that one, so I don't think we should worry about that for
+     now.  */
+
+  sym = lookup_symbol_static (name, linkage_name, block, domain, symtab);
+  if (sym != NULL)
+    return sym;
+
+  return lookup_symbol_global (name, linkage_name, domain, symtab);
+}
+
+/* Lookup a symbol in the static block associated to BLOCK, if there
+   is one; do nothing if BLOCK is NULL or a global block.  */
+
+struct symbol *
+lookup_symbol_static (const char *name,
+                     const char *linkage_name,
+                     const struct block *block,
+                     const domain_enum domain,
+                     struct symtab **symtab)
+{
+  const struct block *static_block = block_static_block (block);
+
+  if (static_block != NULL)
+    return lookup_symbol_aux_block (name, linkage_name, static_block,
+                                   domain, symtab);
+  else
+    return NULL;
+}
+
+/* Lookup a symbol in all files' global blocks (searching psymtabs if
+   necessary).  */
+
+struct symbol *
+lookup_symbol_global (const char *name,
+                     const char *linkage_name,
+                     const domain_enum domain,
+                     struct symtab **symtab)
+{
+  struct symbol *sym;
+
+  sym = lookup_symbol_aux_symtabs (GLOBAL_BLOCK, name, linkage_name,
+                                  domain, symtab);
+  if (sym != NULL)
+    return sym;
+
+  return lookup_symbol_aux_psymtabs (GLOBAL_BLOCK, name, linkage_name,
+                                    domain, symtab);
+}
+
 /* Look, in partial_symtab PST, for symbol whose natural name is NAME.
    If LINKAGE_NAME is non-NULL, check in addition that the symbol's
    linkage name matches it.  Check the global symbols if GLOBAL, the
index f8be03b75ab2dfd6ba88b3eeff830cbbf714a32e..26ea51ea4d2f01f2b04269bca10a20368ac992f4 100644 (file)
@@ -988,6 +988,45 @@ extern struct symbol *lookup_symbol (const char *, const struct block *,
                                     const domain_enum, int *,
                                     struct symtab **);
 
+/* A default version of lookup_symbol_nonlocal for use by languages
+   that can't think of anything better to do.  */
+
+extern struct symbol *basic_lookup_symbol_nonlocal (const char *,
+                                                   const char *,
+                                                   const struct block *,
+                                                   const domain_enum,
+                                                   struct symtab **);
+
+/* Some helper functions for languages that need to write their own
+   lookup_symbol_nonlocal functions.  */
+
+/* Lookup a symbol in the static block associated to BLOCK, if there
+   is one; do nothing if BLOCK is NULL or a global block.  */
+
+extern struct symbol *lookup_symbol_static (const char *name,
+                                           const char *linkage_name,
+                                           const struct block *block,
+                                           const domain_enum domain,
+                                           struct symtab **symtab);
+
+/* Lookup a symbol in all files' global blocks (searching psymtabs if
+   necessary).  */
+
+extern struct symbol *lookup_symbol_global (const char *name,
+                                           const char *linkage_name,
+                                           const domain_enum domain,
+                                           struct symtab **symtab);
+
+/* Lookup a symbol within the block BLOCK.  This, unlike
+   lookup_symbol_block, will set SYMTAB and BLOCK_FOUND correctly, and
+   will fix up the symbol if necessary.  */
+
+extern struct symbol *lookup_symbol_aux_block (const char *name,
+                                              const char *linkage_name,
+                                              const struct block *block,
+                                              const domain_enum domain,
+                                              struct symtab **symtab);
+
 /* lookup a symbol by name, within a specified block */
 
 extern struct symbol *lookup_block_symbol (const struct block *, const char *,