This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Replace the block_found global with explicit data-flow


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d12307c199dfdb9cad1ea79d2626224e705089a3

commit d12307c199dfdb9cad1ea79d2626224e705089a3
Author: Pierre-Marie de Rodat <derodat@adacore.com>
Date:   Tue Jul 21 17:02:15 2015 +0200

    Replace the block_found global with explicit data-flow
    
    As Pedro suggested on gdb-patches@ (see
    https://sourceware.org/ml/gdb-patches/2015-05/msg00714.html), this
    change makes symbol lookup functions return a structure that includes
    both the symbol found and the block in which it was found.  This makes
    it possible to get rid of the block_found global variable and thus makes
    block hunting explicit.
    
    gdb/
    
    	* ada-exp.y (write_object_renaming): Replace struct
    	ada_symbol_info with struct block_symbol.  Update field
    	references accordingly.
    	(block_lookup, select_possible_type_sym): Likewise.
    	(find_primitive_type): Likewise.  Also update call to
    	ada_lookup_symbol to extract the symbol itself.
    	(write_var_or_type, write_name_assoc): Likewise.
    	* ada-lang.h (struct ada_symbol_info): Remove.
    	(ada_lookup_symbol_list): Replace struct ada_symbol_info with
    	struct block_symbol.
    	(ada_lookup_encoded_symbol, user_select_syms): Likewise.
    	(ada_lookup_symbol): Return struct block_symbol instead of a
    	mere symbol.
    	* ada-lang.c (defns_collected): Replace struct ada_symbol_info
    	with struct block_symbol.
    	(resolve_subexp, ada_resolve_function, sort_choices,
    	user_select_syms, is_nonfunction, add_defn_to_vec,
    	num_defns_collected, defns_collected,
    	symbols_are_identical_enums, remove_extra_symbols,
    	remove_irrelevant_renamings, add_lookup_symbol_list_worker,
    	ada_lookup_symbol_list, ada_iterate_over_symbols,
    	ada_lookup_encoded_symbol, get_var_value): Likewise.
    	(ada_lookup_symbol): Return a block_symbol instead of a mere
    	symbol.  Replace struct ada_symbol_info with struct
    	block_symbol.
    	(ada_lookup_symbol_nonlocal): Likewise.
    	(standard_lookup): Make block passing explicit through
    	lookup_symbol_in_language.
    	* ada-tasks.c (get_tcb_types_info): Update the calls to
    	lookup_symbol_in_language to extract the mere symbol out of the
    	returned value.
    	(ada_tasks_inferior_data_sniffer): Likewise.
    	* ax-gdb.c (gen_static_field): Likewise for the call to
    	lookup_symbol.
    	(gen_maybe_namespace_elt): Deal with struct symbol_in_block from
    	lookup functions.
    	(gen_expr): Likewise.
    	* c-exp.y: Likewise.  Remove uses of block_found.
    	(lex_one_token, classify_inner_name, c_print_token): Likewise.
    	(classify_name): Likewise.  Rename the "sym" local variable to
    	"bsym".
    	* c-valprint.c (print_unpacked_pointer): Likewise.
    	* compile/compile-c-symbols.c (convert_symbol_sym): Promote the
    	"sym" parameter from struct symbol * to struct block_symbol.
    	Use it to remove uses of block_found.  Deal with struct
    	symbol_in_block from lookup functions.
    	(gcc_convert_symbol): Likewise.  Update the call to
    	convert_symbol_sym.
    	* compile/compile-object-load.c (compile_object_load): Deal with
    	struct symbol_in_block from lookup functions.
    	* cp-namespace.c (cp_lookup_nested_symbol_1,
    	cp_lookup_nested_symbol, cp_lookup_bare_symbol,
    	cp_search_static_and_baseclasses,
    	cp_lookup_symbol_in_namespace, cp_lookup_symbol_via_imports,
    	cp_lookup_symbol_imports_or_template,
    	cp_lookup_symbol_via_all_imports, cp_lookup_symbol_namespace,
    	lookup_namespace_scope, cp_lookup_nonlocal,
    	find_symbol_in_baseclass): Return struct symbol_in_block instead
    	of mere symbols and deal with struct symbol_in_block from lookup
    	functions.
    	* cp-support.c (inspect_type, replace_typedefs,
    	cp_lookup_rtti_type): Deal with struct symbol_in_block from
    	lookup functions.
    	* cp-support.h (cp_lookup_symbol_nonlocal,
    	cp_lookup_symbol_from_namespace,
    	cp_lookup_symbol_imports_or_template, cp_lookup_nested_symbol):
    	Return struct symbol_in_block instead of mere symbols.
    	* d-exp.y (d_type_from_name, d_module_from_name, push_variable,
    	push_module_name):
    	Deal with struct symbol_in_block from lookup functions.  Remove
    	uses of block_found.
    	* eval.c (evaluate_subexp_standard): Update call to
    	cp_lookup_symbol_namespace.
    	* f-exp.y: Deal with struct symbol_in_block from lookup
    	functions.  Remove uses of block_found.
    	(yylex): Likewise.
    	* gdbtypes.c (lookup_typename, lookup_struct, lookup_union,
    	lookup_enum, lookup_template_type, check_typedef): Deal with
    	struct symbol_in_block from lookup functions.
    	* guile/scm-frame.c (gdbscm_frame_read_var): Likewise.
    	* guile/scm-symbol.c (gdbscm_lookup_symbol): Likewise.
    	(gdbscm_lookup_global_symbol): Likewise.
    	* gnu-v3-abi.c (gnuv3_get_typeid_type): Likewise.
    	* go-exp.y: Likewise.  Remove uses of block_found.
    	(package_name_p, classify_packaged_name, classify_name):
    	Likewise.
    	* infrun.c (insert_exception_resume_breakpoint): Likewise.
    	* jv-exp.y (push_variable): Likewise.
    	* jv-lang.c (java_lookup_class, get_java_object_type): Likewise.
    	* language.c (language_bool_type): Likewise.
    	* language.h (struct language_defn): Update
    	la_lookup_symbol_nonlocal to return a struct symbol_in_block
    	rather than a mere symbol.
    	* linespec.c (find_label_symbols): Deal with struct
    	symbol_in_block from lookup functions.
    	* m2-exp.y: Likewise.  Remove uses of block_found.
    	(yylex): Likewise.
    	* mi/mi-cmd-stack.c (list_args_or_locals): Likewise.
    	* objc-lang.c (lookup_struct_typedef, find_imps): Likewise.
    	* p-exp.y: Likewise.  Remove uses of block_found.
    	(yylex): Likewise.
    	* p-valprint.c (pascal_val_print): Likewise.
    	* parse.c (write_dollar_variable): Likewise.  Remove uses of
    	block_found.
    	* parser-defs.h (struct symtoken): Turn the SYM field into a
    	struct symbol_in_block.
    	* printcmd.c (address_info): Deal with struct symbol_in_block
    	from lookup functions.
    	* python/py-frame.c (frapy_read_var): Likewise.
    	* python/py-symbol.c (gdbpy_lookup_symbol,
    	gdbpy_lookup_global_symbol): Likewise.
    	* skip.c (skip_function_command): Likewise.
    	* solib-darwin.c (darwin_lookup_lib_symbol): Return a struct
    	symbol_in_block instead of a mere symbol.
    	* solib-spu.c (spu_lookup_lib_symbol): Likewise.
    	* solib-svr4.c (elf_lookup_lib_symbol): Likewise.
    	* solib.c (solib_global_lookup): Likewise.
    	* solist.h (solib_global_lookup): Likewise.
    	(struct target_so_ops): Update lookup_lib_global_symbol to
    	return a struct symbol_in_block rather than a mere symbol.
    	* source.c (select_source_symtab): Deal with struct
    	symbol_in_block from lookup functions.
    	* stack.c (print_frame_args, iterate_over_block_arg_vars):
    	Likewise.
    	* symfile.c (set_initial_language): Likewise.
    	* symtab.c (SYMBOL_LOOKUP_FAILED): Turn into a struct
    	symbol_in_block.
    	(SYMBOL_LOOKUP_FAILED_P): New predicate as a macro.
    	(struct symbol_cache_slot): Turn the FOUND field into a struct
    	symbol_in_block.
    	(block_found): Remove.
    	(eq_symbol_entry): Update to deal with struct symbol_in_block in
    	cache slots.
    	(symbol_cache_lookup): Return a struct symbol_in_block rather
    	than a mere symbol.
    	(symbol_cache_mark_found): Add a BLOCK parameter to fill
    	appropriately the cache slots.  Update callers.
    	(symbol_cache_dump): Update cache slots handling to the type
    	change.
    	(lookup_symbol_in_language, lookup_symbol, lookup_language_this,
    	lookup_symbol_aux, lookup_local_symbol,
    	lookup_symbol_in_objfile, lookup_global_symbol_from_objfile,
    	lookup_symbol_in_objfile_symtabs,
    	lookup_symbol_in_objfile_from_linkage_name,
    	lookup_symbol_via_quick_fns, basic_lookup_symbol_nonlocal,
    	lookup_symbol_in_static_block, lookup_static_symbol,
    	lookup_global_symbol):
    	Return a struct symbol_in_block rather than a mere symbol.  Deal
    	with struct symbol_in_block from other lookup functions.  Remove
    	uses of block_found.
    	(lookup_symbol_in_block): Remove uses of block_found.
    	(struct global_sym_lookup_data): Turn the RESULT field into a
    	struct symbol_in_block.
    	(lookup_symbol_global_iterator_cb): Update references to the
    	RESULT field.
    	(search_symbols): Deal with struct symbol_in_block from lookup
    	functions.
    	* symtab.h (struct symbol_in_block): New structure.
    	(block_found): Remove.
    	(lookup_symbol_in_language, lookup_symbol,
    	basic_lookup_symbol_nonlocal, lookup_symbol_in_static_block,
    	looku_static_symbol, lookup_global_symbol,
    	lookup_symbol_in_block, lookup_language_this,
    	lookup_global_symbol_from_objfile): Return a struct
    	symbol_in_block rather than just a mere symbol.  Update comments
    	to remove mentions of block_found.
    	* valops.c (find_function_in_inferior,
    	value_struct_elt_for_reference, value_maybe_namespace_elt,
    	value_of_this):  Deal with struct symbol_in_block from lookup
    	functions.
    	* value.c (value_static_field, value_fn_field): Likewise.

Diff:
---
 gdb/ChangeLog                     | 174 ++++++++++++++++++++++
 gdb/ada-exp.y                     |  55 +++----
 gdb/ada-lang.c                    | 229 ++++++++++++++--------------
 gdb/ada-lang.h                    |  22 +--
 gdb/ada-tasks.c                   |  15 +-
 gdb/ax-gdb.c                      |  12 +-
 gdb/c-exp.y                       | 105 ++++++-------
 gdb/c-valprint.c                  |   2 +-
 gdb/compile/compile-c-symbols.c   |  26 ++--
 gdb/compile/compile-object-load.c |   2 +-
 gdb/cp-namespace.c                | 177 +++++++++++-----------
 gdb/cp-support.c                  |   6 +-
 gdb/cp-support.h                  |  22 +--
 gdb/d-exp.y                       |  29 ++--
 gdb/eval.c                        |   2 +-
 gdb/f-exp.y                       |  35 ++---
 gdb/gdbtypes.c                    |  14 +-
 gdb/gnu-v3-abi.c                  |   3 +-
 gdb/go-exp.y                      |  32 ++--
 gdb/guile/scm-frame.c             |   2 +-
 gdb/guile/scm-symbol.c            |   4 +-
 gdb/infrun.c                      |   3 +-
 gdb/jv-exp.y                      |  16 +-
 gdb/jv-lang.c                     |   5 +-
 gdb/language.c                    |   9 +-
 gdb/language.h                    |   9 +-
 gdb/linespec.c                    |   4 +-
 gdb/m2-exp.y                      |  41 ++---
 gdb/mi/mi-cmd-stack.c             |   2 +-
 gdb/objc-lang.c                   |   5 +-
 gdb/p-exp.y                       |  60 ++++----
 gdb/p-valprint.c                  |   2 +-
 gdb/parse.c                       |   8 +-
 gdb/parser-defs.h                 |   2 +-
 gdb/printcmd.c                    |   2 +-
 gdb/python/py-frame.c             |   2 +-
 gdb/python/py-symbol.c            |   4 +-
 gdb/skip.c                        |   2 +-
 gdb/solib-darwin.c                |   4 +-
 gdb/solib-spu.c                   |   4 +-
 gdb/solib-svr4.c                  |   4 +-
 gdb/solib.c                       |   4 +-
 gdb/solist.h                      |  13 +-
 gdb/source.c                      |   2 +-
 gdb/stack.c                       |   4 +-
 gdb/symfile.c                     |   2 +-
 gdb/symtab.c                      | 306 +++++++++++++++++++-------------------
 gdb/symtab.h                      |  86 ++++++-----
 gdb/valops.c                      |  26 ++--
 gdb/value.c                       |   8 +-
 50 files changed, 910 insertions(+), 697 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 66ef8a1..e8c04c0 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,177 @@
+2015-08-01  Pierre-Marie de Rodat  <derodat@adacore.com>
+
+	* ada-exp.y (write_object_renaming): Replace struct
+	ada_symbol_info with struct block_symbol.  Update field
+	references accordingly.
+	(block_lookup, select_possible_type_sym): Likewise.
+	(find_primitive_type): Likewise.  Also update call to
+	ada_lookup_symbol to extract the symbol itself.
+	(write_var_or_type, write_name_assoc): Likewise.
+	* ada-lang.h (struct ada_symbol_info): Remove.
+	(ada_lookup_symbol_list): Replace struct ada_symbol_info with
+	struct block_symbol.
+	(ada_lookup_encoded_symbol, user_select_syms): Likewise.
+	(ada_lookup_symbol): Return struct block_symbol instead of a
+	mere symbol.
+	* ada-lang.c (defns_collected): Replace struct ada_symbol_info
+	with struct block_symbol.
+	(resolve_subexp, ada_resolve_function, sort_choices,
+	user_select_syms, is_nonfunction, add_defn_to_vec,
+	num_defns_collected, defns_collected,
+	symbols_are_identical_enums, remove_extra_symbols,
+	remove_irrelevant_renamings, add_lookup_symbol_list_worker,
+	ada_lookup_symbol_list, ada_iterate_over_symbols,
+	ada_lookup_encoded_symbol, get_var_value): Likewise.
+	(ada_lookup_symbol): Return a block_symbol instead of a mere
+	symbol.  Replace struct ada_symbol_info with struct
+	block_symbol.
+	(ada_lookup_symbol_nonlocal): Likewise.
+	(standard_lookup): Make block passing explicit through
+	lookup_symbol_in_language.
+	* ada-tasks.c (get_tcb_types_info): Update the calls to
+	lookup_symbol_in_language to extract the mere symbol out of the
+	returned value.
+	(ada_tasks_inferior_data_sniffer): Likewise.
+	* ax-gdb.c (gen_static_field): Likewise for the call to
+	lookup_symbol.
+	(gen_maybe_namespace_elt): Deal with struct symbol_in_block from
+	lookup functions.
+	(gen_expr): Likewise.
+	* c-exp.y: Likewise.  Remove uses of block_found.
+	(lex_one_token, classify_inner_name, c_print_token): Likewise.
+	(classify_name): Likewise.  Rename the "sym" local variable to
+	"bsym".
+	* c-valprint.c (print_unpacked_pointer): Likewise.
+	* compile/compile-c-symbols.c (convert_symbol_sym): Promote the
+	"sym" parameter from struct symbol * to struct block_symbol.
+	Use it to remove uses of block_found.  Deal with struct
+	symbol_in_block from lookup functions.
+	(gcc_convert_symbol): Likewise.  Update the call to
+	convert_symbol_sym.
+	* compile/compile-object-load.c (compile_object_load): Deal with
+	struct symbol_in_block from lookup functions.
+	* cp-namespace.c (cp_lookup_nested_symbol_1,
+	cp_lookup_nested_symbol, cp_lookup_bare_symbol,
+	cp_search_static_and_baseclasses,
+	cp_lookup_symbol_in_namespace, cp_lookup_symbol_via_imports,
+	cp_lookup_symbol_imports_or_template,
+	cp_lookup_symbol_via_all_imports, cp_lookup_symbol_namespace,
+	lookup_namespace_scope, cp_lookup_nonlocal,
+	find_symbol_in_baseclass): Return struct symbol_in_block instead
+	of mere symbols and deal with struct symbol_in_block from lookup
+	functions.
+	* cp-support.c (inspect_type, replace_typedefs,
+	cp_lookup_rtti_type): Deal with struct symbol_in_block from
+	lookup functions.
+	* cp-support.h (cp_lookup_symbol_nonlocal,
+	cp_lookup_symbol_from_namespace,
+	cp_lookup_symbol_imports_or_template, cp_lookup_nested_symbol):
+	Return struct symbol_in_block instead of mere symbols.
+	* d-exp.y (d_type_from_name, d_module_from_name, push_variable,
+	push_module_name):
+	Deal with struct symbol_in_block from lookup functions.  Remove
+	uses of block_found.
+	* eval.c (evaluate_subexp_standard): Update call to
+	cp_lookup_symbol_namespace.
+	* f-exp.y: Deal with struct symbol_in_block from lookup
+	functions.  Remove uses of block_found.
+	(yylex): Likewise.
+	* gdbtypes.c (lookup_typename, lookup_struct, lookup_union,
+	lookup_enum, lookup_template_type, check_typedef): Deal with
+	struct symbol_in_block from lookup functions.
+	* guile/scm-frame.c (gdbscm_frame_read_var): Likewise.
+	* guile/scm-symbol.c (gdbscm_lookup_symbol): Likewise.
+	(gdbscm_lookup_global_symbol): Likewise.
+	* gnu-v3-abi.c (gnuv3_get_typeid_type): Likewise.
+	* go-exp.y: Likewise.  Remove uses of block_found.
+	(package_name_p, classify_packaged_name, classify_name):
+	Likewise.
+	* infrun.c (insert_exception_resume_breakpoint): Likewise.
+	* jv-exp.y (push_variable): Likewise.
+	* jv-lang.c (java_lookup_class, get_java_object_type): Likewise.
+	* language.c (language_bool_type): Likewise.
+	* language.h (struct language_defn): Update
+	la_lookup_symbol_nonlocal to return a struct symbol_in_block
+	rather than a mere symbol.
+	* linespec.c (find_label_symbols): Deal with struct
+	symbol_in_block from lookup functions.
+	* m2-exp.y: Likewise.  Remove uses of block_found.
+	(yylex): Likewise.
+	* mi/mi-cmd-stack.c (list_args_or_locals): Likewise.
+	* objc-lang.c (lookup_struct_typedef, find_imps): Likewise.
+	* p-exp.y: Likewise.  Remove uses of block_found.
+	(yylex): Likewise.
+	* p-valprint.c (pascal_val_print): Likewise.
+	* parse.c (write_dollar_variable): Likewise.  Remove uses of
+	block_found.
+	* parser-defs.h (struct symtoken): Turn the SYM field into a
+	struct symbol_in_block.
+	* printcmd.c (address_info): Deal with struct symbol_in_block
+	from lookup functions.
+	* python/py-frame.c (frapy_read_var): Likewise.
+	* python/py-symbol.c (gdbpy_lookup_symbol,
+	gdbpy_lookup_global_symbol): Likewise.
+	* skip.c (skip_function_command): Likewise.
+	* solib-darwin.c (darwin_lookup_lib_symbol): Return a struct
+	symbol_in_block instead of a mere symbol.
+	* solib-spu.c (spu_lookup_lib_symbol): Likewise.
+	* solib-svr4.c (elf_lookup_lib_symbol): Likewise.
+	* solib.c (solib_global_lookup): Likewise.
+	* solist.h (solib_global_lookup): Likewise.
+	(struct target_so_ops): Update lookup_lib_global_symbol to
+	return a struct symbol_in_block rather than a mere symbol.
+	* source.c (select_source_symtab): Deal with struct
+	symbol_in_block from lookup functions.
+	* stack.c (print_frame_args, iterate_over_block_arg_vars):
+	Likewise.
+	* symfile.c (set_initial_language): Likewise.
+	* symtab.c (SYMBOL_LOOKUP_FAILED): Turn into a struct
+	symbol_in_block.
+	(SYMBOL_LOOKUP_FAILED_P): New predicate as a macro.
+	(struct symbol_cache_slot): Turn the FOUND field into a struct
+	symbol_in_block.
+	(block_found): Remove.
+	(eq_symbol_entry): Update to deal with struct symbol_in_block in
+	cache slots.
+	(symbol_cache_lookup): Return a struct symbol_in_block rather
+	than a mere symbol.
+	(symbol_cache_mark_found): Add a BLOCK parameter to fill
+	appropriately the cache slots.  Update callers.
+	(symbol_cache_dump): Update cache slots handling to the type
+	change.
+	(lookup_symbol_in_language, lookup_symbol, lookup_language_this,
+	lookup_symbol_aux, lookup_local_symbol,
+	lookup_symbol_in_objfile, lookup_global_symbol_from_objfile,
+	lookup_symbol_in_objfile_symtabs,
+	lookup_symbol_in_objfile_from_linkage_name,
+	lookup_symbol_via_quick_fns, basic_lookup_symbol_nonlocal,
+	lookup_symbol_in_static_block, lookup_static_symbol,
+	lookup_global_symbol):
+	Return a struct symbol_in_block rather than a mere symbol.  Deal
+	with struct symbol_in_block from other lookup functions.  Remove
+	uses of block_found.
+	(lookup_symbol_in_block): Remove uses of block_found.
+	(struct global_sym_lookup_data): Turn the RESULT field into a
+	struct symbol_in_block.
+	(lookup_symbol_global_iterator_cb): Update references to the
+	RESULT field.
+	(search_symbols): Deal with struct symbol_in_block from lookup
+	functions.
+	* symtab.h (struct symbol_in_block): New structure.
+	(block_found): Remove.
+	(lookup_symbol_in_language, lookup_symbol,
+	basic_lookup_symbol_nonlocal, lookup_symbol_in_static_block,
+	looku_static_symbol, lookup_global_symbol,
+	lookup_symbol_in_block, lookup_language_this,
+	lookup_global_symbol_from_objfile): Return a struct
+	symbol_in_block rather than just a mere symbol.  Update comments
+	to remove mentions of block_found.
+	* valops.c (find_function_in_inferior,
+	value_struct_elt_for_reference, value_maybe_namespace_elt,
+	value_of_this):  Deal with struct symbol_in_block from lookup
+	functions.
+	* value.c (value_static_field, value_fn_field): Likewise.
+
 2015-07-31  Simon Marchi  <simon.marchi@ericsson.com>
 
 	* remote-m32r-sdi.c (m32r_remove_watchpoint): Use enum type
diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y
index 9c0cace..2b671d4 100644
--- a/gdb/ada-exp.y
+++ b/gdb/ada-exp.y
@@ -868,7 +868,7 @@ write_object_renaming (struct parser_state *par_state,
 {
   char *name;
   enum { SIMPLE_INDEX, LOWER_BOUND, UPPER_BOUND } slice_state;
-  struct ada_symbol_info sym_info;
+  struct block_symbol sym_info;
 
   if (max_depth <= 0)
     error (_("Could not find renamed symbol"));
@@ -878,9 +878,9 @@ write_object_renaming (struct parser_state *par_state,
 
   name = obstack_copy0 (&temp_parse_space, renamed_entity, renamed_entity_len);
   ada_lookup_encoded_symbol (name, orig_left_context, VAR_DOMAIN, &sym_info);
-  if (sym_info.sym == NULL)
+  if (sym_info.symbol == NULL)
     error (_("Could not find renamed variable: %s"), ada_decode (name));
-  else if (SYMBOL_CLASS (sym_info.sym) == LOC_TYPEDEF)
+  else if (SYMBOL_CLASS (sym_info.symbol) == LOC_TYPEDEF)
     /* We have a renaming of an old-style renaming symbol.  Don't
        trust the block information.  */
     sym_info.block = orig_left_context;
@@ -890,13 +890,13 @@ write_object_renaming (struct parser_state *par_state,
     int inner_renamed_entity_len;
     const char *inner_renaming_expr;
 
-    switch (ada_parse_renaming (sym_info.sym, &inner_renamed_entity,
+    switch (ada_parse_renaming (sym_info.symbol, &inner_renamed_entity,
 				&inner_renamed_entity_len,
 				&inner_renaming_expr))
       {
       case ADA_NOT_RENAMING:
 	write_var_from_sym (par_state, orig_left_context, sym_info.block,
-			    sym_info.sym);
+			    sym_info.symbol);
 	break;
       case ADA_OBJECT_RENAMING:
 	write_object_renaming (par_state, sym_info.block,
@@ -939,7 +939,7 @@ write_object_renaming (struct parser_state *par_state,
 	  {
 	    const char *end;
 	    char *index_name;
-	    struct ada_symbol_info index_sym_info;
+	    struct block_symbol index_sym_info;
 
 	    end = strchr (renaming_expr, 'X');
 	    if (end == NULL)
@@ -952,13 +952,13 @@ write_object_renaming (struct parser_state *par_state,
 
 	    ada_lookup_encoded_symbol (index_name, NULL, VAR_DOMAIN,
 				       &index_sym_info);
-	    if (index_sym_info.sym == NULL)
+	    if (index_sym_info.symbol == NULL)
 	      error (_("Could not find %s"), index_name);
-	    else if (SYMBOL_CLASS (index_sym_info.sym) == LOC_TYPEDEF)
+	    else if (SYMBOL_CLASS (index_sym_info.symbol) == LOC_TYPEDEF)
 	      /* Index is an old-style renaming symbol.  */
 	      index_sym_info.block = orig_left_context;
 	    write_var_from_sym (par_state, NULL, index_sym_info.block,
-				index_sym_info.sym);
+				index_sym_info.symbol);
 	  }
 	if (slice_state == SIMPLE_INDEX)
 	  {
@@ -1013,7 +1013,7 @@ static const struct block*
 block_lookup (const struct block *context, const char *raw_name)
 {
   const char *name;
-  struct ada_symbol_info *syms;
+  struct block_symbol *syms;
   int nsyms;
   struct symtab *symtab;
 
@@ -1027,14 +1027,14 @@ block_lookup (const struct block *context, const char *raw_name)
 
   nsyms = ada_lookup_symbol_list (name, context, VAR_DOMAIN, &syms);
   if (context == NULL
-      && (nsyms == 0 || SYMBOL_CLASS (syms[0].sym) != LOC_BLOCK))
+      && (nsyms == 0 || SYMBOL_CLASS (syms[0].symbol) != LOC_BLOCK))
     symtab = lookup_symtab (name);
   else
     symtab = NULL;
 
   if (symtab != NULL)
     return BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (symtab), STATIC_BLOCK);
-  else if (nsyms == 0 || SYMBOL_CLASS (syms[0].sym) != LOC_BLOCK)
+  else if (nsyms == 0 || SYMBOL_CLASS (syms[0].symbol) != LOC_BLOCK)
     {
       if (context == NULL)
 	error (_("No file or function \"%s\"."), raw_name);
@@ -1045,12 +1045,12 @@ block_lookup (const struct block *context, const char *raw_name)
     {
       if (nsyms > 1)
 	warning (_("Function name \"%s\" ambiguous here"), raw_name);
-      return SYMBOL_BLOCK_VALUE (syms[0].sym);
+      return SYMBOL_BLOCK_VALUE (syms[0].symbol);
     }
 }
 
 static struct symbol*
-select_possible_type_sym (struct ada_symbol_info *syms, int nsyms)
+select_possible_type_sym (struct block_symbol *syms, int nsyms)
 {
   int i;
   int preferred_index;
@@ -1058,13 +1058,13 @@ select_possible_type_sym (struct ada_symbol_info *syms, int nsyms)
 	  
   preferred_index = -1; preferred_type = NULL;
   for (i = 0; i < nsyms; i += 1)
-    switch (SYMBOL_CLASS (syms[i].sym))
+    switch (SYMBOL_CLASS (syms[i].symbol))
       {
       case LOC_TYPEDEF:
-	if (ada_prefer_type (SYMBOL_TYPE (syms[i].sym), preferred_type))
+	if (ada_prefer_type (SYMBOL_TYPE (syms[i].symbol), preferred_type))
 	  {
 	    preferred_index = i;
-	    preferred_type = SYMBOL_TYPE (syms[i].sym);
+	    preferred_type = SYMBOL_TYPE (syms[i].symbol);
 	  }
 	break;
       case LOC_REGISTER:
@@ -1079,7 +1079,7 @@ select_possible_type_sym (struct ada_symbol_info *syms, int nsyms)
       }
   if (preferred_type == NULL)
     return NULL;
-  return syms[preferred_index].sym;
+  return syms[preferred_index].symbol;
 }
 
 static struct type*
@@ -1101,7 +1101,7 @@ find_primitive_type (struct parser_state *par_state, char *name)
 	(char *) alloca (strlen (name) + sizeof ("standard__"));
       strcpy (expanded_name, "standard__");
       strcat (expanded_name, name);
-      sym = ada_lookup_symbol (expanded_name, NULL, VAR_DOMAIN, NULL);
+      sym = ada_lookup_symbol (expanded_name, NULL, VAR_DOMAIN, NULL).symbol;
       if (sym != NULL && SYMBOL_CLASS (sym) == LOC_TYPEDEF)
 	type = SYMBOL_TYPE (sym);
     }
@@ -1274,7 +1274,7 @@ write_var_or_type (struct parser_state *par_state,
       while (tail_index > 0)
 	{
 	  int nsyms;
-	  struct ada_symbol_info *syms;
+	  struct block_symbol *syms;
 	  struct symbol *type_sym;
 	  struct symbol *renaming_sym;
 	  const char* renaming;
@@ -1294,10 +1294,10 @@ write_var_or_type (struct parser_state *par_state,
 	  if (nsyms == 1)
 	    {
 	      struct symbol *ren_sym =
-		ada_find_renaming_symbol (syms[0].sym, syms[0].block);
+		ada_find_renaming_symbol (syms[0].symbol, syms[0].block);
 
 	      if (ren_sym != NULL)
-		syms[0].sym = ren_sym;
+		syms[0].symbol = ren_sym;
 	    }
 
 	  type_sym = select_possible_type_sym (syms, nsyms);
@@ -1305,7 +1305,7 @@ write_var_or_type (struct parser_state *par_state,
 	  if (type_sym != NULL)
 	    renaming_sym = type_sym;
 	  else if (nsyms == 1)
-	    renaming_sym = syms[0].sym;
+	    renaming_sym = syms[0].symbol;
 	  else 
 	    renaming_sym = NULL;
 
@@ -1367,7 +1367,7 @@ write_var_or_type (struct parser_state *par_state,
 	  if (nsyms == 1)
 	    {
 	      write_var_from_sym (par_state, block, syms[0].block,
-				  syms[0].sym);
+				  syms[0].symbol);
 	      write_selectors (par_state, encoded_name + tail_index);
 	      return NULL;
 	    }
@@ -1433,13 +1433,14 @@ write_name_assoc (struct parser_state *par_state, struct stoken name)
 {
   if (strchr (name.ptr, '.') == NULL)
     {
-      struct ada_symbol_info *syms;
+      struct block_symbol *syms;
       int nsyms = ada_lookup_symbol_list (name.ptr, expression_context_block,
 					  VAR_DOMAIN, &syms);
-      if (nsyms != 1 || SYMBOL_CLASS (syms[0].sym) == LOC_TYPEDEF)
+
+      if (nsyms != 1 || SYMBOL_CLASS (syms[0].symbol) == LOC_TYPEDEF)
 	write_exp_op_with_string (par_state, OP_NAME, name);
       else
-	write_var_from_sym (par_state, NULL, syms[0].block, syms[0].sym);
+	write_var_from_sym (par_state, NULL, syms[0].block, syms[0].symbol);
     }
   else
     if (write_var_or_type (par_state, NULL, name) != NULL)
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 409ecb1..9f9be64 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -108,14 +108,14 @@ static void ada_add_block_symbols (struct obstack *,
                                    const struct block *, const char *,
                                    domain_enum, struct objfile *, int);
 
-static int is_nonfunction (struct ada_symbol_info *, int);
+static int is_nonfunction (struct block_symbol *, int);
 
 static void add_defn_to_vec (struct obstack *, struct symbol *,
                              const struct block *);
 
 static int num_defns_collected (struct obstack *);
 
-static struct ada_symbol_info *defns_collected (struct obstack *, int);
+static struct block_symbol *defns_collected (struct obstack *, int);
 
 static struct value *resolve_subexp (struct expression **, int *, int,
                                      struct type *);
@@ -223,7 +223,7 @@ static int find_struct_field (const char *, struct type *, int,
 static struct value *ada_to_fixed_value_create (struct type *, CORE_ADDR,
                                                 struct value *);
 
-static int ada_resolve_function (struct ada_symbol_info *, int,
+static int ada_resolve_function (struct block_symbol *, int,
                                  struct value **, int, const char *,
                                  struct type *);
 
@@ -3311,7 +3311,7 @@ resolve_subexp (struct expression **expp, int *pos, int deprocedure_p,
     case OP_VAR_VALUE:
       if (SYMBOL_DOMAIN (exp->elts[pc + 2].symbol) == UNDEF_DOMAIN)
         {
-          struct ada_symbol_info *candidates;
+          struct block_symbol *candidates;
           int n_candidates;
 
           n_candidates =
@@ -3327,7 +3327,7 @@ resolve_subexp (struct expression **expp, int *pos, int deprocedure_p,
                  out all types.  */
               int j;
               for (j = 0; j < n_candidates; j += 1)
-                switch (SYMBOL_CLASS (candidates[j].sym))
+                switch (SYMBOL_CLASS (candidates[j].symbol))
                   {
                   case LOC_REGISTER:
                   case LOC_ARG:
@@ -3345,7 +3345,7 @@ resolve_subexp (struct expression **expp, int *pos, int deprocedure_p,
                   j = 0;
                   while (j < n_candidates)
                     {
-                      if (SYMBOL_CLASS (candidates[j].sym) == LOC_TYPEDEF)
+                      if (SYMBOL_CLASS (candidates[j].symbol) == LOC_TYPEDEF)
                         {
                           candidates[j] = candidates[n_candidates - 1];
                           n_candidates -= 1;
@@ -3381,7 +3381,7 @@ resolve_subexp (struct expression **expp, int *pos, int deprocedure_p,
             }
 
           exp->elts[pc + 1].block = candidates[i].block;
-          exp->elts[pc + 2].symbol = candidates[i].sym;
+          exp->elts[pc + 2].symbol = candidates[i].symbol;
           if (innermost_block == NULL
               || contained_in (candidates[i].block, innermost_block))
             innermost_block = candidates[i].block;
@@ -3403,7 +3403,7 @@ resolve_subexp (struct expression **expp, int *pos, int deprocedure_p,
         if (exp->elts[pc + 3].opcode == OP_VAR_VALUE
             && SYMBOL_DOMAIN (exp->elts[pc + 5].symbol) == UNDEF_DOMAIN)
           {
-            struct ada_symbol_info *candidates;
+            struct block_symbol *candidates;
             int n_candidates;
 
             n_candidates =
@@ -3426,7 +3426,7 @@ resolve_subexp (struct expression **expp, int *pos, int deprocedure_p,
               }
 
             exp->elts[pc + 4].block = candidates[i].block;
-            exp->elts[pc + 5].symbol = candidates[i].sym;
+            exp->elts[pc + 5].symbol = candidates[i].symbol;
             if (innermost_block == NULL
                 || contained_in (candidates[i].block, innermost_block))
               innermost_block = candidates[i].block;
@@ -3456,7 +3456,7 @@ resolve_subexp (struct expression **expp, int *pos, int deprocedure_p,
     case UNOP_ABS:
       if (possible_user_operator_p (op, argvec))
         {
-          struct ada_symbol_info *candidates;
+          struct block_symbol *candidates;
           int n_candidates;
 
           n_candidates =
@@ -3468,8 +3468,9 @@ resolve_subexp (struct expression **expp, int *pos, int deprocedure_p,
           if (i < 0)
             break;
 
-          replace_operator_with_call (expp, pc, nargs, 1,
-                                      candidates[i].sym, candidates[i].block);
+	  replace_operator_with_call (expp, pc, nargs, 1,
+				      candidates[i].symbol,
+				      candidates[i].block);
           exp = *expp;
         }
       break;
@@ -3623,7 +3624,7 @@ return_match (struct type *func_type, struct type *context_type)
    the process; the index returned is for the modified vector.  */
 
 static int
-ada_resolve_function (struct ada_symbol_info syms[],
+ada_resolve_function (struct block_symbol syms[],
                       int nsyms, struct value **args, int nargs,
                       const char *name, struct type *context_type)
 {
@@ -3639,9 +3640,9 @@ ada_resolve_function (struct ada_symbol_info syms[],
     {
       for (k = 0; k < nsyms; k += 1)
         {
-          struct type *type = ada_check_typedef (SYMBOL_TYPE (syms[k].sym));
+          struct type *type = ada_check_typedef (SYMBOL_TYPE (syms[k].symbol));
 
-          if (ada_args_match (syms[k].sym, args, nargs)
+          if (ada_args_match (syms[k].symbol, args, nargs)
               && (fallback || return_match (type, context_type)))
             {
               syms[m] = syms[k];
@@ -3704,19 +3705,19 @@ encoded_ordered_before (const char *N0, const char *N1)
    encoded names.  */
 
 static void
-sort_choices (struct ada_symbol_info syms[], int nsyms)
+sort_choices (struct block_symbol syms[], int nsyms)
 {
   int i;
 
   for (i = 1; i < nsyms; i += 1)
     {
-      struct ada_symbol_info sym = syms[i];
+      struct block_symbol sym = syms[i];
       int j;
 
       for (j = i - 1; j >= 0; j -= 1)
         {
-          if (encoded_ordered_before (SYMBOL_LINKAGE_NAME (syms[j].sym),
-                                      SYMBOL_LINKAGE_NAME (sym.sym)))
+          if (encoded_ordered_before (SYMBOL_LINKAGE_NAME (syms[j].symbol),
+                                      SYMBOL_LINKAGE_NAME (sym.symbol)))
             break;
           syms[j + 1] = syms[j];
         }
@@ -3733,7 +3734,7 @@ sort_choices (struct ada_symbol_info syms[], int nsyms)
    to be re-integrated one of these days.  */
 
 int
-user_select_syms (struct ada_symbol_info *syms, int nsyms, int max_results)
+user_select_syms (struct block_symbol *syms, int nsyms, int max_results)
 {
   int i;
   int *chosen = (int *) alloca (sizeof (int) * nsyms);
@@ -3765,22 +3766,22 @@ See set/show multiple-symbol."));
 
   for (i = 0; i < nsyms; i += 1)
     {
-      if (syms[i].sym == NULL)
+      if (syms[i].symbol == NULL)
         continue;
 
-      if (SYMBOL_CLASS (syms[i].sym) == LOC_BLOCK)
+      if (SYMBOL_CLASS (syms[i].symbol) == LOC_BLOCK)
         {
           struct symtab_and_line sal =
-            find_function_start_sal (syms[i].sym, 1);
+            find_function_start_sal (syms[i].symbol, 1);
 
 	  if (sal.symtab == NULL)
 	    printf_unfiltered (_("[%d] %s at <no source file available>:%d\n"),
 			       i + first_choice,
-			       SYMBOL_PRINT_NAME (syms[i].sym),
+			       SYMBOL_PRINT_NAME (syms[i].symbol),
 			       sal.line);
 	  else
 	    printf_unfiltered (_("[%d] %s at %s:%d\n"), i + first_choice,
-			       SYMBOL_PRINT_NAME (syms[i].sym),
+			       SYMBOL_PRINT_NAME (syms[i].symbol),
 			       symtab_to_filename_for_display (sal.symtab),
 			       sal.line);
           continue;
@@ -3788,42 +3789,42 @@ See set/show multiple-symbol."));
       else
         {
           int is_enumeral =
-            (SYMBOL_CLASS (syms[i].sym) == LOC_CONST
-             && SYMBOL_TYPE (syms[i].sym) != NULL
-             && TYPE_CODE (SYMBOL_TYPE (syms[i].sym)) == TYPE_CODE_ENUM);
+            (SYMBOL_CLASS (syms[i].symbol) == LOC_CONST
+             && SYMBOL_TYPE (syms[i].symbol) != NULL
+             && TYPE_CODE (SYMBOL_TYPE (syms[i].symbol)) == TYPE_CODE_ENUM);
 	  struct symtab *symtab = NULL;
 
-	  if (SYMBOL_OBJFILE_OWNED (syms[i].sym))
-	    symtab = symbol_symtab (syms[i].sym);
+	  if (SYMBOL_OBJFILE_OWNED (syms[i].symbol))
+	    symtab = symbol_symtab (syms[i].symbol);
 
-          if (SYMBOL_LINE (syms[i].sym) != 0 && symtab != NULL)
+          if (SYMBOL_LINE (syms[i].symbol) != 0 && symtab != NULL)
             printf_unfiltered (_("[%d] %s at %s:%d\n"),
                                i + first_choice,
-                               SYMBOL_PRINT_NAME (syms[i].sym),
+                               SYMBOL_PRINT_NAME (syms[i].symbol),
 			       symtab_to_filename_for_display (symtab),
-			       SYMBOL_LINE (syms[i].sym));
+			       SYMBOL_LINE (syms[i].symbol));
           else if (is_enumeral
-                   && TYPE_NAME (SYMBOL_TYPE (syms[i].sym)) != NULL)
+                   && TYPE_NAME (SYMBOL_TYPE (syms[i].symbol)) != NULL)
             {
               printf_unfiltered (("[%d] "), i + first_choice);
-              ada_print_type (SYMBOL_TYPE (syms[i].sym), NULL,
+              ada_print_type (SYMBOL_TYPE (syms[i].symbol), NULL,
                               gdb_stdout, -1, 0, &type_print_raw_options);
               printf_unfiltered (_("'(%s) (enumeral)\n"),
-                                 SYMBOL_PRINT_NAME (syms[i].sym));
+                                 SYMBOL_PRINT_NAME (syms[i].symbol));
             }
           else if (symtab != NULL)
             printf_unfiltered (is_enumeral
                                ? _("[%d] %s in %s (enumeral)\n")
                                : _("[%d] %s at %s:?\n"),
                                i + first_choice,
-                               SYMBOL_PRINT_NAME (syms[i].sym),
+                               SYMBOL_PRINT_NAME (syms[i].symbol),
                                symtab_to_filename_for_display (symtab));
           else
             printf_unfiltered (is_enumeral
                                ? _("[%d] %s (enumeral)\n")
                                : _("[%d] %s at ?\n"),
                                i + first_choice,
-                               SYMBOL_PRINT_NAME (syms[i].sym));
+                               SYMBOL_PRINT_NAME (syms[i].symbol));
         }
     }
 
@@ -4603,13 +4604,13 @@ standard_lookup (const char *name, const struct block *block,
                  domain_enum domain)
 {
   /* Initialize it just to avoid a GCC false warning.  */
-  struct symbol *sym = NULL;
+  struct block_symbol sym = {NULL, NULL};
 
-  if (lookup_cached_symbol (name, domain, &sym, NULL))
-    return sym;
+  if (lookup_cached_symbol (name, domain, &sym.symbol, NULL))
+    return sym.symbol;
   sym = lookup_symbol_in_language (name, block, domain, language_c, 0);
-  cache_symbol (name, domain, sym, block_found);
-  return sym;
+  cache_symbol (name, domain, sym.symbol, sym.block);
+  return sym.symbol;
 }
 
 
@@ -4617,14 +4618,14 @@ standard_lookup (const char *name, const struct block *block,
    in the symbol fields of SYMS[0..N-1].  We treat enumerals as functions, 
    since they contend in overloading in the same way.  */
 static int
-is_nonfunction (struct ada_symbol_info syms[], int n)
+is_nonfunction (struct block_symbol syms[], int n)
 {
   int i;
 
   for (i = 0; i < n; i += 1)
-    if (TYPE_CODE (SYMBOL_TYPE (syms[i].sym)) != TYPE_CODE_FUNC
-        && (TYPE_CODE (SYMBOL_TYPE (syms[i].sym)) != TYPE_CODE_ENUM
-            || SYMBOL_CLASS (syms[i].sym) != LOC_CONST))
+    if (TYPE_CODE (SYMBOL_TYPE (syms[i].symbol)) != TYPE_CODE_FUNC
+        && (TYPE_CODE (SYMBOL_TYPE (syms[i].symbol)) != TYPE_CODE_ENUM
+            || SYMBOL_CLASS (syms[i].symbol) != LOC_CONST))
       return 1;
 
   return 0;
@@ -4688,7 +4689,7 @@ lesseq_defined_than (struct symbol *sym0, struct symbol *sym1)
     }
 }
 
-/* Append (SYM,BLOCK,SYMTAB) to the end of the array of struct ada_symbol_info
+/* Append (SYM,BLOCK,SYMTAB) to the end of the array of struct block_symbol
    records in OBSTACKP.  Do nothing if SYM is a duplicate.  */
 
 static void
@@ -4697,7 +4698,7 @@ add_defn_to_vec (struct obstack *obstackp,
                  const struct block *block)
 {
   int i;
-  struct ada_symbol_info *prevDefns = defns_collected (obstackp, 0);
+  struct block_symbol *prevDefns = defns_collected (obstackp, 0);
 
   /* Do not try to complete stub types, as the debugger is probably
      already scanning all symbols matching a certain name at the
@@ -4710,45 +4711,44 @@ add_defn_to_vec (struct obstack *obstackp,
 
   for (i = num_defns_collected (obstackp) - 1; i >= 0; i -= 1)
     {
-      if (lesseq_defined_than (sym, prevDefns[i].sym))
+      if (lesseq_defined_than (sym, prevDefns[i].symbol))
         return;
-      else if (lesseq_defined_than (prevDefns[i].sym, sym))
+      else if (lesseq_defined_than (prevDefns[i].symbol, sym))
         {
-          prevDefns[i].sym = sym;
+          prevDefns[i].symbol = sym;
           prevDefns[i].block = block;
           return;
         }
     }
 
   {
-    struct ada_symbol_info info;
+    struct block_symbol info;
 
-    info.sym = sym;
+    info.symbol = sym;
     info.block = block;
-    obstack_grow (obstackp, &info, sizeof (struct ada_symbol_info));
+    obstack_grow (obstackp, &info, sizeof (struct block_symbol));
   }
 }
 
-/* Number of ada_symbol_info structures currently collected in 
-   current vector in *OBSTACKP.  */
+/* Number of block_symbol structures currently collected in current vector in
+   OBSTACKP.  */
 
 static int
 num_defns_collected (struct obstack *obstackp)
 {
-  return obstack_object_size (obstackp) / sizeof (struct ada_symbol_info);
+  return obstack_object_size (obstackp) / sizeof (struct block_symbol);
 }
 
-/* Vector of ada_symbol_info structures currently collected in current 
-   vector in *OBSTACKP.  If FINISH, close off the vector and return
-   its final address.  */
+/* Vector of block_symbol structures currently collected in current vector in
+   OBSTACKP.  If FINISH, close off the vector and return its final address.  */
 
-static struct ada_symbol_info *
+static struct block_symbol *
 defns_collected (struct obstack *obstackp, int finish)
 {
   if (finish)
     return obstack_finish (obstackp);
   else
-    return (struct ada_symbol_info *) obstack_base (obstackp);
+    return (struct block_symbol *) obstack_base (obstackp);
 }
 
 /* Return a bound minimal symbol matching NAME according to Ada
@@ -4879,7 +4879,7 @@ ada_identical_enum_types_p (struct type *type1, struct type *type2)
    So, for practical purposes, we consider them as the same.  */
 
 static int
-symbols_are_identical_enums (struct ada_symbol_info *syms, int nsyms)
+symbols_are_identical_enums (struct block_symbol *syms, int nsyms)
 {
   int i;
 
@@ -4892,26 +4892,26 @@ symbols_are_identical_enums (struct ada_symbol_info *syms, int nsyms)
 
   /* Quick check: All symbols should have an enum type.  */
   for (i = 0; i < nsyms; i++)
-    if (TYPE_CODE (SYMBOL_TYPE (syms[i].sym)) != TYPE_CODE_ENUM)
+    if (TYPE_CODE (SYMBOL_TYPE (syms[i].symbol)) != TYPE_CODE_ENUM)
       return 0;
 
   /* Quick check: They should all have the same value.  */
   for (i = 1; i < nsyms; i++)
-    if (SYMBOL_VALUE (syms[i].sym) != SYMBOL_VALUE (syms[0].sym))
+    if (SYMBOL_VALUE (syms[i].symbol) != SYMBOL_VALUE (syms[0].symbol))
       return 0;
 
   /* Quick check: They should all have the same number of enumerals.  */
   for (i = 1; i < nsyms; i++)
-    if (TYPE_NFIELDS (SYMBOL_TYPE (syms[i].sym))
-        != TYPE_NFIELDS (SYMBOL_TYPE (syms[0].sym)))
+    if (TYPE_NFIELDS (SYMBOL_TYPE (syms[i].symbol))
+        != TYPE_NFIELDS (SYMBOL_TYPE (syms[0].symbol)))
       return 0;
 
   /* All the sanity checks passed, so we might have a set of
      identical enumeration types.  Perform a more complete
      comparison of the type of each symbol.  */
   for (i = 1; i < nsyms; i++)
-    if (!ada_identical_enum_types_p (SYMBOL_TYPE (syms[i].sym),
-                                     SYMBOL_TYPE (syms[0].sym)))
+    if (!ada_identical_enum_types_p (SYMBOL_TYPE (syms[i].symbol),
+                                     SYMBOL_TYPE (syms[0].symbol)))
       return 0;
 
   return 1;
@@ -4925,7 +4925,7 @@ symbols_are_identical_enums (struct ada_symbol_info *syms, int nsyms)
    Returns the number of items in the modified list.  */
 
 static int
-remove_extra_symbols (struct ada_symbol_info *syms, int nsyms)
+remove_extra_symbols (struct block_symbol *syms, int nsyms)
 {
   int i, j;
 
@@ -4943,16 +4943,16 @@ remove_extra_symbols (struct ada_symbol_info *syms, int nsyms)
       /* If two symbols have the same name and one of them is a stub type,
          the get rid of the stub.  */
 
-      if (TYPE_STUB (SYMBOL_TYPE (syms[i].sym))
-          && SYMBOL_LINKAGE_NAME (syms[i].sym) != NULL)
+      if (TYPE_STUB (SYMBOL_TYPE (syms[i].symbol))
+          && SYMBOL_LINKAGE_NAME (syms[i].symbol) != NULL)
         {
           for (j = 0; j < nsyms; j++)
             {
               if (j != i
-                  && !TYPE_STUB (SYMBOL_TYPE (syms[j].sym))
-                  && SYMBOL_LINKAGE_NAME (syms[j].sym) != NULL
-                  && strcmp (SYMBOL_LINKAGE_NAME (syms[i].sym),
-                             SYMBOL_LINKAGE_NAME (syms[j].sym)) == 0)
+                  && !TYPE_STUB (SYMBOL_TYPE (syms[j].symbol))
+                  && SYMBOL_LINKAGE_NAME (syms[j].symbol) != NULL
+                  && strcmp (SYMBOL_LINKAGE_NAME (syms[i].symbol),
+                             SYMBOL_LINKAGE_NAME (syms[j].symbol)) == 0)
                 remove_p = 1;
             }
         }
@@ -4960,19 +4960,20 @@ remove_extra_symbols (struct ada_symbol_info *syms, int nsyms)
       /* Two symbols with the same name, same class and same address
          should be identical.  */
 
-      else if (SYMBOL_LINKAGE_NAME (syms[i].sym) != NULL
-          && SYMBOL_CLASS (syms[i].sym) == LOC_STATIC
-          && is_nondebugging_type (SYMBOL_TYPE (syms[i].sym)))
+      else if (SYMBOL_LINKAGE_NAME (syms[i].symbol) != NULL
+          && SYMBOL_CLASS (syms[i].symbol) == LOC_STATIC
+          && is_nondebugging_type (SYMBOL_TYPE (syms[i].symbol)))
         {
           for (j = 0; j < nsyms; j += 1)
             {
               if (i != j
-                  && SYMBOL_LINKAGE_NAME (syms[j].sym) != NULL
-                  && strcmp (SYMBOL_LINKAGE_NAME (syms[i].sym),
-                             SYMBOL_LINKAGE_NAME (syms[j].sym)) == 0
-                  && SYMBOL_CLASS (syms[i].sym) == SYMBOL_CLASS (syms[j].sym)
-                  && SYMBOL_VALUE_ADDRESS (syms[i].sym)
-                  == SYMBOL_VALUE_ADDRESS (syms[j].sym))
+                  && SYMBOL_LINKAGE_NAME (syms[j].symbol) != NULL
+                  && strcmp (SYMBOL_LINKAGE_NAME (syms[i].symbol),
+                             SYMBOL_LINKAGE_NAME (syms[j].symbol)) == 0
+                  && SYMBOL_CLASS (syms[i].symbol)
+		       == SYMBOL_CLASS (syms[j].symbol)
+                  && SYMBOL_VALUE_ADDRESS (syms[i].symbol)
+                  == SYMBOL_VALUE_ADDRESS (syms[j].symbol))
                 remove_p = 1;
             }
         }
@@ -5151,7 +5152,7 @@ old_renaming_is_invisible (const struct symbol *sym, const char *function_name)
         the user will be unable to print such rename entities.  */
 
 static int
-remove_irrelevant_renamings (struct ada_symbol_info *syms,
+remove_irrelevant_renamings (struct block_symbol *syms,
 			     int nsyms, const struct block *current_block)
 {
   struct symbol *current_function;
@@ -5165,7 +5166,7 @@ remove_irrelevant_renamings (struct ada_symbol_info *syms,
   is_new_style_renaming = 0;
   for (i = 0; i < nsyms; i += 1)
     {
-      struct symbol *sym = syms[i].sym;
+      struct symbol *sym = syms[i].symbol;
       const struct block *block = syms[i].block;
       const char *name;
       const char *suffix;
@@ -5182,11 +5183,11 @@ remove_irrelevant_renamings (struct ada_symbol_info *syms,
 
 	  is_new_style_renaming = 1;
 	  for (j = 0; j < nsyms; j += 1)
-	    if (i != j && syms[j].sym != NULL
-		&& strncmp (name, SYMBOL_LINKAGE_NAME (syms[j].sym),
+	    if (i != j && syms[j].symbol != NULL
+		&& strncmp (name, SYMBOL_LINKAGE_NAME (syms[j].symbol),
 			    name_len) == 0
 		&& block == syms[j].block)
-	      syms[j].sym = NULL;
+	      syms[j].symbol = NULL;
 	}
     }
   if (is_new_style_renaming)
@@ -5194,7 +5195,7 @@ remove_irrelevant_renamings (struct ada_symbol_info *syms,
       int j, k;
 
       for (j = k = 0; j < nsyms; j += 1)
-	if (syms[j].sym != NULL)
+	if (syms[j].symbol != NULL)
 	    {
 	      syms[k] = syms[j];
 	      k += 1;
@@ -5223,9 +5224,9 @@ remove_irrelevant_renamings (struct ada_symbol_info *syms,
   i = 0;
   while (i < nsyms)
     {
-      if (ada_parse_renaming (syms[i].sym, NULL, NULL, NULL)
+      if (ada_parse_renaming (syms[i].symbol, NULL, NULL, NULL)
           == ADA_OBJECT_RENAMING
-          && old_renaming_is_invisible (syms[i].sym, current_function_name))
+          && old_renaming_is_invisible (syms[i].symbol, current_function_name))
         {
           int j;
 
@@ -5479,7 +5480,7 @@ add_nonlocal_symbols (struct obstack *obstackp, const char *name,
 static int
 ada_lookup_symbol_list_worker (const char *name0, const struct block *block0,
 			       domain_enum domain,
-			       struct ada_symbol_info **results,
+			       struct block_symbol **results,
 			       int full_search)
 {
   struct symbol *sym;
@@ -5566,7 +5567,7 @@ done:
     cache_symbol (name0, domain, NULL, NULL);
 
   if (ndefns == 1 && full_search && syms_from_global_search)
-    cache_symbol (name0, domain, (*results)[0].sym, (*results)[0].block);
+    cache_symbol (name0, domain, (*results)[0].symbol, (*results)[0].block);
 
   ndefns = remove_irrelevant_renamings (*results, ndefns, block0);
 
@@ -5580,7 +5581,7 @@ done:
 
 int
 ada_lookup_symbol_list (const char *name0, const struct block *block0,
-			domain_enum domain, struct ada_symbol_info **results)
+			domain_enum domain, struct block_symbol **results)
 {
   return ada_lookup_symbol_list_worker (name0, block0, domain, results, 1);
 }
@@ -5594,12 +5595,12 @@ ada_iterate_over_symbols (const struct block *block,
 			  void *data)
 {
   int ndefs, i;
-  struct ada_symbol_info *results;
+  struct block_symbol *results;
 
   ndefs = ada_lookup_symbol_list_worker (name, block, domain, &results, 0);
   for (i = 0; i < ndefs; ++i)
     {
-      if (! (*callback) (results[i].sym, data))
+      if (! (*callback) (results[i].symbol, data))
 	break;
     }
 }
@@ -5639,20 +5640,20 @@ ada_name_for_lookup (const char *name)
 void
 ada_lookup_encoded_symbol (const char *name, const struct block *block,
 			   domain_enum domain,
-			   struct ada_symbol_info *info)
+			   struct block_symbol *info)
 {
-  struct ada_symbol_info *candidates;
+  struct block_symbol *candidates;
   int n_candidates;
 
   gdb_assert (info != NULL);
-  memset (info, 0, sizeof (struct ada_symbol_info));
+  memset (info, 0, sizeof (struct block_symbol));
 
   n_candidates = ada_lookup_symbol_list (name, block, domain, &candidates);
   if (n_candidates == 0)
     return;
 
   *info = candidates[0];
-  info->sym = fixup_symbol_section (info->sym, NULL);
+  info->symbol = fixup_symbol_section (info->symbol, NULL);
 }
 
 /* Return a symbol in DOMAIN matching NAME, in BLOCK0 and enclosing
@@ -5661,30 +5662,30 @@ ada_lookup_encoded_symbol (const char *name, const struct block *block,
    choosing the first symbol if there are multiple choices.
    If IS_A_FIELD_OF_THIS is not NULL, it is set to zero.  */
 
-struct symbol *
+struct block_symbol
 ada_lookup_symbol (const char *name, const struct block *block0,
                    domain_enum domain, int *is_a_field_of_this)
 {
-  struct ada_symbol_info info;
+  struct block_symbol info;
 
   if (is_a_field_of_this != NULL)
     *is_a_field_of_this = 0;
 
   ada_lookup_encoded_symbol (ada_encode (ada_fold_name (name)),
 			     block0, domain, &info);
-  return info.sym;
+  return info;
 }
 
-static struct symbol *
+static struct block_symbol
 ada_lookup_symbol_nonlocal (const struct language_defn *langdef,
 			    const char *name,
                             const struct block *block,
                             const domain_enum domain)
 {
-  struct symbol *sym;
+  struct block_symbol sym;
 
   sym = ada_lookup_symbol (name, block_static_block (block), domain, NULL);
-  if (sym != NULL)
+  if (sym.symbol != NULL)
     return sym;
 
   /* If we haven't found a match at this point, try the primitive
@@ -5707,12 +5708,12 @@ ada_lookup_symbol_nonlocal (const struct language_defn *langdef,
 	gdbarch = target_gdbarch ();
       else
 	gdbarch = block_gdbarch (block);
-      sym = language_lookup_primitive_type_as_symbol (langdef, gdbarch, name);
-      if (sym != NULL)
+      sym.symbol = language_lookup_primitive_type_as_symbol (langdef, gdbarch, name);
+      if (sym.symbol != NULL)
 	return sym;
     }
 
-  return NULL;
+  return (struct block_symbol) {NULL, NULL};
 }
 
 
@@ -11372,7 +11373,7 @@ scan_discrim_bound (char *str, int k, struct value *dval, LONGEST * px,
 static struct value *
 get_var_value (char *name, char *err_msg)
 {
-  struct ada_symbol_info *syms;
+  struct block_symbol *syms;
   int nsyms;
 
   nsyms = ada_lookup_symbol_list (name, get_selected_block (0), VAR_DOMAIN,
@@ -11386,7 +11387,7 @@ get_var_value (char *name, char *err_msg)
         error (("%s"), err_msg);
     }
 
-  return value_of_variable (syms[0].sym, syms[0].block);
+  return value_of_variable (syms[0].symbol, syms[0].block);
 }
 
 /* Value of integer variable named NAME in the current environment.  If
diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h
index 12761bf..62896f1 100644
--- a/gdb/ada-lang.h
+++ b/gdb/ada-lang.h
@@ -79,17 +79,6 @@ struct ada_opname_map
 /* Defined in ada-lang.c */
 extern const struct ada_opname_map ada_opname_table[];
 
-/* A tuple representing one instance of a symbol-lookup operation.  */
-
-struct ada_symbol_info
-{
-  /* The symbol that was found.  */
-  struct symbol *sym;
-
-  /* The block where the symbol was found.  */
-  const struct block *block;
-};
-
 /* Denotes a type of renaming symbol (see ada_parse_renaming).  */
 enum ada_renaming_category
   {
@@ -236,22 +225,23 @@ extern const char *ada_decode (const char*);
 extern enum language ada_update_initial_language (enum language);
 
 extern int ada_lookup_symbol_list (const char *, const struct block *,
-                                   domain_enum, struct ada_symbol_info**);
+                                   domain_enum, struct block_symbol**);
 
 extern char *ada_fold_name (const char *);
 
-extern struct symbol *ada_lookup_symbol (const char *, const struct block *,
-                                         domain_enum, int *);
+extern struct block_symbol ada_lookup_symbol (const char *,
+					      const struct block *,
+					      domain_enum, int *);
 
 extern void ada_lookup_encoded_symbol
   (const char *name, const struct block *block, domain_enum domain,
-   struct ada_symbol_info *symbol_info);
+   struct block_symbol *symbol_info);
 
 extern struct bound_minimal_symbol ada_lookup_simple_minsym (const char *);
 
 extern void ada_fill_in_ada_prototype (struct symbol *);
 
-extern int user_select_syms (struct ada_symbol_info *, int, int);
+extern int user_select_syms (struct block_symbol *, int, int);
 
 extern int get_selections (int *, int, int, int, char *);
 
diff --git a/gdb/ada-tasks.c b/gdb/ada-tasks.c
index fa28381..c97057e 100644
--- a/gdb/ada-tasks.c
+++ b/gdb/ada-tasks.c
@@ -471,23 +471,24 @@ get_tcb_types_info (void)
 
   struct symbol *atcb_sym =
     lookup_symbol_in_language (atcb_name, NULL, STRUCT_DOMAIN,
-			       language_c, NULL);
+			       language_c, NULL).symbol;
   const struct symbol *common_atcb_sym =
     lookup_symbol_in_language (common_atcb_name, NULL, STRUCT_DOMAIN,
-			       language_c, NULL);
+			       language_c, NULL).symbol;
   const struct symbol *private_data_sym =
     lookup_symbol_in_language (private_data_name, NULL, STRUCT_DOMAIN,
-			       language_c, NULL);
+			       language_c, NULL).symbol;
   const struct symbol *entry_call_record_sym =
     lookup_symbol_in_language (entry_call_record_name, NULL, STRUCT_DOMAIN,
-			       language_c, NULL);
+			       language_c, NULL).symbol;
 
   if (atcb_sym == NULL || atcb_sym->type == NULL)
     {
       /* In Ravenscar run-time libs, the  ATCB does not have a dynamic
          size, so the symbol name differs.  */
       atcb_sym = lookup_symbol_in_language (atcb_name_fixed, NULL,
-					    STRUCT_DOMAIN, language_c, NULL);
+					    STRUCT_DOMAIN, language_c,
+					    NULL).symbol;
 
       if (atcb_sym == NULL || atcb_sym->type == NULL)
         error (_("Cannot find Ada_Task_Control_Block type. Aborting"));
@@ -863,7 +864,7 @@ ada_tasks_inferior_data_sniffer (struct ada_tasks_inferior_data *data)
 
       /* Try to get pointer type and array length from the symtab.  */
       sym = lookup_symbol_in_language (KNOWN_TASKS_NAME, NULL, VAR_DOMAIN,
-				       language_c, NULL);
+				       language_c, NULL).symbol;
       if (sym != NULL)
 	{
 	  /* Validate.  */
@@ -908,7 +909,7 @@ ada_tasks_inferior_data_sniffer (struct ada_tasks_inferior_data *data)
       data->known_tasks_length = 1;
 
       sym = lookup_symbol_in_language (KNOWN_TASKS_LIST, NULL, VAR_DOMAIN,
-				       language_c, NULL);
+				       language_c, NULL).symbol;
       if (sym != NULL && SYMBOL_VALUE_ADDRESS (sym) != 0)
 	{
 	  /* Validate.  */
diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c
index b035486..38f2c55 100644
--- a/gdb/ax-gdb.c
+++ b/gdb/ax-gdb.c
@@ -1556,7 +1556,7 @@ gen_static_field (struct gdbarch *gdbarch,
   else
     {
       const char *phys_name = TYPE_FIELD_STATIC_PHYSNAME (type, fieldno);
-      struct symbol *sym = lookup_symbol (phys_name, 0, VAR_DOMAIN, 0);
+      struct symbol *sym = lookup_symbol (phys_name, 0, VAR_DOMAIN, 0).symbol;
 
       if (sym)
 	{
@@ -1647,20 +1647,20 @@ gen_maybe_namespace_elt (struct expression *exp,
 			 const struct type *curtype, char *name)
 {
   const char *namespace_name = TYPE_TAG_NAME (curtype);
-  struct symbol *sym;
+  struct block_symbol sym;
 
   sym = cp_lookup_symbol_namespace (namespace_name, name,
 				    block_for_pc (ax->scope),
 				    VAR_DOMAIN);
 
-  if (sym == NULL)
+  if (sym.symbol == NULL)
     return 0;
 
-  gen_var_ref (exp->gdbarch, ax, value, sym);
+  gen_var_ref (exp->gdbarch, ax, value, sym.symbol);
 
   if (value->optimized_out)
     error (_("`%s' has been optimized out, cannot use"),
-	   SYMBOL_PRINT_NAME (sym));
+	   SYMBOL_PRINT_NAME (sym.symbol));
 
   return 1;
 }
@@ -2194,7 +2194,7 @@ gen_expr (struct expression *exp, union exp_element **pc,
 	func = block_linkage_function (b);
 	lang = language_def (SYMBOL_LANGUAGE (func));
 
-	sym = lookup_language_this (lang, b);
+	sym = lookup_language_this (lang, b).symbol;
 	if (!sym)
 	  error (_("no `%s' found"), lang->la_name_of_this);
 
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index 3ea544d..59cecb5 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -923,8 +923,8 @@ exp     :       FALSEKEYWORD
 
 block	:	BLOCKNAME
 			{
-			  if ($1.sym)
-			    $$ = SYMBOL_BLOCK_VALUE ($1.sym);
+			  if ($1.sym.symbol)
+			    $$ = SYMBOL_BLOCK_VALUE ($1.sym.symbol);
 			  else
 			    error (_("No file or function \"%s\"."),
 				   copy_name ($1.stoken));
@@ -938,7 +938,8 @@ block	:	BLOCKNAME
 block	:	block COLONCOLON name
 			{ struct symbol *tem
 			    = lookup_symbol (copy_name ($3), $1,
-					     VAR_DOMAIN, NULL);
+					     VAR_DOMAIN, NULL).symbol;
+
 			  if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK)
 			    error (_("No function \"%s\" in specified context."),
 				   copy_name ($3));
@@ -946,7 +947,7 @@ block	:	block COLONCOLON name
 	;
 
 variable:	name_not_typename ENTRY
-			{ struct symbol *sym = $1.sym;
+			{ struct symbol *sym = $1.sym.symbol;
 
 			  if (sym == NULL || !SYMBOL_IS_ARGUMENT (sym)
 			      || !symbol_read_needs_frame (sym))
@@ -961,24 +962,24 @@ variable:	name_not_typename ENTRY
 	;
 
 variable:	block COLONCOLON name
-			{ struct symbol *sym;
-			  sym = lookup_symbol (copy_name ($3), $1,
-					       VAR_DOMAIN, NULL);
-			  if (sym == 0)
+			{ struct block_symbol sym
+			    = lookup_symbol (copy_name ($3), $1,
+					     VAR_DOMAIN, NULL);
+
+			  if (sym.symbol == 0)
 			    error (_("No symbol \"%s\" in specified context."),
 				   copy_name ($3));
-			  if (symbol_read_needs_frame (sym))
+			  if (symbol_read_needs_frame (sym.symbol))
 			    {
 			      if (innermost_block == 0
-				  || contained_in (block_found,
+				  || contained_in (sym.block,
 						   innermost_block))
-				innermost_block = block_found;
+				innermost_block = sym.block;
 			    }
 
 			  write_exp_elt_opcode (pstate, OP_VAR_VALUE);
-			  /* block_found is set by lookup_symbol.  */
-			  write_exp_elt_block (pstate, block_found);
-			  write_exp_elt_sym (pstate, sym);
+			  write_exp_elt_block (pstate, sym.block);
+			  write_exp_elt_sym (pstate, sym.symbol);
 			  write_exp_elt_opcode (pstate, OP_VAR_VALUE); }
 	;
 
@@ -1035,9 +1036,9 @@ variable:	qualified_name
 			  struct symbol *sym;
 			  struct bound_minimal_symbol msymbol;
 
-			  sym =
-			    lookup_symbol (name, (const struct block *) NULL,
-					   VAR_DOMAIN, NULL);
+			  sym
+			    = lookup_symbol (name, (const struct block *) NULL,
+					     VAR_DOMAIN, NULL).symbol;
 			  if (sym)
 			    {
 			      write_exp_elt_opcode (pstate, OP_VAR_VALUE);
@@ -1058,16 +1059,16 @@ variable:	qualified_name
 	;
 
 variable:	name_not_typename
-			{ struct symbol *sym = $1.sym;
+			{ struct block_symbol sym = $1.sym;
 
-			  if (sym)
+			  if (sym.symbol)
 			    {
-			      if (symbol_read_needs_frame (sym))
+			      if (symbol_read_needs_frame (sym.symbol))
 				{
 				  if (innermost_block == 0
-				      || contained_in (block_found,
+				      || contained_in (sym.block,
 						       innermost_block))
-				    innermost_block = block_found;
+				    innermost_block = sym.block;
 				}
 
 			      write_exp_elt_opcode (pstate, OP_VAR_VALUE);
@@ -1075,7 +1076,7 @@ variable:	name_not_typename
 				 another more inner frame which happens to
 				 be in the same block.  */
 			      write_exp_elt_block (pstate, NULL);
-			      write_exp_elt_sym (pstate, sym);
+			      write_exp_elt_sym (pstate, sym.symbol);
 			      write_exp_elt_opcode (pstate, OP_VAR_VALUE);
 			    }
 			  else if ($1.is_a_field_of_this)
@@ -1084,9 +1085,9 @@ variable:	name_not_typename
 			         not inadvertently convert from a method call
 				 to data ref.  */
 			      if (innermost_block == 0
-				  || contained_in (block_found,
+				  || contained_in (sym.block,
 						   innermost_block))
-				innermost_block = block_found;
+				innermost_block = sym.block;
 			      write_exp_elt_opcode (pstate, OP_THIS);
 			      write_exp_elt_opcode (pstate, OP_THIS);
 			      write_exp_elt_opcode (pstate, STRUCTOP_PTR);
@@ -2817,7 +2818,7 @@ lex_one_token (struct parser_state *par_state, int *is_quoted_name)
 			       VAR_DOMAIN,
 			       (parse_language (par_state)->la_language
 			        == language_cplus ? &is_a_field_of_this
-				: NULL))
+				: NULL)).symbol
 		!= NULL)
 	      {
 		/* The keyword is shadowed.  */
@@ -2838,7 +2839,8 @@ lex_one_token (struct parser_state *par_state, int *is_quoted_name)
     saw_name_at_eof = 1;
 
   yylval.ssym.stoken = yylval.sval;
-  yylval.ssym.sym = NULL;
+  yylval.ssym.sym.symbol = NULL;
+  yylval.ssym.sym.block = NULL;
   yylval.ssym.is_a_field_of_this = 0;
   return NAME;
 }
@@ -2873,7 +2875,7 @@ static int
 classify_name (struct parser_state *par_state, const struct block *block,
 	       int is_quoted_name)
 {
-  struct symbol *sym;
+  struct block_symbol bsym;
   char *copy;
   struct field_of_this_result is_a_field_of_this;
 
@@ -2883,17 +2885,17 @@ classify_name (struct parser_state *par_state, const struct block *block,
      we can refer to it unconditionally below.  */
   memset (&is_a_field_of_this, 0, sizeof (is_a_field_of_this));
 
-  sym = lookup_symbol (copy, block, VAR_DOMAIN,
-		       parse_language (par_state)->la_name_of_this
-		       ? &is_a_field_of_this : NULL);
+  bsym = lookup_symbol (copy, block, VAR_DOMAIN,
+			parse_language (par_state)->la_name_of_this
+			? &is_a_field_of_this : NULL);
 
-  if (sym && SYMBOL_CLASS (sym) == LOC_BLOCK)
+  if (bsym.symbol && SYMBOL_CLASS (bsym.symbol) == LOC_BLOCK)
     {
-      yylval.ssym.sym = sym;
+      yylval.ssym.sym = bsym;
       yylval.ssym.is_a_field_of_this = is_a_field_of_this.type != NULL;
       return BLOCKNAME;
     }
-  else if (!sym)
+  else if (!bsym.symbol)
     {
       /* If we found a field of 'this', we might have erroneously
 	 found a constructor where we wanted a type name.  Handle this
@@ -2906,11 +2908,11 @@ classify_name (struct parser_state *par_state, const struct block *block,
 	{
 	  struct field_of_this_result inner_is_a_field_of_this;
 
-	  sym = lookup_symbol (copy, block, STRUCT_DOMAIN,
-			       &inner_is_a_field_of_this);
-	  if (sym != NULL)
+	  bsym = lookup_symbol (copy, block, STRUCT_DOMAIN,
+				&inner_is_a_field_of_this);
+	  if (bsym.symbol != NULL)
 	    {
-	      yylval.tsym.type = SYMBOL_TYPE (sym);
+	      yylval.tsym.type = SYMBOL_TYPE (bsym.symbol);
 	      return TYPENAME;
 	    }
 	}
@@ -2934,18 +2936,20 @@ classify_name (struct parser_state *par_state, const struct block *block,
 	}
     }
 
-  if (sym && SYMBOL_CLASS (sym) == LOC_TYPEDEF)
+  if (bsym.symbol && SYMBOL_CLASS (bsym.symbol) == LOC_TYPEDEF)
     {
-      yylval.tsym.type = SYMBOL_TYPE (sym);
+      yylval.tsym.type = SYMBOL_TYPE (bsym.symbol);
       return TYPENAME;
     }
 
   /* See if it's an ObjC classname.  */
-  if (parse_language (par_state)->la_language == language_objc && !sym)
+  if (parse_language (par_state)->la_language == language_objc && !bsym.symbol)
     {
       CORE_ADDR Class = lookup_objc_class (parse_gdbarch (par_state), copy);
       if (Class)
 	{
+	  struct symbol *sym;
+
 	  yylval.theclass.theclass = Class;
 	  sym = lookup_struct_typedef (copy, expression_context_block, 1);
 	  if (sym)
@@ -2957,26 +2961,27 @@ classify_name (struct parser_state *par_state, const struct block *block,
   /* Input names that aren't symbols but ARE valid hex numbers, when
      the input radix permits them, can be names or numbers depending
      on the parse.  Note we support radixes > 16 here.  */
-  if (!sym
+  if (!bsym.symbol
       && ((copy[0] >= 'a' && copy[0] < 'a' + input_radix - 10)
 	  || (copy[0] >= 'A' && copy[0] < 'A' + input_radix - 10)))
     {
       YYSTYPE newlval;	/* Its value is ignored.  */
       int hextype = parse_number (par_state, copy, yylval.sval.length,
 				  0, &newlval);
+
       if (hextype == INT)
 	{
-	  yylval.ssym.sym = sym;
+	  yylval.ssym.sym = bsym;
 	  yylval.ssym.is_a_field_of_this = is_a_field_of_this.type != NULL;
 	  return NAME_OR_INT;
 	}
     }
 
   /* Any other kind of symbol */
-  yylval.ssym.sym = sym;
+  yylval.ssym.sym = bsym;
   yylval.ssym.is_a_field_of_this = is_a_field_of_this.type != NULL;
 
-  if (sym == NULL
+  if (bsym.symbol == NULL
       && parse_language (par_state)->la_language == language_cplus
       && is_a_field_of_this.type == NULL
       && lookup_minimal_symbol (copy, NULL, NULL).minsym == NULL)
@@ -3010,7 +3015,7 @@ classify_inner_name (struct parser_state *par_state,
   /* If no symbol was found, search for a matching base class named
      COPY.  This will allow users to enter qualified names of class members
      relative to the `this' pointer.  */
-  if (yylval.ssym.sym == NULL)
+  if (yylval.ssym.sym.symbol == NULL)
     {
       struct type *base_type = cp_find_type_baseclass_by_name (type, copy);
 
@@ -3023,7 +3028,7 @@ classify_inner_name (struct parser_state *par_state,
       return ERROR;
     }
 
-  switch (SYMBOL_CLASS (yylval.ssym.sym))
+  switch (SYMBOL_CLASS (yylval.ssym.sym.symbol))
     {
     case LOC_BLOCK:
     case LOC_LABEL:
@@ -3042,7 +3047,7 @@ classify_inner_name (struct parser_state *par_state,
       return ERROR;
 
     case LOC_TYPEDEF:
-      yylval.tsym.type = SYMBOL_TYPE (yylval.ssym.sym);
+      yylval.tsym.type = SYMBOL_TYPE (yylval.ssym.sym.symbol);
       return TYPENAME;
 
     default:
@@ -3302,8 +3307,8 @@ c_print_token (FILE *file, int type, YYSTYPE value)
     case BLOCKNAME:
       fprintf (file, "ssym<name=%s, sym=%s, field_of_this=%d>",
 	       copy_name (value.ssym.stoken),
-	       (value.ssym.sym == NULL
-		? "(null)" : SYMBOL_PRINT_NAME (value.ssym.sym)),
+	       (value.ssym.sym.symbol == NULL
+		? "(null)" : SYMBOL_PRINT_NAME (value.ssym.sym.symbol)),
 	       value.ssym.is_a_field_of_this);
       break;
 
diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c
index 0cf2d7d..80a75d7 100644
--- a/gdb/c-valprint.c
+++ b/gdb/c-valprint.c
@@ -203,7 +203,7 @@ print_unpacked_pointer (struct type *type, struct type *elttype,
 
 	  if (msymbol.minsym != NULL)
 	    wsym = lookup_symbol (MSYMBOL_LINKAGE_NAME(msymbol.minsym), block,
-				  VAR_DOMAIN, &is_this_fld);
+				  VAR_DOMAIN, &is_this_fld).symbol;
 
 	  if (wsym)
 	    {
diff --git a/gdb/compile/compile-c-symbols.c b/gdb/compile/compile-c-symbols.c
index 68d38ba..21ce655 100644
--- a/gdb/compile/compile-c-symbols.c
+++ b/gdb/compile/compile-c-symbols.c
@@ -304,13 +304,11 @@ convert_one_symbol (struct compile_c_instance *context,
 
 static void
 convert_symbol_sym (struct compile_c_instance *context, const char *identifier,
-		    struct symbol *sym, domain_enum domain)
+		    struct block_symbol sym, domain_enum domain)
 {
-  const struct block *static_block, *found_block;
+  const struct block *static_block;
   int is_local_symbol;
 
-  found_block = block_found;
-
   /* If we found a symbol and it is not in the  static or global
      scope, then we should first convert any static or global scope
      symbol of the same name.  This lets this unusual case work:
@@ -323,24 +321,24 @@ convert_symbol_sym (struct compile_c_instance *context, const char *identifier,
      }
   */
 
-  static_block = block_static_block (found_block);
+  static_block = block_static_block (sym.block);
   /* STATIC_BLOCK is NULL if FOUND_BLOCK is the global block.  */
-  is_local_symbol = (found_block != static_block && static_block != NULL);
+  is_local_symbol = (sym.block != static_block && static_block != NULL);
   if (is_local_symbol)
     {
-      struct symbol *global_sym;
+      struct block_symbol global_sym;
 
       global_sym = lookup_symbol (identifier, NULL, domain, NULL);
       /* If the outer symbol is in the static block, we ignore it, as
 	 it cannot be referenced.  */
-      if (global_sym != NULL
-	  && block_found != block_static_block (block_found))
+      if (global_sym.symbol != NULL
+	  && global_sym.block != block_static_block (global_sym.block))
 	{
 	  if (compile_debug)
 	    fprintf_unfiltered (gdb_stdlog,
 				"gcc_convert_symbol \"%s\": global symbol\n",
 				identifier);
-	  convert_one_symbol (context, global_sym, 1, 0);
+	  convert_one_symbol (context, global_sym.symbol, 1, 0);
 	}
     }
 
@@ -348,7 +346,7 @@ convert_symbol_sym (struct compile_c_instance *context, const char *identifier,
     fprintf_unfiltered (gdb_stdlog,
 			"gcc_convert_symbol \"%s\": local symbol\n",
 			identifier);
-  convert_one_symbol (context, sym, 0, is_local_symbol);
+  convert_one_symbol (context, sym.symbol, 0, is_local_symbol);
 }
 
 /* Convert a minimal symbol to its gcc form.  CONTEXT is the compiler
@@ -444,10 +442,10 @@ gcc_convert_symbol (void *datum,
      is to simply emit a gcc error.  */
   TRY
     {
-      struct symbol *sym;
+      struct block_symbol sym;
 
       sym = lookup_symbol (identifier, context->base.block, domain, NULL);
-      if (sym != NULL)
+      if (sym.symbol != NULL)
 	{
 	  convert_symbol_sym (context, identifier, sym, domain);
 	  found = 1;
@@ -495,7 +493,7 @@ gcc_symbol_address (void *datum, struct gcc_c_context *gcc_context,
       struct symbol *sym;
 
       /* We only need global functions here.  */
-      sym = lookup_symbol (identifier, NULL, VAR_DOMAIN, NULL);
+      sym = lookup_symbol (identifier, NULL, VAR_DOMAIN, NULL).symbol;
       if (sym != NULL && SYMBOL_CLASS (sym) == LOC_BLOCK)
 	{
 	  if (compile_debug)
diff --git a/gdb/compile/compile-object-load.c b/gdb/compile/compile-object-load.c
index 162227a..16775ab 100644
--- a/gdb/compile/compile-object-load.c
+++ b/gdb/compile/compile-object-load.c
@@ -676,7 +676,7 @@ compile_object_load (const char *object_file, const char *source_file,
 
   func_sym = lookup_global_symbol_from_objfile (objfile,
 						GCC_FE_WRAPPER_FUNCTION,
-						VAR_DOMAIN);
+						VAR_DOMAIN).symbol;
   if (func_sym == NULL)
     error (_("Cannot find function \"%s\" in compiled module \"%s\"."),
 	   GCC_FE_WRAPPER_FUNCTION, objfile_name (objfile));
diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c
index 41f8d35..aa29c92 100644
--- a/gdb/cp-namespace.c
+++ b/gdb/cp-namespace.c
@@ -32,7 +32,7 @@
 #include "buildsym.h"
 #include "language.h"
 
-static struct symbol *
+static struct block_symbol
   cp_lookup_nested_symbol_1 (struct type *container_type,
 			     const char *nested_name,
 			     const char *concatenated_name,
@@ -213,14 +213,14 @@ cp_is_in_anonymous (const char *symbol_name)
    If IS_IN_ANONYMOUS is nonzero, the symbol in question is located
    within an anonymous namespace.  */
 
-static struct symbol *
+static struct block_symbol
 cp_basic_lookup_symbol (const char *name, const struct block *block,
 			const domain_enum domain, int is_in_anonymous)
 {
-  struct symbol *sym;
+  struct block_symbol sym;
 
   sym = lookup_symbol_in_static_block (name, block, domain);
-  if (sym != NULL)
+  if (sym.symbol != NULL)
     return sym;
 
   if (is_in_anonymous)
@@ -232,12 +232,13 @@ cp_basic_lookup_symbol (const char *name, const struct block *block,
       const struct block *global_block = block_global_block (block);
 
       if (global_block != NULL)
-	sym = lookup_symbol_in_block (name, global_block, domain);
+	{
+	  sym.symbol = lookup_symbol_in_block (name, global_block, domain);
+	  sym.block = global_block;
+	}
     }
   else
-    {
-      sym = lookup_global_symbol (name, block, domain);
-    }
+    sym = lookup_global_symbol (name, block, domain);
 
   return sym;
 }
@@ -252,12 +253,12 @@ cp_basic_lookup_symbol (const char *name, const struct block *block,
    If SEARCH is non-zero then see if we can determine "this" from BLOCK, and
    if so then also search for NAME in that class.  */
 
-static struct symbol *
+static struct block_symbol
 cp_lookup_bare_symbol (const struct language_defn *langdef,
 		       const char *name, const struct block *block,
 		       const domain_enum domain, int search)
 {
-  struct symbol *sym;
+  struct block_symbol sym;
 
   /* Note: We can't do a simple assert for ':' not being in NAME because
      ':' may be in the args of a template spec.  This isn't intended to be
@@ -266,7 +267,7 @@ cp_lookup_bare_symbol (const struct language_defn *langdef,
     gdb_assert (strchr (name, ':') == NULL);
 
   sym = lookup_symbol_in_static_block (name, block, domain);
-  if (sym != NULL)
+  if (sym.symbol != NULL)
     return sym;
 
   /* If we didn't find a definition for a builtin type in the static block,
@@ -283,30 +284,32 @@ cp_lookup_bare_symbol (const struct language_defn *langdef,
 	gdbarch = target_gdbarch ();
       else
 	gdbarch = block_gdbarch (block);
-      sym = language_lookup_primitive_type_as_symbol (langdef, gdbarch, name);
-      if (sym != NULL)
+      sym.symbol
+	= language_lookup_primitive_type_as_symbol (langdef, gdbarch, name);
+      sym.block = NULL;
+      if (sym.symbol != NULL)
 	return sym;
     }
 
   sym = lookup_global_symbol (name, block, domain);
-  if (sym != NULL)
+  if (sym.symbol != NULL)
     return sym;
 
   if (search)
     {
-      struct symbol *lang_this;
+      struct block_symbol lang_this;
       struct type *type;
 
       lang_this = lookup_language_this (language_def (language_cplus), block);
-      if (lang_this == NULL)
-	return NULL;
+      if (lang_this.symbol == NULL)
+	return (struct block_symbol) {NULL, NULL};
 
-      type = check_typedef (TYPE_TARGET_TYPE (SYMBOL_TYPE (lang_this)));
+      type = check_typedef (TYPE_TARGET_TYPE (SYMBOL_TYPE (lang_this.symbol)));
       /* 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;
+	return (struct block_symbol) {NULL, NULL};
 
       /* Look for symbol NAME in this class.  */
       sym = cp_lookup_nested_symbol (type, name, block, domain);
@@ -324,17 +327,17 @@ cp_lookup_bare_symbol (const struct language_defn *langdef,
    Note: At least in the case of Fortran, which also uses this code, there
    may be no text after the last "::".  */
 
-static struct symbol *
+static struct block_symbol
 cp_search_static_and_baseclasses (const char *name,
 				  const struct block *block,
 				  const domain_enum domain,
 				  unsigned int prefix_len,
 				  int is_in_anonymous)
 {
-  struct symbol *sym;
+  struct block_symbol sym;
   char *klass, *nested;
   struct cleanup *cleanup;
-  struct symbol *klass_sym;
+  struct block_symbol klass_sym;
   struct type *klass_type;
 
   /* The test here uses <= instead of < because Fortran also uses this,
@@ -361,12 +364,12 @@ cp_search_static_and_baseclasses (const char *name,
      symbol_matches_domain (which should be replaced with something else,
      but it's what we have today).  */
   klass_sym = lookup_global_symbol (klass, block, VAR_DOMAIN);
-  if (klass_sym == NULL)
+  if (klass_sym.symbol == NULL)
     {
       do_cleanups (cleanup);
-      return NULL;
+      return (struct block_symbol) {NULL, NULL};
     }
-  klass_type = SYMBOL_TYPE (klass_sym);
+  klass_type = SYMBOL_TYPE (klass_sym.symbol);
 
   /* Look for a symbol named NESTED in this class.
      The caller is assumed to have already have done a basic lookup of NAME.
@@ -387,7 +390,7 @@ cp_search_static_and_baseclasses (const char *name,
    there is no scoping in which case we also try looking in the class of
    "this" if we can compute it.  */
 
-static struct symbol *
+static struct block_symbol
 cp_lookup_symbol_in_namespace (const char *the_namespace, const char *name,
 			       const struct block *block,
 			       const domain_enum domain, int search)
@@ -395,7 +398,7 @@ cp_lookup_symbol_in_namespace (const char *the_namespace, const char *name,
   char *concatenated_name = NULL;
   int is_in_anonymous;
   unsigned int prefix_len;
-  struct symbol *sym;
+  struct block_symbol sym;
 
   if (the_namespace[0] != '\0')
     {
@@ -419,7 +422,7 @@ cp_lookup_symbol_in_namespace (const char *the_namespace, const char *name,
   is_in_anonymous
     = the_namespace[0] != '\0' && cp_is_in_anonymous (the_namespace);
   sym = cp_basic_lookup_symbol (name, block, domain, is_in_anonymous);
-  if (sym != NULL)
+  if (sym.symbol != NULL)
     return sym;
 
   if (search)
@@ -466,7 +469,7 @@ reset_directive_searched (void *data)
    SEARCH_SCOPE_FIRST is an internal implementation detail: Callers must
    pass 0 for it.  Internally we pass 1 when recursing.  */
 
-static struct symbol *
+static struct block_symbol
 cp_lookup_symbol_via_imports (const char *scope,
 			      const char *name,
 			      const struct block *block,
@@ -476,17 +479,19 @@ cp_lookup_symbol_via_imports (const char *scope,
 			      const int search_parents)
 {
   struct using_direct *current;
-  struct symbol *sym = NULL;
+  struct block_symbol sym;
   int len;
   int directive_match;
   struct cleanup *searched_cleanup;
 
+  sym.symbol = NULL;
+
   /* First, try to find the symbol in the given namespace if requested.  */
   if (search_scope_first)
     sym = cp_lookup_symbol_in_namespace (scope, name,
 					 block, domain, 1);
 
-  if (sym != NULL)
+  if (sym.symbol != NULL)
     return sym;
 
   /* Go through the using directives.  If any of them add new names to
@@ -532,12 +537,12 @@ cp_lookup_symbol_via_imports (const char *scope,
 	  /* If this is a DECLARATION_ONLY search or a symbol was found
 	     or this import statement was an import declaration, the
 	     search of this import is complete.  */
-	  if (declaration_only || sym != NULL || current->declaration)
+	  if (declaration_only || sym.symbol != NULL || current->declaration)
 	    {
 	      current->searched = 0;
 	      discard_cleanups (searched_cleanup);
 
-	      if (sym != NULL)
+	      if (sym.symbol != NULL)
 		return sym;
 
 	      continue;
@@ -575,12 +580,12 @@ cp_lookup_symbol_via_imports (const char *scope,
 	  current->searched = 0;
 	  discard_cleanups (searched_cleanup);
 
-	  if (sym != NULL)
+	  if (sym.symbol != NULL)
 	    return sym;
 	}
     }
 
-  return NULL;
+  return (struct block_symbol) {NULL, NULL};
 }
 
 /* Helper function that searches an array of symbols for one named NAME.  */
@@ -604,14 +609,14 @@ search_symbol_list (const char *name, int num,
    searches through the template parameters of the function and the
    function's type.  */
 
-struct symbol *
+struct block_symbol
 cp_lookup_symbol_imports_or_template (const char *scope,
 				      const char *name,
 				      const struct block *block,
 				      const domain_enum domain)
 {
   struct symbol *function = BLOCK_FUNCTION (block);
-  struct symbol *result;
+  struct block_symbol result;
 
   if (symbol_lookup_debug)
     {
@@ -629,20 +634,20 @@ cp_lookup_symbol_imports_or_template (const char *scope,
 	{
 	  struct template_symbol *templ
 	    = (struct template_symbol *) function;
+	  struct symbol *sym = search_symbol_list (name,
+						   templ->n_template_arguments,
+						   templ->template_arguments);
 
-	  result = search_symbol_list (name,
-				       templ->n_template_arguments,
-				       templ->template_arguments);
-	  if (result != NULL)
+	  if (sym != NULL)
 	    {
 	      if (symbol_lookup_debug)
 		{
 		  fprintf_unfiltered (gdb_stdlog,
 				      "cp_lookup_symbol_imports_or_template"
 				      " (...) = %s\n",
-				      host_address_to_string (result));
+				      host_address_to_string (sym));
 		}
-	      return result;
+	      return (struct block_symbol) {sym, block};
 	    }
 	}
 
@@ -656,6 +661,7 @@ cp_lookup_symbol_imports_or_template (const char *scope,
 	  const struct language_defn *lang = language_def (language_cplus);
 	  struct gdbarch *arch = symbol_arch (function);
 	  const struct block *parent = BLOCK_SUPERBLOCK (block);
+	  struct symbol *sym;
 
 	  while (1)
 	    {
@@ -674,21 +680,21 @@ cp_lookup_symbol_imports_or_template (const char *scope,
 	      if (context == NULL)
 		break;
 
-	      result
+	      sym
 		= search_symbol_list (name,
 				      TYPE_N_TEMPLATE_ARGUMENTS (context),
 				      TYPE_TEMPLATE_ARGUMENTS (context));
-	      if (result != NULL)
+	      if (sym != NULL)
 		{
 		  do_cleanups (cleanups);
 		  if (symbol_lookup_debug)
 		    {
-		      fprintf_unfiltered (gdb_stdlog,
-					  "cp_lookup_symbol_imports_or_template"
-					  " (...) = %s\n",
-					  host_address_to_string (result));
+		      fprintf_unfiltered
+			(gdb_stdlog,
+			 "cp_lookup_symbol_imports_or_template (...) = %s\n",
+			 host_address_to_string (sym));
 		    }
-		  return result;
+		  return (struct block_symbol) {sym, parent};
 		}
 	    }
 
@@ -701,8 +707,8 @@ cp_lookup_symbol_imports_or_template (const char *scope,
     {
       fprintf_unfiltered (gdb_stdlog,
 			  "cp_lookup_symbol_imports_or_template (...) = %s\n",
-			  result != NULL
-			  ? host_address_to_string (result) : "NULL");
+			  result.symbol != NULL
+			  ? host_address_to_string (result.symbol) : "NULL");
     }
   return result;
 }
@@ -711,23 +717,23 @@ cp_lookup_symbol_imports_or_template (const char *scope,
    and its parents.  SCOPE is the namespace scope of the context in which the
    search is being evaluated.  */
 
-static struct symbol *
+static struct block_symbol
 cp_lookup_symbol_via_all_imports (const char *scope, const char *name,
 				  const struct block *block,
 				  const domain_enum domain)
 {
-  struct symbol *sym;
+  struct block_symbol sym;
 
   while (block != NULL)
     {
       sym = cp_lookup_symbol_via_imports (scope, name, block, domain, 0, 0, 1);
-      if (sym)
+      if (sym.symbol)
 	return sym;
 
       block = BLOCK_SUPERBLOCK (block);
     }
 
-  return NULL;
+  return (struct block_symbol) {NULL, NULL};
 }
 
 /* Searches for NAME in the current namespace, and by applying
@@ -735,13 +741,13 @@ cp_lookup_symbol_via_all_imports (const char *scope, const char *name,
    SCOPE is the namespace scope of the context in which the search is
    being evaluated.  */
 
-struct symbol *
+struct block_symbol
 cp_lookup_symbol_namespace (const char *scope,
                             const char *name,
                             const struct block *block,
                             const domain_enum domain)
 {
-  struct symbol *sym;
+  struct block_symbol sym;
 
   if (symbol_lookup_debug)
     {
@@ -755,14 +761,15 @@ cp_lookup_symbol_namespace (const char *scope,
   sym = cp_lookup_symbol_in_namespace (scope, name, block, domain, 1);
 
   /* Search for name in namespaces imported to this and parent blocks.  */
-  if (sym == NULL)
+  if (sym.symbol == NULL)
     sym = cp_lookup_symbol_via_all_imports (scope, name, block, domain);
 
   if (symbol_lookup_debug)
     {
       fprintf_unfiltered (gdb_stdlog,
 			  "cp_lookup_symbol_namespace (...) = %s\n",
-			  sym != NULL ? host_address_to_string (sym) : "NULL");
+			  sym.symbol != NULL
+			    ? host_address_to_string (sym.symbol) : "NULL");
     }
   return sym;
 }
@@ -782,7 +789,7 @@ cp_lookup_symbol_namespace (const char *scope,
    "A::x", and if that call fails, then the first call looks for
    "x".  */
 
-static struct symbol *
+static struct block_symbol
 lookup_namespace_scope (const struct language_defn *langdef,
 			const char *name,
 			const struct block *block,
@@ -796,7 +803,7 @@ lookup_namespace_scope (const struct language_defn *langdef,
     {
       /* Recursively search for names in child namespaces first.  */
 
-      struct symbol *sym;
+      struct block_symbol sym;
       int new_scope_len = scope_len;
 
       /* If the current scope is followed by "::", skip past that.  */
@@ -808,7 +815,7 @@ lookup_namespace_scope (const struct language_defn *langdef,
       new_scope_len += cp_find_first_component (scope + new_scope_len);
       sym = lookup_namespace_scope (langdef, name, block, domain,
 				    scope, new_scope_len);
-      if (sym != NULL)
+      if (sym.symbol != NULL)
 	return sym;
     }
 
@@ -839,13 +846,13 @@ lookup_namespace_scope (const struct language_defn *langdef,
    we're looking for, BLOCK is the block that we're searching within,
    DOMAIN says what kind of symbols we're looking for.  */
 
-struct symbol *
+struct block_symbol
 cp_lookup_symbol_nonlocal (const struct language_defn *langdef,
 			   const char *name,
 			   const struct block *block,
 			   const domain_enum domain)
 {
-  struct symbol *sym;
+  struct block_symbol sym;
   const char *scope = block_scope (block);
 
   if (symbol_lookup_debug)
@@ -862,14 +869,16 @@ cp_lookup_symbol_nonlocal (const struct language_defn *langdef,
   sym = lookup_namespace_scope (langdef, name, block, domain, scope, 0);
 
   /* Search for name in namespaces imported to this and parent blocks.  */
-  if (sym == NULL)
+  if (sym.symbol == NULL)
     sym = cp_lookup_symbol_via_all_imports (scope, name, block, domain);
 
   if (symbol_lookup_debug)
     {
       fprintf_unfiltered (gdb_stdlog,
 			  "cp_lookup_symbol_nonlocal (...) = %s\n",
-			  sym != NULL ? host_address_to_string (sym) : "NULL");
+			  (sym.symbol != NULL
+			   ? host_address_to_string (sym.symbol)
+			   : "NULL"));
     }
   return sym;
 }
@@ -905,17 +914,18 @@ cp_find_type_baseclass_by_name (struct type *parent_type, const char *name)
 /* Search through the base classes of PARENT_TYPE for a symbol named
    NAME in block BLOCK.  */
 
-static struct symbol *
+static struct block_symbol
 find_symbol_in_baseclass (struct type *parent_type, const char *name,
 			  const struct block *block, const domain_enum domain,
 			  int is_in_anonymous)
 {
   int i;
-  struct symbol *sym;
+  struct block_symbol sym;
   struct cleanup *cleanup;
   char *concatenated_name;
 
-  sym = NULL;
+  sym.symbol = NULL;
+  sym.block = NULL;
   concatenated_name = NULL;
   cleanup = make_cleanup (free_current_contents, &concatenated_name);
 
@@ -934,7 +944,7 @@ find_symbol_in_baseclass (struct type *parent_type, const char *name,
 
       sym = cp_lookup_nested_symbol_1 (base_type, name, concatenated_name,
 				       block, domain, 1, is_in_anonymous);
-      if (sym != NULL)
+      if (sym.symbol != NULL)
 	break;
     }
 
@@ -954,7 +964,7 @@ find_symbol_in_baseclass (struct type *parent_type, const char *name,
    If IS_IN_ANONYMOUS is non-zero then CONCATENATED_NAME is in an anonymous
    namespace.  */
 
-static struct symbol *
+static struct block_symbol
 cp_lookup_nested_symbol_1 (struct type *container_type,
 			   const char *nested_name,
 			   const char *concatenated_name,
@@ -962,7 +972,7 @@ cp_lookup_nested_symbol_1 (struct type *container_type,
 			   const domain_enum domain,
 			   int basic_lookup, int is_in_anonymous)
 {
-  struct symbol *sym;
+  struct block_symbol sym;
 
   /* NOTE: carlton/2003-11-10: We don't treat C++ class members
      of classes like, say, data or function members.  Instead,
@@ -975,7 +985,7 @@ cp_lookup_nested_symbol_1 (struct type *container_type,
     {
       sym = cp_basic_lookup_symbol (concatenated_name, block, domain,
 				    is_in_anonymous);
-      if (sym != NULL)
+      if (sym.symbol != NULL)
 	return sym;
     }
 
@@ -986,7 +996,7 @@ cp_lookup_nested_symbol_1 (struct type *container_type,
 
   /* First search in this symtab, what we want is possibly there.  */
   sym = lookup_symbol_in_static_block (concatenated_name, block, domain);
-  if (sym != NULL)
+  if (sym.symbol != NULL)
     return sym;
 
   /* Nope.  We now have to search all static blocks in all objfiles,
@@ -997,7 +1007,7 @@ cp_lookup_nested_symbol_1 (struct type *container_type,
   if (!is_in_anonymous)
     {
       sym = lookup_static_symbol (concatenated_name, domain);
-      if (sym != NULL)
+      if (sym.symbol != NULL)
 	return sym;
     }
 
@@ -1007,11 +1017,11 @@ cp_lookup_nested_symbol_1 (struct type *container_type,
     {
       sym = find_symbol_in_baseclass (container_type, nested_name, block,
 				      domain, is_in_anonymous);
-      if (sym != NULL)
+      if (sym.symbol != NULL)
 	return sym;
     }
 
-  return NULL;
+  return (struct block_symbol) {NULL, NULL};
 }
 
 /* Look up a symbol named NESTED_NAME that is nested inside the C++
@@ -1019,7 +1029,7 @@ cp_lookup_nested_symbol_1 (struct type *container_type,
    given by BLOCK, and in DOMAIN.
    Return NULL if there is no such nested symbol.  */
 
-struct symbol *
+struct block_symbol
 cp_lookup_nested_symbol (struct type *parent_type,
 			 const char *nested_name,
 			 const struct block *block,
@@ -1055,7 +1065,7 @@ cp_lookup_nested_symbol (struct type *parent_type,
       {
 	int size;
 	const char *parent_name = type_name_no_tag_or_error (saved_parent_type);
-	struct symbol *sym;
+	struct block_symbol sym;
 	char *concatenated_name;
 	int is_in_anonymous;
 
@@ -1073,8 +1083,9 @@ cp_lookup_nested_symbol (struct type *parent_type,
 	  {
 	    fprintf_unfiltered (gdb_stdlog,
 				"cp_lookup_nested_symbol (...) = %s\n",
-				sym != NULL
-				? host_address_to_string (sym) : "NULL");
+				(sym.symbol != NULL
+				 ? host_address_to_string (sym.symbol)
+				 : "NULL"));
 	  }
 	return sym;
       }
@@ -1087,7 +1098,7 @@ cp_lookup_nested_symbol (struct type *parent_type,
 			      "cp_lookup_nested_symbol (...) = NULL"
 			      " (func/method)\n");
 	}
-      return NULL;
+      return (struct block_symbol) {NULL, NULL};
 
     default:
       internal_error (__FILE__, __LINE__,
diff --git a/gdb/cp-support.c b/gdb/cp-support.c
index 3db9751..1625d72 100644
--- a/gdb/cp-support.c
+++ b/gdb/cp-support.c
@@ -175,7 +175,7 @@ inspect_type (struct demangle_parse_info *info,
 
   TRY
     {
-      sym = lookup_symbol (name, 0, VAR_DOMAIN, 0);
+      sym = lookup_symbol (name, 0, VAR_DOMAIN, 0).symbol;
     }
   CATCH (except, RETURN_MASK_ALL)
     {
@@ -457,7 +457,7 @@ replace_typedefs (struct demangle_parse_info *info,
 	      sym = NULL;
 	      TRY
 		{
-		  sym = lookup_symbol (local_name, 0, VAR_DOMAIN, 0);
+		  sym = lookup_symbol (local_name, 0, VAR_DOMAIN, 0).symbol;
 		}
 	      CATCH (except, RETURN_MASK_ALL)
 		{
@@ -1455,7 +1455,7 @@ cp_lookup_rtti_type (const char *name, struct block *block)
 
   /* Use VAR_DOMAIN here as NAME may be a typedef.  PR 18141, 18417.
      Classes "live" in both STRUCT_DOMAIN and VAR_DOMAIN.  */
-  rtti_sym = lookup_symbol (name, block, VAR_DOMAIN, NULL);
+  rtti_sym = lookup_symbol (name, block, VAR_DOMAIN, NULL).symbol;
 
   if (rtti_sym == NULL)
     {
diff --git a/gdb/cp-support.h b/gdb/cp-support.h
index e92d6e7..f9aac3f 100644
--- a/gdb/cp-support.h
+++ b/gdb/cp-support.h
@@ -192,27 +192,29 @@ extern void cp_add_using_directive (const char *dest,
 extern void cp_scan_for_anonymous_namespaces (const struct symbol *symbol,
 					      struct objfile *objfile);
 
-extern struct symbol *cp_lookup_symbol_nonlocal
+extern struct block_symbol cp_lookup_symbol_nonlocal
      (const struct language_defn *langdef,
       const char *name,
       const struct block *block,
       const domain_enum domain);
 
-extern struct symbol *cp_lookup_symbol_namespace (const char *the_namespace,
-						  const char *name,
-						  const struct block *block,
-						  const domain_enum domain);
+extern struct block_symbol
+  cp_lookup_symbol_namespace (const char *the_namespace,
+			      const char *name,
+			      const struct block *block,
+			      const domain_enum domain);
 
-extern struct symbol *cp_lookup_symbol_imports_or_template
+extern struct block_symbol cp_lookup_symbol_imports_or_template
      (const char *scope,
       const char *name,
       const struct block *block,
       const domain_enum domain);
 
-extern struct symbol *cp_lookup_nested_symbol (struct type *parent_type,
-					       const char *nested_name,
-					       const struct block *block,
-					       const domain_enum domain);
+extern struct block_symbol
+  cp_lookup_nested_symbol (struct type *parent_type,
+			   const char *nested_name,
+			   const struct block *block,
+			   const domain_enum domain);
 
 struct type *cp_lookup_transparent_type (const char *name);
 
diff --git a/gdb/d-exp.y b/gdb/d-exp.y
index 9936b6b..1b7a09c 100644
--- a/gdb/d-exp.y
+++ b/gdb/d-exp.y
@@ -1022,7 +1022,7 @@ d_type_from_name (struct stoken name)
   char *copy = copy_name (name);
 
   sym = lookup_symbol (copy, expression_context_block,
-		       STRUCT_DOMAIN, NULL);
+		       STRUCT_DOMAIN, NULL).symbol;
   if (sym != NULL)
     return SYMBOL_TYPE (sym);
 
@@ -1038,7 +1038,7 @@ d_module_from_name (struct stoken name)
   char *copy = copy_name (name);
 
   sym = lookup_symbol (copy, expression_context_block,
-		       MODULE_DOMAIN, NULL);
+		       MODULE_DOMAIN, NULL).symbol;
   if (sym != NULL)
     return SYMBOL_TYPE (sym);
 
@@ -1053,23 +1053,24 @@ push_variable (struct parser_state *ps, struct stoken name)
 {
   char *copy = copy_name (name);
   struct field_of_this_result is_a_field_of_this;
-  struct symbol *sym;
-  sym = lookup_symbol (copy, expression_context_block, VAR_DOMAIN,
-                       &is_a_field_of_this);
-  if (sym && SYMBOL_CLASS (sym) != LOC_TYPEDEF)
+  struct block_symbol sym
+    = lookup_symbol (copy, expression_context_block, VAR_DOMAIN,
+		     &is_a_field_of_this);
+
+  if (sym.symbol && SYMBOL_CLASS (sym.symbol) != LOC_TYPEDEF)
     {
-      if (symbol_read_needs_frame (sym))
+      if (symbol_read_needs_frame (sym.symbol))
         {
           if (innermost_block == 0 ||
-              contained_in (block_found, innermost_block))
-            innermost_block = block_found;
+              contained_in (sym.block, innermost_block))
+            innermost_block = sym.block;
         }
 
       write_exp_elt_opcode (ps, OP_VAR_VALUE);
       /* We want to use the selected frame, not another more inner frame
          which happens to be in the same block.  */
       write_exp_elt_block (ps, NULL);
-      write_exp_elt_sym (ps, sym);
+      write_exp_elt_sym (ps, sym.symbol);
       write_exp_elt_opcode (ps, OP_VAR_VALUE);
       return 1;
     }
@@ -1078,8 +1079,8 @@ push_variable (struct parser_state *ps, struct stoken name)
       /* It hangs off of `this'.  Must not inadvertently convert from a
          method call to data ref.  */
       if (innermost_block == 0 ||
-          contained_in (block_found, innermost_block))
-        innermost_block = block_found;
+          contained_in (sym.block, innermost_block))
+        innermost_block = sym.block;
       write_exp_elt_opcode (ps, OP_THIS);
       write_exp_elt_opcode (ps, OP_THIS);
       write_exp_elt_opcode (ps, STRUCTOP_PTR);
@@ -1180,10 +1181,10 @@ push_module_name (struct parser_state *ps, struct type *module,
 
       copy = copy_name (name);
       sym = lookup_symbol_in_static_block (copy, expression_context_block,
-					   VAR_DOMAIN);
+					   VAR_DOMAIN).symbol;
       if (sym != NULL)
 	sym = lookup_global_symbol (copy, expression_context_block,
-				    VAR_DOMAIN);
+				    VAR_DOMAIN).symbol;
 
       if (sym != NULL)
 	{
diff --git a/gdb/eval.c b/gdb/eval.c
index 5ab4b9e..7ccc883 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -1492,7 +1492,7 @@ evaluate_subexp_standard (struct type *expect_type,
 	      function = cp_lookup_symbol_namespace (TYPE_TAG_NAME (type),
 						     name,
 						     get_selected_block (0),
-						     VAR_DOMAIN);
+						     VAR_DOMAIN).symbol;
 	      if (function == NULL)
 		error (_("No symbol \"%s\" in namespace \"%s\"."), 
 		       name, TYPE_TAG_NAME (type));
diff --git a/gdb/f-exp.y b/gdb/f-exp.y
index 7e4b1e1..3c486ef 100644
--- a/gdb/f-exp.y
+++ b/gdb/f-exp.y
@@ -509,23 +509,23 @@ exp	:	STRING_LITERAL
 	;
 
 variable:	name_not_typename
-			{ struct symbol *sym = $1.sym;
+			{ struct block_symbol sym = $1.sym;
 
-			  if (sym)
+			  if (sym.symbol)
 			    {
-			      if (symbol_read_needs_frame (sym))
+			      if (symbol_read_needs_frame (sym.symbol))
 				{
 				  if (innermost_block == 0
-				      || contained_in (block_found, 
+				      || contained_in (sym.block,
 						       innermost_block))
-				    innermost_block = block_found;
+				    innermost_block = sym.block;
 				}
 			      write_exp_elt_opcode (pstate, OP_VAR_VALUE);
 			      /* We want to use the selected frame, not
 				 another more inner frame which happens to
 				 be in the same block.  */
 			      write_exp_elt_block (pstate, NULL);
-			      write_exp_elt_sym (pstate, sym);
+			      write_exp_elt_sym (pstate, sym.symbol);
 			      write_exp_elt_opcode (pstate, OP_VAR_VALUE);
 			      break;
 			    }
@@ -1198,7 +1198,7 @@ yylex (void)
      The caller is not constrained to care about the distinction.  */
   {
     char *tmp = copy_name (yylval.sval);
-    struct symbol *sym;
+    struct block_symbol result;
     struct field_of_this_result is_a_field_of_this;
     enum domain_enum_tag lookup_domains[] =
     {
@@ -1215,17 +1215,18 @@ yylex (void)
 	   way we can refer to it unconditionally below.  */
 	memset (&is_a_field_of_this, 0, sizeof (is_a_field_of_this));
 
-	sym = lookup_symbol (tmp, expression_context_block,
-			     lookup_domains[i],
-			     parse_language (pstate)->la_language
-			     == language_cplus ? &is_a_field_of_this : NULL);
-	if (sym && SYMBOL_CLASS (sym) == LOC_TYPEDEF)
+	result = lookup_symbol (tmp, expression_context_block,
+				lookup_domains[i],
+				parse_language (pstate)->la_language
+				== language_cplus
+				  ? &is_a_field_of_this : NULL);
+	if (result.symbol && SYMBOL_CLASS (result.symbol) == LOC_TYPEDEF)
 	  {
-	    yylval.tsym.type = SYMBOL_TYPE (sym);
+	    yylval.tsym.type = SYMBOL_TYPE (result.symbol);
 	    return TYPENAME;
 	  }
 
-	if (sym)
+	if (result.symbol)
 	  break;
       }
 
@@ -1238,7 +1239,7 @@ yylex (void)
     /* Input names that aren't symbols but ARE valid hex numbers,
        when the input radix permits them, can be names or numbers
        depending on the parse.  Note we support radixes > 16 here.  */
-    if (!sym
+    if (!result.symbol
 	&& ((tokstart[0] >= 'a' && tokstart[0] < 'a' + input_radix - 10)
 	    || (tokstart[0] >= 'A' && tokstart[0] < 'A' + input_radix - 10)))
       {
@@ -1246,14 +1247,14 @@ yylex (void)
 	hextype = parse_number (pstate, tokstart, namelen, 0, &newlval);
 	if (hextype == INT)
 	  {
-	    yylval.ssym.sym = sym;
+	    yylval.ssym.sym = result;
 	    yylval.ssym.is_a_field_of_this = is_a_field_of_this.type != NULL;
 	    return NAME_OR_INT;
 	  }
       }
     
     /* Any other kind of symbol */
-    yylval.ssym.sym = sym;
+    yylval.ssym.sym = result;
     yylval.ssym.is_a_field_of_this = is_a_field_of_this.type != NULL;
     return NAME;
   }
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index e6a9547..125af01 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -1420,7 +1420,7 @@ lookup_typename (const struct language_defn *language,
   struct type *type;
 
   sym = lookup_symbol_in_language (name, block, VAR_DOMAIN,
-				   language->la_language, NULL);
+				   language->la_language, NULL).symbol;
   if (sym != NULL && SYMBOL_CLASS (sym) == LOC_TYPEDEF)
     return SYMBOL_TYPE (sym);
 
@@ -1464,7 +1464,7 @@ lookup_struct (const char *name, const struct block *block)
 {
   struct symbol *sym;
 
-  sym = lookup_symbol (name, block, STRUCT_DOMAIN, 0);
+  sym = lookup_symbol (name, block, STRUCT_DOMAIN, 0).symbol;
 
   if (sym == NULL)
     {
@@ -1487,7 +1487,7 @@ lookup_union (const char *name, const struct block *block)
   struct symbol *sym;
   struct type *t;
 
-  sym = lookup_symbol (name, block, STRUCT_DOMAIN, 0);
+  sym = lookup_symbol (name, block, STRUCT_DOMAIN, 0).symbol;
 
   if (sym == NULL)
     error (_("No union type named %s."), name);
@@ -1510,7 +1510,7 @@ lookup_enum (const char *name, const struct block *block)
 {
   struct symbol *sym;
 
-  sym = lookup_symbol (name, block, STRUCT_DOMAIN, 0);
+  sym = lookup_symbol (name, block, STRUCT_DOMAIN, 0).symbol;
   if (sym == NULL)
     {
       error (_("No enum type named %s."), name);
@@ -1539,7 +1539,7 @@ lookup_template_type (char *name, struct type *type,
   strcat (nam, TYPE_NAME (type));
   strcat (nam, " >");	/* FIXME, extra space still introduced in gcc?  */
 
-  sym = lookup_symbol (nam, block, VAR_DOMAIN, 0);
+  sym = lookup_symbol (nam, block, VAR_DOMAIN, 0).symbol;
 
   if (sym == NULL)
     {
@@ -2256,7 +2256,7 @@ check_typedef (struct type *type)
 	      stub_noname_complaint ();
 	      return make_qualified_type (type, instance_flags, NULL);
 	    }
-	  sym = lookup_symbol (name, 0, STRUCT_DOMAIN, 0);
+	  sym = lookup_symbol (name, 0, STRUCT_DOMAIN, 0).symbol;
 	  if (sym)
 	    TYPE_TARGET_TYPE (type) = SYMBOL_TYPE (sym);
 	  else					/* TYPE_CODE_UNDEF */
@@ -2347,7 +2347,7 @@ check_typedef (struct type *type)
 	  stub_noname_complaint ();
 	  return make_qualified_type (type, instance_flags, NULL);
 	}
-      sym = lookup_symbol (name, 0, STRUCT_DOMAIN, 0);
+      sym = lookup_symbol (name, 0, STRUCT_DOMAIN, 0).symbol;
       if (sym)
         {
           /* Same as above for opaque types, we can replace the stub
diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c
index e233fe6..85eed70 100644
--- a/gdb/gnu-v3-abi.c
+++ b/gdb/gnu-v3-abi.c
@@ -1063,7 +1063,8 @@ gnuv3_get_typeid_type (struct gdbarch *gdbarch)
   struct symbol *typeinfo;
   struct type *typeinfo_type;
 
-  typeinfo = lookup_symbol ("std::type_info", NULL, STRUCT_DOMAIN, NULL);
+  typeinfo = lookup_symbol ("std::type_info", NULL, STRUCT_DOMAIN,
+			    NULL).symbol;
   if (typeinfo == NULL)
     typeinfo_type = gdbarch_data (gdbarch, std_type_info_gdbarch_data);
   else
diff --git a/gdb/go-exp.y b/gdb/go-exp.y
index a719d2f..c1ddfa9 100644
--- a/gdb/go-exp.y
+++ b/gdb/go-exp.y
@@ -582,7 +582,7 @@ exp	:	FALSE_KEYWORD
 	;
 
 variable:	name_not_typename ENTRY
-			{ struct symbol *sym = $1.sym;
+			{ struct symbol *sym = $1.sym.symbol;
 
 			  if (sym == NULL
 			      || !SYMBOL_IS_ARGUMENT (sym)
@@ -598,16 +598,16 @@ variable:	name_not_typename ENTRY
 	;
 
 variable:	name_not_typename
-			{ struct symbol *sym = $1.sym;
+			{ struct block_symbol sym = $1.sym;
 
-			  if (sym)
+			  if (sym.symbol)
 			    {
-			      if (symbol_read_needs_frame (sym))
+			      if (symbol_read_needs_frame (sym.symbol))
 				{
 				  if (innermost_block == 0
-				      || contained_in (block_found,
+				      || contained_in (sym.block,
 						       innermost_block))
-				    innermost_block = block_found;
+				    innermost_block = sym.block;
 				}
 
 			      write_exp_elt_opcode (pstate, OP_VAR_VALUE);
@@ -615,7 +615,7 @@ variable:	name_not_typename
 				 another more inner frame which happens to
 				 be in the same block.  */
 			      write_exp_elt_block (pstate, NULL);
-			      write_exp_elt_sym (pstate, sym);
+			      write_exp_elt_sym (pstate, sym.symbol);
 			      write_exp_elt_opcode (pstate, OP_VAR_VALUE);
 			    }
 			  else if ($1.is_a_field_of_this)
@@ -1382,7 +1382,7 @@ package_name_p (const char *name, const struct block *block)
   struct symbol *sym;
   struct field_of_this_result is_a_field_of_this;
 
-  sym = lookup_symbol (name, block, STRUCT_DOMAIN, &is_a_field_of_this);
+  sym = lookup_symbol (name, block, STRUCT_DOMAIN, &is_a_field_of_this).symbol;
 
   if (sym
       && SYMBOL_CLASS (sym) == LOC_TYPEDEF
@@ -1420,14 +1420,14 @@ static int
 classify_packaged_name (const struct block *block)
 {
   char *copy;
-  struct symbol *sym;
+  struct block_symbol sym;
   struct field_of_this_result is_a_field_of_this;
 
   copy = copy_name (yylval.sval);
 
   sym = lookup_symbol (copy, block, VAR_DOMAIN, &is_a_field_of_this);
 
-  if (sym)
+  if (sym.symbol)
     {
       yylval.ssym.sym = sym;
       yylval.ssym.is_a_field_of_this = is_a_field_of_this.type != NULL;
@@ -1448,7 +1448,7 @@ static int
 classify_name (struct parser_state *par_state, const struct block *block)
 {
   struct type *type;
-  struct symbol *sym;
+  struct block_symbol sym;
   char *copy;
   struct field_of_this_result is_a_field_of_this;
 
@@ -1471,7 +1471,7 @@ classify_name (struct parser_state *par_state, const struct block *block)
 
   sym = lookup_symbol (copy, block, VAR_DOMAIN, &is_a_field_of_this);
 
-  if (sym)
+  if (sym.symbol)
     {
       yylval.ssym.sym = sym;
       yylval.ssym.is_a_field_of_this = is_a_field_of_this.type != NULL;
@@ -1496,7 +1496,7 @@ classify_name (struct parser_state *par_state, const struct block *block)
 	xfree (current_package_name);
 	sym = lookup_symbol (sval.ptr, block, VAR_DOMAIN,
 			     &is_a_field_of_this);
-	if (sym)
+	if (sym.symbol)
 	  {
 	    yylval.ssym.stoken = sval;
 	    yylval.ssym.sym = sym;
@@ -1517,13 +1517,15 @@ classify_name (struct parser_state *par_state, const struct block *block)
 				  0, &newlval);
       if (hextype == INT)
 	{
-	  yylval.ssym.sym = NULL;
+	  yylval.ssym.sym.symbol = NULL;
+	  yylval.ssym.sym.block = NULL;
 	  yylval.ssym.is_a_field_of_this = 0;
 	  return NAME_OR_INT;
 	}
     }
 
-  yylval.ssym.sym = NULL;
+  yylval.ssym.sym.symbol = NULL;
+  yylval.ssym.sym.block = NULL;
   yylval.ssym.is_a_field_of_this = 0;
   return NAME;
 }
diff --git a/gdb/guile/scm-frame.c b/gdb/guile/scm-frame.c
index 787b788..64ac0c0 100644
--- a/gdb/guile/scm-frame.c
+++ b/gdb/guile/scm-frame.c
@@ -911,7 +911,7 @@ gdbscm_frame_read_var (SCM self, SCM symbol_scm, SCM rest)
 	{
 	  if (block == NULL)
 	    block = get_frame_block (frame, NULL);
-	  var = lookup_symbol (var_name, block, VAR_DOMAIN, NULL);
+	  var = lookup_symbol (var_name, block, VAR_DOMAIN, NULL).symbol;
 	}
       CATCH (ex, RETURN_MASK_ALL)
 	{
diff --git a/gdb/guile/scm-symbol.c b/gdb/guile/scm-symbol.c
index 99ef928..01c9eb1 100644
--- a/gdb/guile/scm-symbol.c
+++ b/gdb/guile/scm-symbol.c
@@ -617,7 +617,7 @@ gdbscm_lookup_symbol (SCM name_scm, SCM rest)
 
   TRY
     {
-      symbol = lookup_symbol (name, block, domain, &is_a_field_of_this);
+      symbol = lookup_symbol (name, block, domain, &is_a_field_of_this).symbol;
     }
   CATCH (ex, RETURN_MASK_ALL)
     {
@@ -657,7 +657,7 @@ gdbscm_lookup_global_symbol (SCM name_scm, SCM rest)
 
   TRY
     {
-      symbol = lookup_global_symbol (name, NULL, domain);
+      symbol = lookup_global_symbol (name, NULL, domain).symbol;
     }
   CATCH (ex, RETURN_MASK_ALL)
     {
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 8430628..a2e7cfc 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -6087,7 +6087,8 @@ insert_exception_resume_breakpoint (struct thread_info *tp,
       CORE_ADDR handler;
       struct breakpoint *bp;
 
-      vsym = lookup_symbol (SYMBOL_LINKAGE_NAME (sym), b, VAR_DOMAIN, NULL);
+      vsym = lookup_symbol (SYMBOL_LINKAGE_NAME (sym), b, VAR_DOMAIN,
+			    NULL).symbol;
       value = read_var_value (vsym, frame);
       /* If the value was optimized out, revert to the old behavior.  */
       if (! value_optimized_out (value))
diff --git a/gdb/jv-exp.y b/gdb/jv-exp.y
index 2ed1c17..4999848 100644
--- a/gdb/jv-exp.y
+++ b/gdb/jv-exp.y
@@ -1270,24 +1270,24 @@ push_variable (struct parser_state *par_state, struct stoken name)
 {
   char *tmp = copy_name (name);
  [...]

[diff truncated at 100000 bytes]


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]