/* Helper routines for C++ support in GDB.
- Copyright (C) 2003-2019 Free Software Foundation, Inc.
+ Copyright (C) 2003-2020 Free Software Foundation, Inc.
Contributed by David Carlton and by Kealia, Inc.
const struct symbol *const symbol,
struct objfile *const objfile)
{
- if (SYMBOL_DEMANGLED_NAME (symbol) != NULL)
+ if (symbol->demangled_name () != NULL)
{
- const char *name = SYMBOL_DEMANGLED_NAME (symbol);
+ const char *name = symbol->demangled_name ();
unsigned int previous_component;
unsigned int next_component;
/* 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)
+ if (type->name () == NULL)
return {};
/* Look for symbol NAME in this class. */
/* If the scope is a function/method, then look up NESTED as a local
static variable. E.g., "print 'function()::static_var'". */
- if (TYPE_CODE (scope_type) == TYPE_CODE_FUNC
- || TYPE_CODE (scope_type) == TYPE_CODE_METHOD)
+ if ((scope_type->code () == TYPE_CODE_FUNC
+ || scope_type->code () == TYPE_CODE_METHOD)
+ && domain == VAR_DOMAIN)
return lookup_symbol (nested, SYMBOL_BLOCK_VALUE (scope_sym.symbol),
VAR_DOMAIN, NULL);
/* Maybe we should store a dictionary in here instead. */
for (i = 0; i < num; ++i)
{
- if (strcmp (name, SYMBOL_NATURAL_NAME (syms[i])) == 0)
+ if (strcmp (name, syms[i]->natural_name ()) == 0)
return syms[i];
}
return NULL;
domain_name (domain));
}
- if (function != NULL && SYMBOL_LANGUAGE (function) == language_cplus)
+ if (function != NULL && function->language () == language_cplus)
{
/* Search the function's template parameters. */
if (SYMBOL_IS_CPLUS_TEMPLATE_FUNCTION (function))
/* Search the template parameters of the function's defining
context. */
- if (SYMBOL_NATURAL_NAME (function))
+ if (function->natural_name ())
{
struct type *context;
- std::string name_copy (SYMBOL_NATURAL_NAME (function));
+ std::string name_copy (function->natural_name ());
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;
else
{
name_copy.erase (prefix_len);
- context = lookup_typename (lang, arch,
+ context = lookup_typename (lang,
name_copy.c_str (),
parent, 1);
}
if (symbol_lookup_debug)
{
- const char *type_name = TYPE_NAME (saved_parent_type);
+ const char *type_name = saved_parent_type->name ();
fprintf_unfiltered (gdb_stdlog,
"cp_lookup_nested_symbol (%s, %s, %s, %s)\n",
domain_name (domain));
}
- switch (TYPE_CODE (parent_type))
+ switch (parent_type->code ())
{
case TYPE_CODE_STRUCT:
case TYPE_CODE_NAMESPACE:
printf_unfiltered (_("The `maint namespace' command was removed.\n"));
}
+void _initialize_cp_namespace ();
void
-_initialize_cp_namespace (void)
+_initialize_cp_namespace ()
{
struct cmd_list_element *cmd;