* symtab.h (lookup_symbol_in_language): Remove SYMTAB parameter.

(lookup_symbol): Likewise.
	* symtab.c (lookup_symbol_in_language): Remove SYMTAB parameter.
	(lookup_symbol): Likewise.
	(search_symbols): Update.

	* linespec.c (find_methods, collect_methods): Update.
	(add_matching_methods, add_constructors): Update.
	(decode_compound, decode_dollar, decode_variable): Update.
	(lookup_prefix_sym): Update.

	(symbol_found): Remove SYM_SYMTAB parameter.
	Use SYMBOL_SYMTAB (sym) instead.

	* gdbtypes.c (lookup_typename): Update.
	(lookup_struct, lookup_union, lookup_enum): Update.
	(lookup_template_type): Update.
	(check_typedef): Update.
	* language.c (lang_bool_type): Update.
	* mdebugread.c (parse_procedure): Update.
	* mi/mi-cmd-stack.c (list_args_or_locals): Update.
	* parse.c (write_dollar_variable): Update.
	* printcmd.c (address_info): Update.
	* source.c (select_source_symtab): Update.
	* stack.c (print_frame_args, print_frame_arg_vars): Update.
	* valops.c (find_function_in_inferior): Update.
	(value_struct_elt_for_reference): Update.
	* value.c (value_static_field, value_fn_field): Update.

	* alpha-mdebug-tdep.c (find_proc_desc): Update.
	* arm-tdep.c (arm_skip_prologue): Update.
	* mt-tdep.c (mt_skip_prologue): Update.
	* xstormy16-tdep.c (xstormy16_skip_prologue): Update.

	* ada-lang.h (struct ada_symbol_info): Remove SYMTAB member.
	* ada-lang.c (ada_add_block_symbols): Remove SYMTAB parameter.
	(add_defn_to_vec): Likewise.
	(ada_add_block_symbols): Likewise.
	(lookup_cached_symbol, cache_symbol): Likewise.
	(standard_lookup): Update.
	(ada_lookup_symbol_list): Update.

	* c-valprint.c (c_val_print): Update.
	* cp-support.c (cp_lookup_rtti_type): Update.
	* jv-lang.c (java_lookup_class, get_java_object_type): Update.
	* objc-lang.c (lookup_struct_typedef, find_imps): Update.
	* p-valprint.c (pascal_val_print): Update.
	* scm-lang.c (scm_lookup_name): Update.

	* c-exp.y: Update.
	* f-exp.y: Update.
	* jv-exp.y: Update.
	* m2-exp.y: Update.
	* objc-exp.y: Update.
	* p-exp.y: Update.
This commit is contained in:
Ulrich Weigand 2008-05-19 15:50:10 +00:00
parent 21b556f400
commit 2570f2b7e1
32 changed files with 169 additions and 181 deletions

View file

@ -1,3 +1,61 @@
2008-05-19 Ulrich Weigand <uweigand@de.ibm.com>
* symtab.h (lookup_symbol_in_language): Remove SYMTAB parameter.
(lookup_symbol): Likewise.
* symtab.c (lookup_symbol_in_language): Remove SYMTAB parameter.
(lookup_symbol): Likewise.
(search_symbols): Update.
* linespec.c (find_methods, collect_methods): Update.
(add_matching_methods, add_constructors): Update.
(decode_compound, decode_dollar, decode_variable): Update.
(lookup_prefix_sym): Update.
(symbol_found): Remove SYM_SYMTAB parameter.
Use SYMBOL_SYMTAB (sym) instead.
* gdbtypes.c (lookup_typename): Update.
(lookup_struct, lookup_union, lookup_enum): Update.
(lookup_template_type): Update.
(check_typedef): Update.
* language.c (lang_bool_type): Update.
* mdebugread.c (parse_procedure): Update.
* mi/mi-cmd-stack.c (list_args_or_locals): Update.
* parse.c (write_dollar_variable): Update.
* printcmd.c (address_info): Update.
* source.c (select_source_symtab): Update.
* stack.c (print_frame_args, print_frame_arg_vars): Update.
* valops.c (find_function_in_inferior): Update.
(value_struct_elt_for_reference): Update.
* value.c (value_static_field, value_fn_field): Update.
* alpha-mdebug-tdep.c (find_proc_desc): Update.
* arm-tdep.c (arm_skip_prologue): Update.
* mt-tdep.c (mt_skip_prologue): Update.
* xstormy16-tdep.c (xstormy16_skip_prologue): Update.
* ada-lang.h (struct ada_symbol_info): Remove SYMTAB member.
* ada-lang.c (ada_add_block_symbols): Remove SYMTAB parameter.
(add_defn_to_vec): Likewise.
(ada_add_block_symbols): Likewise.
(lookup_cached_symbol, cache_symbol): Likewise.
(standard_lookup): Update.
(ada_lookup_symbol_list): Update.
* c-valprint.c (c_val_print): Update.
* cp-support.c (cp_lookup_rtti_type): Update.
* jv-lang.c (java_lookup_class, get_java_object_type): Update.
* objc-lang.c (lookup_struct_typedef, find_imps): Update.
* p-valprint.c (pascal_val_print): Update.
* scm-lang.c (scm_lookup_name): Update.
* c-exp.y: Update.
* f-exp.y: Update.
* jv-exp.y: Update.
* m2-exp.y: Update.
* objc-exp.y: Update.
* p-exp.y: Update.
2008-05-19 Ulrich Weigand <uweigand@de.ibm.com> 2008-05-19 Ulrich Weigand <uweigand@de.ibm.com>
* language.h (struct language_defn): Remove SYMTAB parameter from * language.h (struct language_defn): Remove SYMTAB parameter from

View file

