From ad8f0b374d3c0fb8c1f754b2eeef0115d09b2fce Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 14 Dec 2012 17:47:38 +0000 Subject: * c-exp.y (block, variable, name_not_typename, lex_one_token, classify_name): Update. * c-valprint.c (c_val_print): Update. * f-exp.y (yylex): Update. * go-exp.y (package_name_p, classify_packaged_name) (classify_name): Update. * jv-exp.y (push_variable): Update. * m2-exp.y (variable): Update. * mi/mi-cmd-stack.c (list_args_or_locals): Update. * p-exp.y (block, variable, yylex): Update. * p-valprint.c (pascal_val_print): Update. * parse.c (write_dollar_variable): Update. * printcmd.c (address_info): Update. * python/py-symbol.c (gdbpy_lookup_symbol): Update. * symtab.c (lookup_symbol_aux, lookup_symbol_in_language) (lookup_symbol): Change type of 'is_a_field_of_this'. (check_field): Add 'is_a_field_of_this' argument. * symtab.h (struct field_of_this_result): New. (lookup_symbol, lookup_symbol_in_language): Update. --- gdb/symtab.h | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'gdb/symtab.h') diff --git a/gdb/symtab.h b/gdb/symtab.h index a933132c0d1..6683cf5886d 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -919,19 +919,42 @@ int symbol_matches_domain (enum language symbol_language, extern struct symtab *lookup_symtab (const char *); +/* An object of this type is passed as the 'is_a_field_of_this' + argument to lookup_symbol and lookup_symbol_in_language. */ + +struct field_of_this_result +{ + /* The type in which the field was found. If this is NULL then the + symbol was not found in 'this'. If non-NULL, then one of the + other fields will be non-NULL as well. */ + + struct type *type; + + /* If the symbol was found as an ordinary field of 'this', then this + is non-NULL and points to the particular field. */ + + struct field *field; + + /* If the symbol was found as an function field of 'this', then this + is non-NULL and points to the particular field. */ + + struct fn_fieldlist *fn_field; +}; + /* lookup a symbol by name (optional block) in language. */ extern struct symbol *lookup_symbol_in_language (const char *, const struct block *, const domain_enum, enum language, - int *); + struct field_of_this_result *); /* lookup a symbol by name (optional block, optional symtab) in the current language. */ extern struct symbol *lookup_symbol (const char *, const struct block *, - const domain_enum, int *); + const domain_enum, + struct field_of_this_result *); /* A default version of lookup_symbol_nonlocal for use by languages that can't think of anything better to do. */ -- cgit v1.2.1