26#include "gdbsupport/gdb_obstack.h"
41 unsigned int index = 0;
45 if (
name[index] ==
'.' ||
name[index] ==
'\0')
59 unsigned int previous_len = 0;
61 while (
name[current_len] !=
'\0')
63 gdb_assert (
name[current_len] ==
'.');
64 previous_len = current_len;
112 std::string classname, nested;
113 unsigned int prefix_len;
130 if (lang_this.
symbol == NULL)
140 classname = std::string (
name, prefix_len);
144 nested = std::string (
name + prefix_len + 1);
150 if (class_sym.
symbol == NULL)
155 nested.c_str (),
block);
170 char *concatenated_name = NULL;
172 if (module[0] !=
'\0')
175 = (
char *) alloca (strlen (module) + strlen (
name) + 2);
176 strcpy (concatenated_name, module);
177 strcat (concatenated_name,
".");
178 strcat (concatenated_name,
name);
179 name = concatenated_name;
205 if (
scope[scope_len] !=
'\0')
210 int new_scope_len = scope_len;
213 if (new_scope_len != 0)
215 gdb_assert (scope[new_scope_len] ==
'.');
220 scope, new_scope_len);
233 if (scope_len == 0 && strchr (
name,
'.') == NULL)
236 module = (char *) alloca (scope_len + 1);
237 strncpy (module, scope, scope_len);
238 module[scope_len] = '\0';
258 if (base_name == NULL)
270 std::string concatenated_name = std::string (base_name) +
"." +
name;
302 const char *nested_name,
307 struct type *saved_parent_type = parent_type;
311 switch (parent_type->code ())
313 case TYPE_CODE_STRUCT:
314 case TYPE_CODE_UNION:
316 case TYPE_CODE_MODULE:
323 char *concatenated_name;
333 size = strlen (parent_name) + strlen (nested_name) + 2;
334 concatenated_name = (
char *) alloca (
size);
336 xsnprintf (concatenated_name,
size,
"%s.%s",
337 parent_name, nested_name);
349 case TYPE_CODE_METHOD:
353 gdb_assert_not_reached (
"called with non-aggregate type.");
380 current = current->
next)
382 const char **excludep;
389 scoped_restore restore_searched
390 = make_scoped_restore (¤t->
searched, 1);
415 for (excludep = current->
excludes; *excludep; excludep++)
416 if (strcmp (
name, *excludep) == 0)
422 if (current->
alias != NULL)
440 if (
name[name_scope] !=
'\0'
441 && strncmp (
name, current->
alias, name_scope) == 0)
487 while (
block != NULL)
struct gdbarch * target_gdbarch(void)
static unsigned int d_entire_prefix_len(const char *name)
struct block_symbol d_lookup_nested_symbol(struct type *parent_type, const char *nested_name, const struct block *block)
static struct block_symbol lookup_module_scope(const struct language_defn *langdef, const char *name, const struct block *block, const domain_enum domain, const char *scope, int scope_len)
static struct block_symbol find_symbol_in_baseclass(struct type *parent_type, const char *name, const struct block *block)
static struct block_symbol d_lookup_symbol_imports(const char *scope, const char *name, const struct block *block, const domain_enum domain)
static struct block_symbol d_lookup_symbol(const struct language_defn *langdef, const char *name, const struct block *block, const domain_enum domain, int search)
static struct block_symbol d_lookup_symbol_in_module(const char *module, const char *name, const struct block *block, const domain_enum domain, int search)
static struct block_symbol d_lookup_symbol_module(const char *scope, const char *name, const struct block *block, const domain_enum domain)
static unsigned int d_find_first_component(const char *name)
struct block_symbol d_lookup_symbol_nonlocal(const struct language_defn *langdef, const char *name, const struct block *block, const domain_enum domain)
const char * type_name_or_error(struct type *type)
struct type * check_typedef(struct type *type)
#define TYPE_BASECLASS_NAME(thistype, index)
#define TYPE_BASECLASS(thistype, index)
#define TYPE_N_BASECLASSES(thistype)
const struct language_defn * language_def(enum language lang)
struct symbol * language_lookup_primitive_type_as_symbol(const struct language_defn *la, struct gdbarch *gdbarch, const char *name)
const struct block * block
const block * superblock() const
struct gdbarch * gdbarch() const
struct using_direct * get_using() const
const char * scope() const
struct type * type() const
struct type * target_type() const
const char * name() const
struct using_direct * next
struct block_symbol lookup_static_symbol(const char *name, const domain_enum domain)
struct block_symbol lookup_global_symbol(const char *name, const struct block *block, const domain_enum domain)
struct block_symbol lookup_symbol_in_static_block(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)