@ -115,13 +115,12 @@ static struct value *make_array_descriptor (struct type *, struct value *,
static void ada_add_block_symbols (struct obstack *, static void ada_add_block_symbols (struct obstack *,
struct block *, const char *, struct block *, const char *,
domain_enum, struct objfile *, domain_enum, struct objfile *, int);
struct symtab *, int);
static int is_nonfunction (struct ada_symbol_info *, int); static int is_nonfunction (struct ada_symbol_info *, int);
static void add_defn_to_vec (struct obstack *, struct symbol *, static void add_defn_to_vec (struct obstack *, struct symbol *,
struct block *, struct symtab *); struct block *);
static int num_defns_collected (struct obstack *); static int num_defns_collected (struct obstack *);
@ -3976,15 +3975,14 @@ make_array_descriptor (struct type *type, struct value *arr, CORE_ADDR *sp)
static int static int
lookup_cached_symbol (const char *name, domain_enum namespace, lookup_cached_symbol (const char *name, domain_enum namespace,
struct symbol **sym, struct block **block, struct symbol **sym, struct block **block)
struct symtab **symtab)
{ {
return 0; return 0;
} }
static void static void
cache_symbol (const char *name, domain_enum namespace, struct symbol *sym, cache_symbol (const char *name, domain_enum namespace, struct symbol *sym,
struct block *block, struct symtab *symtab) struct block *block)
{ {
} }
@ -3998,13 +3996,11 @@ standard_lookup (const char *name, const struct block *block,
domain_enum domain) domain_enum domain)
{ {
struct symbol *sym; struct symbol *sym;
struct symtab *symtab;
if (lookup_cached_symbol (name, domain, &sym, NULL, NULL)) if (lookup_cached_symbol (name, domain, &sym, NULL))
return sym; return sym;
sym = sym = lookup_symbol_in_language (name, block, domain, language_c, 0);
lookup_symbol_in_language (name, block, domain, language_c, 0, &symtab); cache_symbol (name, domain, sym, block_found);
cache_symbol (name, domain, sym, block_found, symtab);
return sym; return sym;
} }
@ -4089,7 +4085,7 @@ lesseq_defined_than (struct symbol *sym0, struct symbol *sym1)
static void static void
add_defn_to_vec (struct obstack *obstackp, add_defn_to_vec (struct obstack *obstackp,
struct symbol *sym, struct symbol *sym,
struct block *block, struct symtab *symtab) struct block *block)
{ {
int i; int i;
size_t tmp; size_t tmp;
@ -4112,7 +4108,6 @@ add_defn_to_vec (struct obstack *obstackp,
{ {
prevDefns[i].sym = sym; prevDefns[i].sym = sym;
prevDefns[i].block = block; prevDefns[i].block = block;
prevDefns[i].symtab = symtab;
return; return;
} }
} }
@ -4122,7 +4117,6 @@ add_defn_to_vec (struct obstack *obstackp,
info.sym = sym; info.sym = sym;
info.block = block; info.block = block;
info.symtab = symtab;
obstack_grow (obstackp, &info, sizeof (struct ada_symbol_info)); obstack_grow (obstackp, &info, sizeof (struct ada_symbol_info));
} }
} }
@ -4726,7 +4720,7 @@ ada_lookup_symbol_list (const char *name0, const struct block *block0,
{ {
block_depth += 1; block_depth += 1;
ada_add_block_symbols (&symbol_list_obstack, block, name, ada_add_block_symbols (&symbol_list_obstack, block, name,
namespace, NULL, NULL, wild_match); namespace, NULL, wild_match);
/* If we found a non-function match, assume that's the one. */ /* If we found a non-function match, assume that's the one. */
if (is_nonfunction (defns_collected (&symbol_list_obstack, 0), if (is_nonfunction (defns_collected (&symbol_list_obstack, 0),
@ -4748,10 +4742,10 @@ ada_lookup_symbol_list (const char *name0, const struct block *block0,
goto done; goto done;
cacheIfUnique = 1; cacheIfUnique = 1;
if (lookup_cached_symbol (name0, namespace, &sym, &block, &s)) if (lookup_cached_symbol (name0, namespace, &sym, &block))
{ {
if (sym != NULL) if (sym != NULL)
add_defn_to_vec (&symbol_list_obstack, sym, block, s); add_defn_to_vec (&symbol_list_obstack, sym, block);
goto done; goto done;
} }
@ -4764,7 +4758,7 @@ ada_lookup_symbol_list (const char *name0, const struct block *block0,
bv = BLOCKVECTOR (s); bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK); block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
ada_add_block_symbols (&symbol_list_obstack, block, name, namespace, ada_add_block_symbols (&symbol_list_obstack, block, name, namespace,
objfile, s, wild_match); objfile, wild_match);
} }
if (namespace == VAR_DOMAIN) if (namespace == VAR_DOMAIN)
@ -4787,14 +4781,14 @@ ada_lookup_symbol_list (const char *name0, const struct block *block0,
block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK); block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
ada_add_block_symbols (&symbol_list_obstack, block, ada_add_block_symbols (&symbol_list_obstack, block,
SYMBOL_LINKAGE_NAME (msymbol), SYMBOL_LINKAGE_NAME (msymbol),
namespace, objfile, s, wild_match); namespace, objfile, wild_match);
if (num_defns_collected (&symbol_list_obstack) == ndefns0) if (num_defns_collected (&symbol_list_obstack) == ndefns0)
{ {
block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK); block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
ada_add_block_symbols (&symbol_list_obstack, block, ada_add_block_symbols (&symbol_list_obstack, block,
SYMBOL_LINKAGE_NAME (msymbol), SYMBOL_LINKAGE_NAME (msymbol),
namespace, objfile, s, namespace, objfile,
wild_match); wild_match);
} }
} }
@ -4815,7 +4809,7 @@ ada_lookup_symbol_list (const char *name0, const struct block *block0,
bv = BLOCKVECTOR (s); bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK); block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
ada_add_block_symbols (&symbol_list_obstack, block, name, ada_add_block_symbols (&symbol_list_obstack, block, name,
namespace, objfile, s, wild_match); namespace, objfile, wild_match);
} }
} }
@ -4832,7 +4826,7 @@ ada_lookup_symbol_list (const char *name0, const struct block *block0,
bv = BLOCKVECTOR (s); bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK); block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
ada_add_block_symbols (&symbol_list_obstack, block, name, namespace, ada_add_block_symbols (&symbol_list_obstack, block, name, namespace,
objfile, s, wild_match); objfile, wild_match);
} }
ALL_PSYMTABS (objfile, ps) ALL_PSYMTABS (objfile, ps)
@ -4847,7 +4841,7 @@ ada_lookup_symbol_list (const char *name0, const struct block *block0,
continue; continue;
block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK); block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
ada_add_block_symbols (&symbol_list_obstack, block, name, ada_add_block_symbols (&symbol_list_obstack, block, name,
namespace, objfile, s, wild_match); namespace, objfile, wild_match);
} }
} }
} }
@ -4859,11 +4853,10 @@ done:
ndefns = remove_extra_symbols (*results, ndefns); ndefns = remove_extra_symbols (*results, ndefns);
if (ndefns == 0) if (ndefns == 0)
cache_symbol (name0, namespace, NULL, NULL, NULL); cache_symbol (name0, namespace, NULL, NULL);
if (ndefns == 1 && cacheIfUnique) if (ndefns == 1 && cacheIfUnique)
cache_symbol (name0, namespace, (*results)[0].sym, (*results)[0].block, cache_symbol (name0, namespace, (*results)[0].sym, (*results)[0].block);
(*results)[0].symtab);
ndefns = remove_irrelevant_renamings (*results, ndefns, block0); ndefns = remove_irrelevant_renamings (*results, ndefns, block0);
@ -5205,7 +5198,7 @@ static void
ada_add_block_symbols (struct obstack *obstackp, ada_add_block_symbols (struct obstack *obstackp,
struct block *block, const char *name, struct block *block, const char *name,
domain_enum domain, struct objfile *objfile, domain_enum domain, struct objfile *objfile,
struct symtab *symtab, int wild) int wild)
{ {
struct dict_iterator iter; struct dict_iterator iter;
int name_len = strlen (name); int name_len = strlen (name);
@ -5243,7 +5236,7 @@ ada_add_block_symbols (struct obstack *obstackp,
found_sym = 1; found_sym = 1;
add_defn_to_vec (obstackp, add_defn_to_vec (obstackp,
fixup_symbol_section (sym, objfile), fixup_symbol_section (sym, objfile),
block, symtab); block);
break; break;
} }
} }
@ -5277,7 +5270,7 @@ ada_add_block_symbols (struct obstack *obstackp,
found_sym = 1; found_sym = 1;
add_defn_to_vec (obstackp, add_defn_to_vec (obstackp,
fixup_symbol_section (sym, objfile), fixup_symbol_section (sym, objfile),
block, symtab); block);
break; break;
} }
} }
@ -5289,7 +5282,7 @@ ada_add_block_symbols (struct obstack *obstackp,
{ {
add_defn_to_vec (obstackp, add_defn_to_vec (obstackp,
fixup_symbol_section (arg_sym, objfile), fixup_symbol_section (arg_sym, objfile),
block, symtab); block);
} }
if (!wild) if (!wild)
@ -5333,7 +5326,7 @@ ada_add_block_symbols (struct obstack *obstackp,
found_sym = 1; found_sym = 1;
add_defn_to_vec (obstackp, add_defn_to_vec (obstackp,
fixup_symbol_section (sym, objfile), fixup_symbol_section (sym, objfile),
block, symtab); block);
break; break;
} }
} }
@ -5346,7 +5339,7 @@ ada_add_block_symbols (struct obstack *obstackp,
{ {
add_defn_to_vec (obstackp, add_defn_to_vec (obstackp,
fixup_symbol_section (arg_sym, objfile), fixup_symbol_section (arg_sym, objfile),
block, symtab); block);
} }
} }
} }

View file

