39 const char *nested_name,
40 const char *concatenated_name,
43 int basic_lookup,
int is_in_anonymous);
59 unsigned int previous_component;
60 unsigned int next_component;
68 previous_component = 0;
71 while (
name[next_component] ==
':')
73 if (((next_component - previous_component)
75 && strncmp (
name + previous_component,
79 int dest_len = (previous_component == 0
80 ? 0 : previous_component - 2);
81 int src_len = next_component;
83 char *dest = (
char *) alloca (dest_len + 1);
84 char *src = (
char *) alloca (src_len + 1);
86 memcpy (dest,
name, dest_len);
87 memcpy (src,
name, src_len);
89 dest[dest_len] =
'\0';
96 std::vector<const char *> excludes;
98 dest, src, NULL, NULL, excludes, 1,
102 previous_component = next_component + 2;
103 next_component = (previous_component
105 + previous_component));
131 if (sym.symbol != NULL)
176 if (strchr (
name,
'<') == NULL && strchr (
name,
'(') == NULL)
218 if (lang_this.
symbol == NULL)
249 unsigned int prefix_len,
253 if (prefix_len + 2 > strlen (
name) ||
name[prefix_len + 1] !=
':')
262 const char *nested =
name + prefix_len + 2;
271 if (scope_sym.
symbol == NULL)
273 if (scope_sym.
symbol == NULL)
289 block, domain, 0, is_in_anonymous);
306 char *concatenated_name = NULL;
308 unsigned int prefix_len;
311 if (the_namespace[0] !=
'\0')
314 = (
char *) alloca (strlen (the_namespace) + 2 + strlen (
name) + 1);
315 strcpy (concatenated_name, the_namespace);
316 strcat (concatenated_name,
"::");
317 strcat (concatenated_name,
name);
318 name = concatenated_name;
376 const int search_scope_first,
377 const int declaration_only,
378 const int search_parents)
389 if (search_scope_first)
402 current = current->
next)
404 const char **excludep;
407 directive_match = (search_parents
411 || scope[len] ==
'\0'))
416 if (directive_match && !current->
searched)
447 for (excludep = current->
excludes; *excludep; excludep++)
448 if (strcmp (
name, *excludep) == 0)
453 if (current->
alias != NULL
463 else if (current->
alias == NULL)
490 for (i = 0; i < num; ++i)
514 "cp_lookup_symbol_imports_or_template" 515 " (%s, %s, %s, %s)\n",
536 "cp_lookup_symbol_imports_or_template" 548 struct type *context;
557 unsigned int prefix_len
564 name_copy.erase (prefix_len);
583 "cp_lookup_symbol_imports_or_template (...) = %s\n",
596 "cp_lookup_symbol_imports_or_template (...) = %s\n",
614 while (
block != NULL)
642 "cp_lookup_symbol_namespace (%s, %s, %s, %s)\n",
657 "cp_lookup_symbol_namespace (...) = %s\n",
689 if (scope[scope_len] !=
'\0')
694 int new_scope_len = scope_len;
697 if (new_scope_len != 0)
704 scope, new_scope_len);
720 if (scope_len == 0 && strchr (
name,
':') == NULL)
723 the_namespace = (
char *) alloca (scope_len + 1);
724 strncpy (the_namespace, scope, scope_len);
725 the_namespace[scope_len] =
'\0';
748 "cp_lookup_symbol_non_local" 749 " (%s, %s (scope %s), %s)\n",
765 "cp_lookup_symbol_nonlocal (...) = %s\n",
787 if (base_name == NULL)
820 if (base_name == NULL)
826 concatenated_name.c_str (),
827 block, domain, 1, is_in_anonymous);
849 const char *nested_name,
850 const char *concatenated_name,
853 int basic_lookup,
int is_in_anonymous)
887 if (!is_in_anonymous)
899 domain, is_in_anonymous);
914 const char *nested_name,
920 struct type *saved_parent_type = parent_type;
929 "cp_lookup_nested_symbol (%s, %s, %s, %s)\n",
930 type_name != NULL ? type_name :
"unnamed",
949 char *concatenated_name;
952 size = strlen (parent_name) + 2 + strlen (nested_name) + 1;
953 concatenated_name = (
char *) alloca (
size);
955 parent_name, nested_name);
959 concatenated_name,
block, domain,
965 "cp_lookup_nested_symbol (...) = %s\n",
978 "cp_lookup_nested_symbol (...) = NULL" 985 _(
"cp_lookup_nested_symbol called " 986 "on a non-aggregate type."));
1022 if (scope[0] ==
'\0')
1032 static struct type *
1042 if (scope[scope_length] ==
':')
1052 full_name = (
char *) alloca (scope_length + 2 + strlen (
name) + 1);
1053 strncpy (full_name, scope, scope_length);
1054 memcpy (full_name + scope_length,
"::", 2);
1055 strcpy (full_name + scope_length + 2,
name);
1076 _(
"Deprecated placeholder for removed functionality."),
struct gdbarch * target_gdbarch(void)
struct type * cp_lookup_transparent_type(const char *name)
struct symbol * language_lookup_primitive_type_as_symbol(const struct language_defn *la, struct gdbarch *gdbarch, const char *name)
#define TYPE_N_BASECLASSES(thistype)
const char * type_name_no_tag_or_error(struct type *type)
struct cmd_list_element * deprecate_cmd(struct cmd_list_element *cmd, const char *replacement)
#define TYPE_NAME(thistype)
static void maintenance_cplus_namespace(const char *args, int from_tty)
const struct block * block_global_block(const struct block *block)
struct block_symbol cp_lookup_symbol_namespace(const char *scope, const char *name, const struct block *block, const domain_enum domain)
enum domain_enum_tag domain_enum
void internal_error(const char *file, int line, const char *fmt,...)
const struct language_defn * language_def(enum language lang)
static struct type * cp_lookup_transparent_type_loop(const char *name, const char *scope, int scope_len)
unsigned int symbol_lookup_debug
struct symbol ** template_arguments
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, const char *doc, struct cmd_list_element **list)
struct gdbarch * symbol_arch(const struct symbol *symbol)
static struct block_symbol lookup_namespace_scope(const struct language_defn *langdef, const char *name, const struct block *block, const domain_enum domain, const char *scope, int scope_len)
const struct block_symbol null_block_symbol
struct block_symbol lookup_symbol(const char *name, const struct block *block, domain_enum domain, struct field_of_this_result *is_a_field_of_this)
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)
#define host_address_to_string(ADDR)
static struct symbol * search_symbol_list(const char *name, int num, struct symbol **syms)
#define BLOCK_FUNCTION(bl)
scoped_restore_tmpl< T > make_scoped_restore(T *var)
#define TYPE_N_TEMPLATE_ARGUMENTS(thistype)
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 type * lookup_typename(const struct language_defn *language, struct gdbarch *gdbarch, const char *name, const struct block *block, int noerr)
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)
struct type * check_typedef(struct type *type)
#define SYMBOL_DEMANGLED_NAME(symbol)
unsigned int cp_find_first_component(const char *name)
const struct block * block
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)
void fprintf_unfiltered(struct ui_file *stream, const char *format,...)
int streq(const char *lhs, const char *rhs)
static struct block_symbol cp_lookup_symbol_via_imports(const char *scope, const char *name, const struct block *block, const domain_enum domain, const int search_scope_first, const int declaration_only, const int search_parents)
struct type * basic_lookup_transparent_type(const char *name)
struct using_direct * block_using(const struct block *block)
#define SYMBOL_IS_CPLUS_TEMPLATE_FUNCTION(symbol)
#define BLOCK_SUPERBLOCK(bl)
struct cmd_list_element * maint_cplus_cmd_list
#define CP_ANONYMOUS_NAMESPACE_STR
int cp_is_in_anonymous(const char *symbol_name)
static int startswith(const char *string, const char *pattern)
struct block_symbol cp_lookup_symbol_nonlocal(const struct language_defn *langdef, const char *name, const struct block *block, const domain_enum domain)
const char * domain_name(domain_enum e)
#define TYPE_BASECLASS(thistype, index)
void printf_unfiltered(const char *format,...)
struct block_symbol lookup_global_symbol(const char *name, const struct block *block, const domain_enum domain)
static struct block_symbol cp_basic_lookup_symbol(const char *name, const struct block *block, const domain_enum domain, int is_in_anonymous)
struct using_direct * next
void add_using_directive(struct using_direct **using_directives, const char *dest, const char *src, const char *alias, const char *declaration, const std::vector< const char *> &excludes, int copy_names, struct obstack *obstack)
#define TYPE_TEMPLATE_ARGUMENTS(thistype)
void cp_scan_for_anonymous_namespaces(const struct symbol *const symbol, struct objfile *const objfile)
#define TYPE_TARGET_TYPE(thistype)
int xsnprintf(char *str, size_t size, const char *format,...)
#define SYMBOL_BLOCK_VALUE(symbol)
#define TYPE_CODE(thistype)
#define TYPE_BASECLASS_NAME(thistype, index)
static struct block_symbol cp_lookup_nested_symbol_1(struct type *container_type, const char *nested_name, const char *concatenated_name, const struct block *block, const domain_enum domain, int basic_lookup, int is_in_anonymous)
EXTERN struct using_direct * local_using_directives
struct gdbarch * block_gdbarch(const struct block *block)
struct block_symbol lookup_static_symbol(const char *name, const domain_enum domain)
#define SYMBOL_LANGUAGE(symbol)
struct symbol * lookup_symbol_in_block(const char *name, symbol_name_match_type match_type, const struct block *block, const domain_enum domain)
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 block_symbol lookup_language_this(const struct language_defn *lang, const struct block *block)
const struct block * get_selected_block(CORE_ADDR *addr_in_block)
#define SYMBOL_NATURAL_NAME(symbol)
struct block_symbol cp_lookup_symbol_imports_or_template(const char *scope, const char *name, const struct block *block, const domain_enum domain)
#define SYMBOL_TYPE(symbol)
const char * type_name_no_tag(const struct type *type)
struct block_symbol lookup_symbol_in_static_block(const char *name, const struct block *block, const domain_enum domain)
void _initialize_cp_namespace(void)
#define CP_ANONYMOUS_NAMESPACE_LEN
unsigned int cp_entire_prefix_len(const char *name)
struct type * cp_find_type_baseclass_by_name(struct type *parent_type, const char *name)
struct block_symbol cp_lookup_nested_symbol(struct type *parent_type, const char *nested_name, const struct block *block, const domain_enum domain)
const char * block_scope(const struct block *block)
__extension__ enum domain_enum_tag domain