@ -165,12 +165,11 @@ enum ada_operator
OP_ADA_LAST OP_ADA_LAST
}; };
/* A triple, (symbol, block, symtab), representing one instance of a /* A tuple, (symbol, block), representing one instance of a
* symbol-lookup operation. */ * symbol-lookup operation. */
struct ada_symbol_info { struct ada_symbol_info {
struct symbol* sym; struct symbol* sym;
struct block* block; struct block* block;
struct symtab* symtab;
}; };
/* Denotes a type of renaming symbol (see ada_parse_renaming). */ /* Denotes a type of renaming symbol (see ada_parse_renaming). */

View file

@ -109,7 +109,7 @@ find_proc_desc (CORE_ADDR pc)
symbol reading. */ symbol reading. */
sym = NULL; sym = NULL;
else else
sym = lookup_symbol (MDEBUG_EFI_SYMBOL_NAME, b, LABEL_DOMAIN, 0, NULL); sym = lookup_symbol (MDEBUG_EFI_SYMBOL_NAME, b, LABEL_DOMAIN, 0);
} }
if (sym) if (sym)

View file

@ -534,7 +534,7 @@ arm_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
struct symbol *sym; struct symbol *sym;
/* Found a function. */ /* Found a function. */
sym = lookup_symbol (func_name, NULL, VAR_DOMAIN, NULL, NULL); sym = lookup_symbol (func_name, NULL, VAR_DOMAIN, NULL);
if (sym && SYMBOL_LANGUAGE (sym) != language_asm) if (sym && SYMBOL_LANGUAGE (sym) != language_asm)
{ {
/* Don't use this trick for assembly source files. */ /* Don't use this trick for assembly source files. */

View file

@ -583,8 +583,7 @@ block : BLOCKNAME
block : block COLONCOLON name block : block COLONCOLON name
{ struct symbol *tem { struct symbol *tem
= lookup_symbol (copy_name ($3), $1, = lookup_symbol (copy_name ($3), $1,
VAR_DOMAIN, (int *) NULL, VAR_DOMAIN, (int *) NULL);
(struct symtab **) NULL);
if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK) if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK)
error ("No function \"%s\" in specified context.", error ("No function \"%s\" in specified context.",
copy_name ($3)); copy_name ($3));
@ -594,8 +593,7 @@ block : block COLONCOLON name
variable: block COLONCOLON name variable: block COLONCOLON name
{ struct symbol *sym; { struct symbol *sym;
sym = lookup_symbol (copy_name ($3), $1, sym = lookup_symbol (copy_name ($3), $1,
VAR_DOMAIN, (int *) NULL, VAR_DOMAIN, (int *) NULL);
(struct symtab **) NULL);
if (sym == 0) if (sym == 0)
error ("No symbol \"%s\" in specified context.", error ("No symbol \"%s\" in specified context.",
copy_name ($3)); copy_name ($3));
@ -655,8 +653,7 @@ variable: qualified_name
sym = sym =
lookup_symbol (name, (const struct block *) NULL, lookup_symbol (name, (const struct block *) NULL,
VAR_DOMAIN, (int *) NULL, VAR_DOMAIN, (int *) NULL);
(struct symtab **) NULL);
if (sym) if (sym)
{ {
write_exp_elt_opcode (OP_VAR_VALUE); write_exp_elt_opcode (OP_VAR_VALUE);
@ -1754,8 +1751,7 @@ yylex ()
sym = lookup_symbol (tmp, expression_context_block, sym = lookup_symbol (tmp, expression_context_block,
VAR_DOMAIN, VAR_DOMAIN,
current_language->la_language == language_cplus current_language->la_language == language_cplus
? &is_a_field_of_this : (int *) NULL, ? &is_a_field_of_this : (int *) NULL);
(struct symtab **) NULL);
/* Call lookup_symtab, not lookup_partial_symtab, in case there are /* Call lookup_symtab, not lookup_partial_symtab, in case there are
no psymtabs (coff, xcoff, or some future change to blow away the no psymtabs (coff, xcoff, or some future change to blow away the
psymtabs once once symbols are read). */ psymtabs once once symbols are read). */

View file

@ -262,7 +262,7 @@ c_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
if (msymbol != NULL) if (msymbol != NULL)
wsym = lookup_symbol (DEPRECATED_SYMBOL_NAME (msymbol), block, wsym = lookup_symbol (DEPRECATED_SYMBOL_NAME (msymbol), block,
VAR_DOMAIN, &is_this_fld, NULL); VAR_DOMAIN, &is_this_fld);
if (wsym) if (wsym)
{ {

View file

@ -841,7 +841,7 @@ cp_lookup_rtti_type (const char *name, struct block *block)
struct symbol * rtti_sym; struct symbol * rtti_sym;
struct type * rtti_type; struct type * rtti_type;
rtti_sym = lookup_symbol (name, block, STRUCT_DOMAIN, NULL, NULL); rtti_sym = lookup_symbol (name, block, STRUCT_DOMAIN, NULL);
if (rtti_sym == NULL) if (rtti_sym == NULL)
{ {

View file

@ -1175,8 +1175,7 @@ yylex ()
sym = lookup_symbol (tmp, expression_context_block, sym = lookup_symbol (tmp, expression_context_block,
VAR_DOMAIN, VAR_DOMAIN,
current_language->la_language == language_cplus current_language->la_language == language_cplus
? &is_a_field_of_this : NULL, ? &is_a_field_of_this : NULL);
NULL);
if (sym && SYMBOL_CLASS (sym) == LOC_TYPEDEF) if (sym && SYMBOL_CLASS (sym) == LOC_TYPEDEF)
{ {
yylval.tsym.type = SYMBOL_TYPE (sym); yylval.tsym.type = SYMBOL_TYPE (sym);

View file

@ -1045,8 +1045,7 @@ lookup_typename (char *name, struct block *block, int noerr)
struct symbol *sym; struct symbol *sym;
struct type *tmp; struct type *tmp;
sym = lookup_symbol (name, block, VAR_DOMAIN, 0, sym = lookup_symbol (name, block, VAR_DOMAIN, 0);
(struct symtab **) NULL);
if (sym == NULL || SYMBOL_CLASS (sym) != LOC_TYPEDEF) if (sym == NULL || SYMBOL_CLASS (sym) != LOC_TYPEDEF)
{ {
tmp = language_lookup_primitive_type_by_name (current_language, tmp = language_lookup_primitive_type_by_name (current_language,
@ -1101,8 +1100,7 @@ lookup_struct (char *name, struct block *block)
{ {
struct symbol *sym; struct symbol *sym;
sym = lookup_symbol (name, block, STRUCT_DOMAIN, 0, sym = lookup_symbol (name, block, STRUCT_DOMAIN, 0);
(struct symtab **) NULL);
if (sym == NULL) if (sym == NULL)
{ {
@ -1125,8 +1123,7 @@ lookup_union (char *name, struct block *block)
struct symbol *sym; struct symbol *sym;
struct type *t; struct type *t;
sym = lookup_symbol (name, block, STRUCT_DOMAIN, 0, sym = lookup_symbol (name, block, STRUCT_DOMAIN, 0);
(struct symtab **) NULL);
if (sym == NULL) if (sym == NULL)
error (_("No union type named %s."), name); error (_("No union type named %s."), name);
@ -1157,8 +1154,7 @@ lookup_enum (char *name, struct block *block)
{ {
struct symbol *sym; struct symbol *sym;
sym = lookup_symbol (name, block, STRUCT_DOMAIN, 0, sym = lookup_symbol (name, block, STRUCT_DOMAIN, 0);
(struct symtab **) NULL);
if (sym == NULL) if (sym == NULL)
{ {
error (_("No enum type named %s."), name); error (_("No enum type named %s."), name);
@ -1186,8 +1182,7 @@ lookup_template_type (char *name, struct type *type,
strcat (nam, TYPE_NAME (type)); strcat (nam, TYPE_NAME (type));
strcat (nam, " >"); /* FIXME, extra space still introduced in gcc? */ 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);
(struct symtab **) NULL);
if (sym == NULL) if (sym == NULL)
{ {
@ -1425,8 +1420,7 @@ check_typedef (struct type *type)
stub_noname_complaint (); stub_noname_complaint ();
return type; return type;
} }
sym = lookup_symbol (name, 0, STRUCT_DOMAIN, 0, sym = lookup_symbol (name, 0, STRUCT_DOMAIN, 0);
(struct symtab **) NULL);
if (sym) if (sym)
TYPE_TARGET_TYPE (type) = SYMBOL_TYPE (sym); TYPE_TARGET_TYPE (type) = SYMBOL_TYPE (sym);
else /* TYPE_CODE_UNDEF */ else /* TYPE_CODE_UNDEF */
@ -1490,8 +1484,7 @@ check_typedef (struct type *type)
stub_noname_complaint (); stub_noname_complaint ();
return type; return type;
} }
sym = lookup_symbol (name, 0, STRUCT_DOMAIN, sym = lookup_symbol (name, 0, STRUCT_DOMAIN, 0);
0, (struct symtab **) NULL);
if (sym) if (sym)
{ {
/* Same as above for opaque types, we can replace the stub /* Same as above for opaque types, we can replace the stub

View file

@ -1229,7 +1229,7 @@ push_variable (struct stoken name)
int is_a_field_of_this = 0; int is_a_field_of_this = 0;
struct symbol *sym; struct symbol *sym;
sym = lookup_symbol (tmp, expression_context_block, VAR_DOMAIN, sym = lookup_symbol (tmp, expression_context_block, VAR_DOMAIN,
&is_a_field_of_this, (struct symtab **) NULL); &is_a_field_of_this);
if (sym && SYMBOL_CLASS (sym) != LOC_TYPEDEF) if (sym && SYMBOL_CLASS (sym) != LOC_TYPEDEF)
{ {
if (symbol_read_needs_frame (sym)) if (symbol_read_needs_frame (sym))

View file

@ -169,8 +169,7 @@ struct type *
java_lookup_class (char *name) java_lookup_class (char *name)
{ {
struct symbol *sym; struct symbol *sym;
sym = lookup_symbol (name, expression_context_block, STRUCT_DOMAIN, sym = lookup_symbol (name, expression_context_block, STRUCT_DOMAIN, NULL);
(int *) 0, (struct symtab **) NULL);
if (sym != NULL) if (sym != NULL)
return SYMBOL_TYPE (sym); return SYMBOL_TYPE (sym);
#if 0 #if 0
@ -577,8 +576,7 @@ get_java_object_type (void)
if (java_object_type == NULL) if (java_object_type == NULL)
{ {
struct symbol *sym; struct symbol *sym;
sym = lookup_symbol ("java.lang.Object", NULL, STRUCT_DOMAIN, sym = lookup_symbol ("java.lang.Object", NULL, STRUCT_DOMAIN, NULL);
(int *) 0, (struct symtab **) NULL);
if (sym == NULL) if (sym == NULL)
error (_("cannot find java.lang.Object")); error (_("cannot find java.lang.Object"));
java_object_type = SYMBOL_TYPE (sym); java_object_type = SYMBOL_TYPE (sym);

View file

@ -795,7 +795,7 @@ lang_bool_type (void)
switch (current_language->la_language) switch (current_language->la_language)
{ {
case language_fortran: case language_fortran:
sym = lookup_symbol ("logical", NULL, VAR_DOMAIN, NULL, NULL); sym = lookup_symbol ("logical", NULL, VAR_DOMAIN, NULL);
if (sym) if (sym)
{ {
type = SYMBOL_TYPE (sym); type = SYMBOL_TYPE (sym);
@ -807,9 +807,9 @@ lang_bool_type (void)
case language_pascal: case language_pascal:
case language_ada: case language_ada:
if (current_language->la_language==language_cplus) if (current_language->la_language==language_cplus)
{sym = lookup_symbol ("bool", NULL, VAR_DOMAIN, NULL, NULL);} {sym = lookup_symbol ("bool", NULL, VAR_DOMAIN, NULL);}
else else
{sym = lookup_symbol ("boolean", NULL, VAR_DOMAIN, NULL, NULL);} {sym = lookup_symbol ("boolean", NULL, VAR_DOMAIN, NULL);}
if (sym) if (sym)
{ {
type = SYMBOL_TYPE (sym); type = SYMBOL_TYPE (sym);
@ -818,7 +818,7 @@ lang_bool_type (void)
} }
return builtin_type_bool; return builtin_type_bool;
case language_java: case language_java:
sym = lookup_symbol ("boolean", NULL, VAR_DOMAIN, NULL, NULL); sym = lookup_symbol ("boolean", NULL, VAR_DOMAIN, NULL);
if (sym) if (sym)
{ {
type = SYMBOL_TYPE (sym); type = SYMBOL_TYPE (sym);

View file

@ -136,8 +136,7 @@ symtabs_and_lines symbol_found (int funfirstline,
char ***canonical, char ***canonical,
char *copy, char *copy,
struct symbol *sym, struct symbol *sym,
struct symtab *file_symtab, struct symtab *file_symtab);
struct symtab *sym_symtab);
static struct static struct
symtabs_and_lines minsym_found (int funfirstline, symtabs_and_lines minsym_found (int funfirstline,
@ -214,8 +213,7 @@ find_methods (struct type *t, char *name, enum language language,
the class, then the loop can't do any good. */ the class, then the loop can't do any good. */
if (class_name if (class_name
&& (lookup_symbol_in_language (class_name, (struct block *) NULL, && (lookup_symbol_in_language (class_name, (struct block *) NULL,
STRUCT_DOMAIN, language, (int *) NULL, STRUCT_DOMAIN, language, (int *) NULL)))
(struct symtab **) NULL)))
{ {
int method_counter; int method_counter;
int name_len = strlen (name); int name_len = strlen (name);
@ -316,8 +314,7 @@ add_matching_methods (int method_counter, struct type *t,
sym_arr[i1] = lookup_symbol_in_language (phys_name, sym_arr[i1] = lookup_symbol_in_language (phys_name,
NULL, VAR_DOMAIN, NULL, VAR_DOMAIN,
language, language,
(int *) NULL, (int *) NULL);
(struct symtab **) NULL);
if (sym_arr[i1]) if (sym_arr[i1])
i1++; i1++;
else else
@ -374,8 +371,7 @@ add_constructors (int method_counter, struct type *t,
sym_arr[i1] = lookup_symbol_in_language (phys_name, sym_arr[i1] = lookup_symbol_in_language (phys_name,
NULL, VAR_DOMAIN, NULL, VAR_DOMAIN,
language, language,
(int *) NULL, (int *) NULL);
(struct symtab **) NULL);
if (sym_arr[i1]) if (sym_arr[i1])
i1++; i1++;
} }
@ -800,12 +796,11 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab,
copy = (char *) alloca (p - *argptr + 1); copy = (char *) alloca (p - *argptr + 1);
memcpy (copy, *argptr, p - *argptr); memcpy (copy, *argptr, p - *argptr);
copy[p - *argptr] = '\000'; copy[p - *argptr] = '\000';
sym = lookup_symbol (copy, 0, VAR_DOMAIN, 0, &sym_symtab); sym = lookup_symbol (copy, 0, VAR_DOMAIN, 0);
if (sym) if (sym)
{ {
*argptr = (*p == '\'') ? p + 1 : p; *argptr = (*p == '\'') ? p + 1 : p;
return symbol_found (funfirstline, canonical, copy, sym, return symbol_found (funfirstline, canonical, copy, sym, NULL);
NULL, sym_symtab);
} }
/* Otherwise fall out from here and go to file/line spec /* Otherwise fall out from here and go to file/line spec
processing, etc. */ processing, etc. */
@ -1199,8 +1194,6 @@ decode_compound (char **argptr, int funfirstline, char ***canonical,
char *saved_arg2 = *argptr; char *saved_arg2 = *argptr;
char *temp_end; char *temp_end;
struct symbol *sym; struct symbol *sym;
/* The symtab that SYM was found in. */
struct symtab *sym_symtab;
char *copy; char *copy;
struct symbol *sym_class; struct symbol *sym_class;
struct symbol **sym_arr; struct symbol **sym_arr;
@ -1378,10 +1371,9 @@ decode_compound (char **argptr, int funfirstline, char ***canonical,
*argptr = (*p == '\'') ? p + 1 : p; *argptr = (*p == '\'') ? p + 1 : p;
/* Look up entire name */ /* Look up entire name */
sym = lookup_symbol (copy, 0, VAR_DOMAIN, 0, &sym_symtab); sym = lookup_symbol (copy, 0, VAR_DOMAIN, 0);
if (sym) if (sym)
return symbol_found (funfirstline, canonical, copy, sym, return symbol_found (funfirstline, canonical, copy, sym, NULL);
NULL, sym_symtab);
/* Couldn't find any interpretation as classes/namespaces, so give /* Couldn't find any interpretation as classes/namespaces, so give
up. The quotes are important if copy is empty. */ up. The quotes are important if copy is empty. */
@ -1422,8 +1414,7 @@ lookup_prefix_sym (char **argptr, char *p)
/* At this point p1->"::inA::fun", p->"inA::fun" copy->"AAA", /* At this point p1->"::inA::fun", p->"inA::fun" copy->"AAA",
argptr->"inA::fun" */ argptr->"inA::fun" */
return lookup_symbol (copy, 0, STRUCT_DOMAIN, 0, return lookup_symbol (copy, 0, STRUCT_DOMAIN, 0);
(struct symtab **) NULL);
} }
/* This finds the method COPY in the class whose type is T and whose /* This finds the method COPY in the class whose type is T and whose
@ -1513,8 +1504,7 @@ collect_methods (char *copy, struct type *t,
sym_arr[i1] = sym_arr[i1] =
lookup_symbol (TYPE_FN_FIELD_PHYSNAME (f, f_index), lookup_symbol (TYPE_FN_FIELD_PHYSNAME (f, f_index),
NULL, VAR_DOMAIN, (int *) NULL, NULL, VAR_DOMAIN, (int *) NULL);
(struct symtab **) NULL);
if (sym_arr[i1]) if (sym_arr[i1])
i1++; i1++;
} }
@ -1677,8 +1667,6 @@ decode_dollar (char *copy, int funfirstline, struct symtab *default_symtab,
struct symtab_and_line val; struct symtab_and_line val;
char *p; char *p;
struct symbol *sym; struct symbol *sym;
/* The symtab that SYM was found in. */
struct symtab *sym_symtab;
struct minimal_symbol *msymbol; struct minimal_symbol *msymbol;
p = (copy[1] == '$') ? copy + 2 : copy + 1; p = (copy[1] == '$') ? copy + 2 : copy + 1;
@ -1698,13 +1686,12 @@ decode_dollar (char *copy, int funfirstline, struct symtab *default_symtab,
convenience variable. */ convenience variable. */
/* Look up entire name as a symbol first. */ /* Look up entire name as a symbol first. */
sym = lookup_symbol (copy, 0, VAR_DOMAIN, 0, &sym_symtab); sym = lookup_symbol (copy, 0, VAR_DOMAIN, 0);
file_symtab = (struct symtab *) NULL; file_symtab = (struct symtab *) NULL;
need_canonical = 1; need_canonical = 1;
/* Symbol was found --> jump to normal symbol processing. */ /* Symbol was found --> jump to normal symbol processing. */
if (sym) if (sym)
return symbol_found (funfirstline, canonical, copy, sym, return symbol_found (funfirstline, canonical, copy, sym, NULL);
NULL, sym_symtab);
/* If symbol was not found, look in minimal symbol tables. */ /* If symbol was not found, look in minimal symbol tables. */
msymbol = lookup_minimal_symbol (copy, NULL, NULL); msymbol = lookup_minimal_symbol (copy, NULL, NULL);
@ -1747,8 +1734,6 @@ decode_variable (char *copy, int funfirstline, char ***canonical,
struct symtab *file_symtab, int *not_found_ptr) struct symtab *file_symtab, int *not_found_ptr)
{ {
struct symbol *sym; struct symbol *sym;
/* The symtab that SYM was found in. */
struct symtab *sym_symtab;
struct minimal_symbol *msymbol; struct minimal_symbol *msymbol;
@ -1757,11 +1742,10 @@ decode_variable (char *copy, int funfirstline, char ***canonical,
? BLOCKVECTOR_BLOCK (BLOCKVECTOR (file_symtab), ? BLOCKVECTOR_BLOCK (BLOCKVECTOR (file_symtab),
STATIC_BLOCK) STATIC_BLOCK)
: get_selected_block (0)), : get_selected_block (0)),
VAR_DOMAIN, 0, &sym_symtab); VAR_DOMAIN, 0);
if (sym != NULL) if (sym != NULL)
return symbol_found (funfirstline, canonical, copy, sym, return symbol_found (funfirstline, canonical, copy, sym, file_symtab);
file_symtab, sym_symtab);
msymbol = lookup_minimal_symbol (copy, NULL, NULL); msymbol = lookup_minimal_symbol (copy, NULL, NULL);
@ -1788,8 +1772,7 @@ decode_variable (char *copy, int funfirstline, char ***canonical,
static struct symtabs_and_lines static struct symtabs_and_lines
symbol_found (int funfirstline, char ***canonical, char *copy, symbol_found (int funfirstline, char ***canonical, char *copy,
struct symbol *sym, struct symtab *file_symtab, struct symbol *sym, struct symtab *file_symtab)
struct symtab *sym_symtab)
{ {
struct symtabs_and_lines values; struct symtabs_and_lines values;
@ -1809,7 +1792,7 @@ symbol_found (int funfirstline, char ***canonical, char *copy,
function. */ function. */
if (file_symtab == 0) if (file_symtab == 0)
{ {
struct blockvector *bv = BLOCKVECTOR (sym_symtab); struct blockvector *bv = BLOCKVECTOR (SYMBOL_SYMTAB (sym));
struct block *b = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK); struct block *b = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
if (lookup_block_symbol (b, copy, NULL, VAR_DOMAIN) != NULL) if (lookup_block_symbol (b, copy, NULL, VAR_DOMAIN) != NULL)
build_canonical_line_spec (values.sals, copy, canonical); build_canonical_line_spec (values.sals, copy, canonical);
@ -1827,7 +1810,7 @@ symbol_found (int funfirstline, char ***canonical, char *copy,
xmalloc (sizeof (struct symtab_and_line)); xmalloc (sizeof (struct symtab_and_line));
values.nelts = 1; values.nelts = 1;
memset (&values.sals[0], 0, sizeof (values.sals[0])); memset (&values.sals[0], 0, sizeof (values.sals[0]));
values.sals[0].symtab = sym_symtab; values.sals[0].symtab = SYMBOL_SYMTAB (sym);
values.sals[0].line = SYMBOL_LINE (sym); values.sals[0].line = SYMBOL_LINE (sym);
return values; return values;
} }

View file

@ -550,7 +550,7 @@ block : fblock
fblock : BLOCKNAME fblock : BLOCKNAME
{ struct symbol *sym { struct symbol *sym
= lookup_symbol (copy_name ($1), expression_context_block, = lookup_symbol (copy_name ($1), expression_context_block,
VAR_DOMAIN, 0, NULL); VAR_DOMAIN, 0);
$$ = sym;} $$ = sym;}
; ;
@ -559,7 +559,7 @@ fblock : BLOCKNAME
fblock : block COLONCOLON BLOCKNAME fblock : block COLONCOLON BLOCKNAME
{ struct symbol *tem { struct symbol *tem
= lookup_symbol (copy_name ($3), $1, = lookup_symbol (copy_name ($3), $1,
VAR_DOMAIN, 0, NULL); VAR_DOMAIN, 0);
if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK) if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK)
error ("No function \"%s\" in specified context.", error ("No function \"%s\" in specified context.",
copy_name ($3)); copy_name ($3));
@ -583,7 +583,7 @@ variable: INTERNAL_VAR
variable: block COLONCOLON NAME variable: block COLONCOLON NAME
{ struct symbol *sym; { struct symbol *sym;
sym = lookup_symbol (copy_name ($3), $1, sym = lookup_symbol (copy_name ($3), $1,
VAR_DOMAIN, 0, NULL); VAR_DOMAIN, 0);
if (sym == 0) if (sym == 0)
error ("No symbol \"%s\" in specified context.", error ("No symbol \"%s\" in specified context.",
copy_name ($3)); copy_name ($3));
@ -603,8 +603,7 @@ variable: NAME
sym = lookup_symbol (copy_name ($1), sym = lookup_symbol (copy_name ($1),
expression_context_block, expression_context_block,
VAR_DOMAIN, VAR_DOMAIN,
&is_a_field_of_this, &is_a_field_of_this);
NULL);
if (sym) if (sym)
{ {
if (symbol_read_needs_frame (sym)) if (symbol_read_needs_frame (sym))
@ -1028,8 +1027,7 @@ yylex ()
if (lookup_partial_symtab (tmp)) if (lookup_partial_symtab (tmp))
return BLOCKNAME; return BLOCKNAME;
sym = lookup_symbol (tmp, expression_context_block, sym = lookup_symbol (tmp, expression_context_block, VAR_DOMAIN, 0);
VAR_DOMAIN, 0, NULL);
if (sym && SYMBOL_CLASS (sym) == LOC_BLOCK) if (sym && SYMBOL_CLASS (sym) == LOC_BLOCK)
return BLOCKNAME; return BLOCKNAME;
if (lookup_typename (copy_name (yylval.sval), expression_context_block, 1)) if (lookup_typename (copy_name (yylval.sval), expression_context_block, 1))

View file

@ -1880,7 +1880,7 @@ parse_procedure (PDR *pr, struct symtab *search_symtab,
the same name exists, lookup_symbol will eventually read in the symtab the same name exists, lookup_symbol will eventually read in the symtab
for the global function and clobber cur_fdr. */ for the global function and clobber cur_fdr. */
FDR *save_cur_fdr = cur_fdr; FDR *save_cur_fdr = cur_fdr;
s = lookup_symbol (sh_name, NULL, VAR_DOMAIN, 0, NULL); s = lookup_symbol (sh_name, NULL, VAR_DOMAIN, 0);
cur_fdr = save_cur_fdr; cur_fdr = save_cur_fdr;
#else #else
s = mylookup_symbol s = mylookup_symbol

View file

@ -283,8 +283,7 @@ list_args_or_locals (int locals, int values, struct frame_info *fi)
if (!locals) if (!locals)
sym2 = lookup_symbol (SYMBOL_NATURAL_NAME (sym), sym2 = lookup_symbol (SYMBOL_NATURAL_NAME (sym),
block, VAR_DOMAIN, block, VAR_DOMAIN,
(int *) NULL, (int *) NULL);
(struct symtab **) NULL);
else else
sym2 = sym; sym2 = sym;
switch (values) switch (values)

View file

@ -411,7 +411,7 @@ mt_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
struct symbol *sym; struct symbol *sym;
/* Found a function. */ /* Found a function. */
sym = lookup_symbol (func_name, NULL, VAR_DOMAIN, NULL, NULL); sym = lookup_symbol (func_name, NULL, VAR_DOMAIN, NULL);
if (sym && SYMBOL_LANGUAGE (sym) != language_asm) if (sym && SYMBOL_LANGUAGE (sym) != language_asm)
{ {
/* Don't use this trick for assembly source files. */ /* Don't use this trick for assembly source files. */

View file

@ -634,8 +634,7 @@ block : BLOCKNAME
block : block COLONCOLON name block : block COLONCOLON name
{ struct symbol *tem { struct symbol *tem
= lookup_symbol (copy_name ($3), $1, = lookup_symbol (copy_name ($3), $1,
VAR_DOMAIN, (int *) NULL, VAR_DOMAIN, (int *) NULL);
(struct symtab **) NULL);
if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK) if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK)
error ("No function \"%s\" in specified context.", error ("No function \"%s\" in specified context.",
copy_name ($3)); copy_name ($3));
@ -645,8 +644,7 @@ block : block COLONCOLON name
variable: block COLONCOLON name variable: block COLONCOLON name
{ struct symbol *sym; { struct symbol *sym;
sym = lookup_symbol (copy_name ($3), $1, sym = lookup_symbol (copy_name ($3), $1,
VAR_DOMAIN, (int *) NULL, VAR_DOMAIN, (int *) NULL);
(struct symtab **) NULL);
if (sym == 0) if (sym == 0)
error ("No symbol \"%s\" in specified context.", error ("No symbol \"%s\" in specified context.",
copy_name ($3)); copy_name ($3));
@ -705,8 +703,7 @@ variable: qualified_name
sym = sym =
lookup_symbol (name, (const struct block *) NULL, lookup_symbol (name, (const struct block *) NULL,
VAR_DOMAIN, (int *) NULL, VAR_DOMAIN, (int *) NULL);
(struct symtab **) NULL);
if (sym) if (sym)
{ {
write_exp_elt_opcode (OP_VAR_VALUE); write_exp_elt_opcode (OP_VAR_VALUE);
@ -1643,8 +1640,7 @@ yylex ()
sym = lookup_symbol (tmp, expression_context_block, sym = lookup_symbol (tmp, expression_context_block,
VAR_DOMAIN, VAR_DOMAIN,
need_this, need_this);
(struct symtab **) NULL);
/* Call lookup_symtab, not lookup_partial_symtab, in case there /* Call lookup_symtab, not lookup_partial_symtab, in case there
are no psymtabs (coff, xcoff, or some future change to blow are no psymtabs (coff, xcoff, or some future change to blow
away the psymtabs once symbols are read). */ away the psymtabs once symbols are read). */
@ -1721,8 +1717,7 @@ yylex ()
tmp1[p - namestart] = '\0'; tmp1[p - namestart] = '\0';
cur_sym = lookup_symbol (ncopy, cur_sym = lookup_symbol (ncopy,
expression_context_block, expression_context_block,
VAR_DOMAIN, (int *) NULL, VAR_DOMAIN, (int *) NULL);
(struct symtab **) NULL);
if (cur_sym) if (cur_sym)
{ {
if (SYMBOL_CLASS (cur_sym) == LOC_TYPEDEF) if (SYMBOL_CLASS (cur_sym) == LOC_TYPEDEF)

View file

@ -85,8 +85,7 @@ lookup_struct_typedef (char *name, struct block *block, int noerr)
{ {
struct symbol *sym; struct symbol *sym;
sym = lookup_symbol (name, block, STRUCT_DOMAIN, 0, sym = lookup_symbol (name, block, STRUCT_DOMAIN, 0);
(struct symtab **) NULL);
if (sym == NULL) if (sym == NULL)
{ {
@ -1272,7 +1271,7 @@ char *find_imps (struct symtab *symtab, struct block *block,
if (tmp == NULL) if (tmp == NULL)
return NULL; return NULL;
sym = lookup_symbol (selector, block, VAR_DOMAIN, 0, NULL); sym = lookup_symbol (selector, block, VAR_DOMAIN, 0);
if (sym != NULL) if (sym != NULL)
{ {
if (syms) if (syms)

View file

@ -596,8 +596,7 @@ block : BLOCKNAME
block : block COLONCOLON name block : block COLONCOLON name
{ struct symbol *tem { struct symbol *tem
= lookup_symbol (copy_name ($3), $1, = lookup_symbol (copy_name ($3), $1,
VAR_DOMAIN, (int *) NULL, VAR_DOMAIN, (int *) NULL);
(struct symtab **) NULL);
if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK) if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK)
error ("No function \"%s\" in specified context.", error ("No function \"%s\" in specified context.",
copy_name ($3)); copy_name ($3));
@ -607,8 +606,7 @@ block : block COLONCOLON name
variable: block COLONCOLON name variable: block COLONCOLON name
{ struct symbol *sym; { struct symbol *sym;
sym = lookup_symbol (copy_name ($3), $1, sym = lookup_symbol (copy_name ($3), $1,
VAR_DOMAIN, (int *) NULL, VAR_DOMAIN, (int *) NULL);
(struct symtab **) NULL);
if (sym == 0) if (sym == 0)
error ("No symbol \"%s\" in specified context.", error ("No symbol \"%s\" in specified context.",
copy_name ($3)); copy_name ($3));
@ -644,8 +642,7 @@ variable: qualified_name
sym = sym =
lookup_symbol (name, (const struct block *) NULL, lookup_symbol (name, (const struct block *) NULL,
VAR_DOMAIN, (int *) NULL, VAR_DOMAIN, (int *) NULL);
(struct symtab **) NULL);
if (sym) if (sym)
{ {
write_exp_elt_opcode (OP_VAR_VALUE); write_exp_elt_opcode (OP_VAR_VALUE);
@ -1435,8 +1432,7 @@ yylex ()
static const char this_name[] = "this"; static const char this_name[] = "this";
if (lookup_symbol (this_name, expression_context_block, if (lookup_symbol (this_name, expression_context_block,
VAR_DOMAIN, (int *) NULL, VAR_DOMAIN, (int *) NULL))
(struct symtab **) NULL))
{ {
free (uptokstart); free (uptokstart);
return THIS; return THIS;
@ -1480,9 +1476,7 @@ yylex ()
sym = NULL; sym = NULL;
else else
sym = lookup_symbol (tmp, expression_context_block, sym = lookup_symbol (tmp, expression_context_block,
VAR_DOMAIN, VAR_DOMAIN, &is_a_field_of_this);
&is_a_field_of_this,
(struct symtab **) NULL);
/* second chance uppercased (as Free Pascal does). */ /* second chance uppercased (as Free Pascal does). */
if (!sym && !is_a_field_of_this && !is_a_field) if (!sym && !is_a_field_of_this && !is_a_field)
{ {
@ -1497,9 +1491,7 @@ yylex ()
sym = NULL; sym = NULL;
else else
sym = lookup_symbol (tmp, expression_context_block, sym = lookup_symbol (tmp, expression_context_block,
VAR_DOMAIN, VAR_DOMAIN, &is_a_field_of_this);
&is_a_field_of_this,
(struct symtab **) NULL);
if (sym || is_a_field_of_this || is_a_field) if (sym || is_a_field_of_this || is_a_field)
for (i = 0; i <= namelen; i++) for (i = 0; i <= namelen; i++)
{ {
@ -1527,9 +1519,7 @@ yylex ()
sym = NULL; sym = NULL;
else else
sym = lookup_symbol (tmp, expression_context_block, sym = lookup_symbol (tmp, expression_context_block,
VAR_DOMAIN, VAR_DOMAIN, &is_a_field_of_this);
&is_a_field_of_this,
(struct symtab **) NULL);
if (sym || is_a_field_of_this || is_a_field) if (sym || is_a_field_of_this || is_a_field)
for (i = 0; i <= namelen; i++) for (i = 0; i <= namelen; i++)
{ {
@ -1626,8 +1616,7 @@ yylex ()
memcpy (tmp1, namestart, p - namestart); memcpy (tmp1, namestart, p - namestart);
tmp1[p - namestart] = '\0'; tmp1[p - namestart] = '\0';
cur_sym = lookup_symbol (ncopy, expression_context_block, cur_sym = lookup_symbol (ncopy, expression_context_block,
VAR_DOMAIN, (int *) NULL, VAR_DOMAIN, (int *) NULL);
(struct symtab **) NULL);
if (cur_sym) if (cur_sym)
{ {
if (SYMBOL_CLASS (cur_sym) == LOC_TYPEDEF) if (SYMBOL_CLASS (cur_sym) == LOC_TYPEDEF)

View file

@ -219,7 +219,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
if (msymbol != NULL) if (msymbol != NULL)
wsym = lookup_symbol (SYMBOL_LINKAGE_NAME (msymbol), block, wsym = lookup_symbol (SYMBOL_LINKAGE_NAME (msymbol), block,
VAR_DOMAIN, &is_this_fld, NULL); VAR_DOMAIN, &is_this_fld);
if (wsym) if (wsym)
{ {

View file

@ -543,7 +543,7 @@ write_dollar_variable (struct stoken str)
have names beginning with $ or $$. Check for those, first. */ have names beginning with $ or $$. Check for those, first. */
sym = lookup_symbol (copy_name (str), (struct block *) NULL, sym = lookup_symbol (copy_name (str), (struct block *) NULL,
VAR_DOMAIN, (int *) NULL, (struct symtab **) NULL); VAR_DOMAIN, (int *) NULL);
if (sym) if (sym)
{ {
write_exp_elt_opcode (OP_VAR_VALUE); write_exp_elt_opcode (OP_VAR_VALUE);

View file

@ -1051,7 +1051,7 @@ address_info (char *exp, int from_tty)
error (_("Argument required.")); error (_("Argument required."));
sym = lookup_symbol (exp, get_selected_block (0), VAR_DOMAIN, sym = lookup_symbol (exp, get_selected_block (0), VAR_DOMAIN,
&is_a_field_of_this, (struct symtab **) NULL); &is_a_field_of_this);
if (sym == NULL) if (sym == NULL)
{ {
if (is_a_field_of_this) if (is_a_field_of_this)

View file

@ -159,8 +159,7 @@ scm_lookup_name (char *str)
if (in_eval_c () if (in_eval_c ()
&& (sym = lookup_symbol ("env", && (sym = lookup_symbol ("env",
expression_context_block, expression_context_block,
VAR_DOMAIN, (int *) NULL, VAR_DOMAIN, (int *) NULL)) != NULL)
(struct symtab **) NULL)) != NULL)
args[2] = value_of_variable (sym, expression_context_block); args[2] = value_of_variable (sym, expression_context_block);
else else
/* FIXME in this case, we should try lookup_symbol first */ /* FIXME in this case, we should try lookup_symbol first */
@ -173,8 +172,7 @@ scm_lookup_name (char *str)
sym = lookup_symbol (str, sym = lookup_symbol (str,
expression_context_block, expression_context_block,
VAR_DOMAIN, (int *) NULL, VAR_DOMAIN, (int *) NULL);
(struct symtab **) NULL);
if (sym) if (sym)
return value_of_variable (sym, NULL); return value_of_variable (sym, NULL);
error (_("No symbol \"%s\" in current context."), str); error (_("No symbol \"%s\" in current context."), str);

View file

@ -239,7 +239,7 @@ select_source_symtab (struct symtab *s)
/* Make the default place to list be the function `main' /* Make the default place to list be the function `main'
if one exists. */ if one exists. */
if (lookup_symbol (main_name (), 0, VAR_DOMAIN, 0, NULL)) if (lookup_symbol (main_name (), 0, VAR_DOMAIN, 0))
{ {
sals = decode_line_spec (main_name (), 1); sals = decode_line_spec (main_name (), 1);
sal = sals.sals[0]; sal = sals.sals[0];

View file

@ -291,7 +291,7 @@ print_frame_args (struct symbol *func, struct frame_info *frame,
{ {
struct symbol *nsym; struct symbol *nsym;
nsym = lookup_symbol (DEPRECATED_SYMBOL_NAME (sym), nsym = lookup_symbol (DEPRECATED_SYMBOL_NAME (sym),
b, VAR_DOMAIN, NULL, NULL); b, VAR_DOMAIN, NULL);
gdb_assert (nsym != NULL); gdb_assert (nsym != NULL);
if (SYMBOL_CLASS (nsym) == LOC_REGISTER) if (SYMBOL_CLASS (nsym) == LOC_REGISTER)
{ {
@ -1599,7 +1599,7 @@ print_frame_arg_vars (struct frame_info *frame, struct ui_file *stream)
are not combined in symbol-reading. */ are not combined in symbol-reading. */
sym2 = lookup_symbol (DEPRECATED_SYMBOL_NAME (sym), sym2 = lookup_symbol (DEPRECATED_SYMBOL_NAME (sym),
b, VAR_DOMAIN, NULL, NULL); b, VAR_DOMAIN, NULL);
print_variable_value (sym2, frame, stream); print_variable_value (sym2, frame, stream);
fprintf_filtered (stream, "\n"); fprintf_filtered (stream, "\n");
break; break;

View file

@ -1190,8 +1190,7 @@ fixup_psymbol_section (struct partial_symbol *psym, struct objfile *objfile)
struct symbol * struct symbol *
lookup_symbol_in_language (const char *name, const struct block *block, lookup_symbol_in_language (const char *name, const struct block *block,
const domain_enum domain, enum language lang, const domain_enum domain, enum language lang,
int *is_a_field_of_this, int *is_a_field_of_this)
struct symtab **symtab)
{ {
char *demangled_name = NULL; char *demangled_name = NULL;
const char *modified_name = NULL; const char *modified_name = NULL;
@ -1243,10 +1242,6 @@ lookup_symbol_in_language (const char *name, const struct block *block,
if (needtofreename) if (needtofreename)
xfree (demangled_name); xfree (demangled_name);
/* Override the returned symtab with the symbol's specific one. */
if (returnval != NULL && symtab != NULL)
*symtab = SYMBOL_SYMTAB (returnval);
return returnval; return returnval;
} }
@ -1255,12 +1250,11 @@ lookup_symbol_in_language (const char *name, const struct block *block,
struct symbol * struct symbol *
lookup_symbol (const char *name, const struct block *block, lookup_symbol (const char *name, const struct block *block,
domain_enum domain, int *is_a_field_of_this, domain_enum domain, int *is_a_field_of_this)
struct symtab **symtab)
{ {
return lookup_symbol_in_language (name, block, domain, return lookup_symbol_in_language (name, block, domain,
current_language->la_language, current_language->la_language,
is_a_field_of_this, symtab); is_a_field_of_this);
} }
/* Behave like lookup_symbol except that NAME is the natural name /* Behave like lookup_symbol except that NAME is the natural name
@ -3172,8 +3166,7 @@ search_symbols (char *regexp, domain_enum kind, int nfiles, char *files[],
if (kind == FUNCTIONS_DOMAIN if (kind == FUNCTIONS_DOMAIN
|| lookup_symbol (SYMBOL_LINKAGE_NAME (msymbol), || lookup_symbol (SYMBOL_LINKAGE_NAME (msymbol),
(struct block *) NULL, (struct block *) NULL,
VAR_DOMAIN, VAR_DOMAIN, 0)
0, (struct symtab **) NULL)
== NULL) == NULL)
found_misc = 1; found_misc = 1;
} }
@ -3259,8 +3252,8 @@ search_symbols (char *regexp, domain_enum kind, int nfiles, char *files[],
{ {
/* Variables/Absolutes: Look up by name */ /* Variables/Absolutes: Look up by name */
if (lookup_symbol (SYMBOL_LINKAGE_NAME (msymbol), if (lookup_symbol (SYMBOL_LINKAGE_NAME (msymbol),
(struct block *) NULL, VAR_DOMAIN, (struct block *) NULL, VAR_DOMAIN, 0)
0, (struct symtab **) NULL) == NULL) == NULL)
{ {
/* match */ /* match */
psr = (struct symbol_search *) xmalloc (sizeof (struct symbol_search)); psr = (struct symbol_search *) xmalloc (sizeof (struct symbol_search));

View file

@ -1012,15 +1012,13 @@ extern struct symbol *lookup_symbol_in_language (const char *,
const struct block *, const struct block *,
const domain_enum, const domain_enum,
enum language, enum language,
int *, int *);
struct symtab **);
/* lookup a symbol by name (optional block, optional symtab) /* lookup a symbol by name (optional block, optional symtab)
in the current language */ in the current language */
extern struct symbol *lookup_symbol (const char *, const struct block *, extern struct symbol *lookup_symbol (const char *, const struct block *,
const domain_enum, int *, const domain_enum, int *);
struct symtab **);
/* A default version of lookup_symbol_nonlocal for use by languages /* A default version of lookup_symbol_nonlocal for use by languages
that can't think of anything better to do. */ that can't think of anything better to do. */

View file

@ -127,7 +127,7 @@ struct value *
find_function_in_inferior (const char *name) find_function_in_inferior (const char *name)
{ {
struct symbol *sym; struct symbol *sym;
sym = lookup_symbol (name, 0, VAR_DOMAIN, 0, NULL); sym = lookup_symbol (name, 0, VAR_DOMAIN, 0);
if (sym != NULL) if (sym != NULL)
{ {
if (SYMBOL_CLASS (sym) != LOC_BLOCK) if (SYMBOL_CLASS (sym) != LOC_BLOCK)
@ -2597,7 +2597,7 @@ value_struct_elt_for_reference (struct type *domain, int offset,
{ {
struct symbol *s = struct symbol *s =
lookup_symbol (TYPE_FN_FIELD_PHYSNAME (f, j), lookup_symbol (TYPE_FN_FIELD_PHYSNAME (f, j),
0, VAR_DOMAIN, 0, NULL); 0, VAR_DOMAIN, 0);
if (s == NULL) if (s == NULL)
return NULL; return NULL;
@ -2626,7 +2626,7 @@ value_struct_elt_for_reference (struct type *domain, int offset,
{ {
struct symbol *s = struct symbol *s =
lookup_symbol (TYPE_FN_FIELD_PHYSNAME (f, j), lookup_symbol (TYPE_FN_FIELD_PHYSNAME (f, j),
0, VAR_DOMAIN, 0, NULL); 0, VAR_DOMAIN, 0);
if (s == NULL) if (s == NULL)
return NULL; return NULL;

View file

@ -1244,7 +1244,7 @@ value_static_field (struct type *type, int fieldno)
else else
{ {
char *phys_name = TYPE_FIELD_STATIC_PHYSNAME (type, fieldno); char *phys_name = TYPE_FIELD_STATIC_PHYSNAME (type, fieldno);
struct symbol *sym = lookup_symbol (phys_name, 0, VAR_DOMAIN, 0, NULL); struct symbol *sym = lookup_symbol (phys_name, 0, VAR_DOMAIN, 0);
if (sym == NULL) if (sym == NULL)
{ {
/* With some compilers, e.g. HP aCC, static data members are reported /* With some compilers, e.g. HP aCC, static data members are reported
@ -1414,7 +1414,7 @@ value_fn_field (struct value **arg1p, struct fn_field *f, int j, struct type *ty
struct symbol *sym; struct symbol *sym;
struct minimal_symbol *msym; struct minimal_symbol *msym;
sym = lookup_symbol (physname, 0, VAR_DOMAIN, 0, NULL); sym = lookup_symbol (physname, 0, VAR_DOMAIN, 0);
if (sym != NULL) if (sym != NULL)
{ {
msym = NULL; msym = NULL;

View file

@ -424,7 +424,7 @@ xstormy16_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
return plg_end; return plg_end;
/* Found a function. */ /* Found a function. */
sym = lookup_symbol (func_name, NULL, VAR_DOMAIN, NULL, NULL); sym = lookup_symbol (func_name, NULL, VAR_DOMAIN, NULL);
/* Don't use line number debug info for assembly source files. */ /* Don't use line number debug info for assembly source files. */
if (sym && SYMBOL_LANGUAGE (sym) != language_asm) if (sym && SYMBOL_LANGUAGE (sym) != language_asm)
{ {