GDB (xrefs)

Functions
/tmp/gdb-8.1/gdb/cp-namespace.c File Reference
`#include "defs.h"`
`#include "cp-support.h"`
`#include "gdb_obstack.h"`
`#include "symtab.h"`
`#include "symfile.h"`
`#include "block.h"`
`#include "objfiles.h"`
`#include "gdbtypes.h"`
`#include "dictionary.h"`
`#include "command.h"`
`#include "frame.h"`
`#include "buildsym.h"`
`#include "language.h"`
`#include "namespace.h"`
`#include <string>`

Go to the source code of this file.

## Functions
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)
static struct type * | cp_lookup_transparent_type_loop (const char *name, const char *scope, int scope_len)
void | cp_scan_for_anonymous_namespaces (const struct symbol *const symbol, struct objfile *const objfile)
int | cp_is_in_anonymous (const char *symbol_name)
static struct block_symbol | cp_basic_lookup_symbol (const char *name, const struct block *block, const domain_enum domain, int is_in_anonymous)
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)
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)
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)
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)
static struct symbol * | search_symbol_list (const char *name, int num, struct symbol **syms)
struct block_symbol | cp_lookup_symbol_imports_or_template (const char *scope, const char *name, 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 | cp_lookup_symbol_namespace (const char *scope, const char *name, const struct block *block, const domain_enum domain)
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)
struct block_symbol | cp_lookup_symbol_nonlocal (const struct language_defn *langdef, const char *name, const struct block *block, const domain_enum domain)
struct type * | cp_find_type_baseclass_by_name (struct type *parent_type, const char *name)
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)
struct block_symbol | cp_lookup_nested_symbol (struct type *parent_type, const char *nested_name, const struct block *block, const domain_enum domain)
struct type * | cp_lookup_transparent_type (const char *name)
static void | maintenance_cplus_namespace (const char *args, int from_tty)
void | _initialize_cp_namespace (void)

## Function Documentation

## ◆ _initialize_cp_namespace()

void _initialize_cp_namespace | ( | void |  | ) |

Definition at line 1070 of file cp-namespace.c.

References _, add_cmd(), class_maintenance, deprecate_cmd(), maint_cplus_cmd_list, and maintenance_cplus_namespace().

## ◆ cp_basic_lookup_symbol()

static struct block_symbol cp_basic_lookup_symbol | ( | const char * | name,
|  | const struct block * | block,
|  | const domain_enum | domain,
|  | int | is_in_anonymous
| ) |  |
| static

Definition at line 125 of file cp-namespace.c.

References block_global_block(), FULL, lookup_global_symbol(), lookup_symbol_in_block(), lookup_symbol_in_static_block(), and name.

Referenced by cp_lookup_nested_symbol_1(), and cp_lookup_symbol_in_namespace().

## ◆ cp_find_type_baseclass_by_name()

struct type* cp_find_type_baseclass_by_name | ( | struct type * | parent_type,
|  | const char * | name
| ) |  |

Definition at line 777 of file cp-namespace.c.

References check_typedef(), cp_find_type_baseclass_by_name(), name, streq(), type, TYPE_BASECLASS, TYPE_BASECLASS_NAME, and TYPE_N_BASECLASSES.

Referenced by classify_inner_name(), and cp_find_type_baseclass_by_name().

## ◆ cp_is_in_anonymous()

int cp_is_in_anonymous | ( | const char * | symbol_name | ) |

Definition at line 114 of file cp-namespace.c.

References CP_ANONYMOUS_NAMESPACE_STR.

Referenced by cp_lookup_nested_symbol(), cp_lookup_symbol_in_namespace(), and cp_scan_for_anonymous_namespaces().

## ◆ cp_lookup_bare_symbol()

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
| ) |  |
| static

Definition at line 167 of file cp-namespace.c.

References block_symbol::block, block_gdbarch(), check_typedef(), cp_lookup_nested_symbol(), gdb_assert, language_lookup_primitive_type_as_symbol(), lookup_global_symbol(), lookup_language_this(), lookup_symbol_in_static_block(), name, null_block_symbol, block_symbol::symbol, SYMBOL_TYPE, target_gdbarch(), type, TYPE_NAME, TYPE_TARGET_TYPE, and VAR_DOMAIN.

Referenced by cp_lookup_symbol_in_namespace(), and lookup_namespace_scope().

## ◆ cp_lookup_nested_symbol()

struct block_symbol cp_lookup_nested_symbol | ( | struct type * | parent_type,
|  | const char * | nested_name,
|  | const struct block * | block,
|  | const domain_enum | domain
| ) |  |

Definition at line 913 of file cp-namespace.c.

References _, check_typedef(), cp_is_in_anonymous(), cp_lookup_nested_symbol_1(), domain_name(), fprintf_unfiltered(), gdb_stdlog, host_address_to_string, internal_error(), null_block_symbol, size, block_symbol::symbol, symbol_lookup_debug, TYPE_CODE, TYPE_CODE_ENUM, TYPE_CODE_FUNC, TYPE_CODE_METHOD, TYPE_CODE_MODULE, TYPE_CODE_NAMESPACE, TYPE_CODE_STRUCT, TYPE_CODE_UNION, type_name_no_tag(), type_name_no_tag_or_error(), and xsnprintf().

Referenced by classify_inner_name(), and cp_lookup_bare_symbol().

## ◆ cp_lookup_nested_symbol_1()

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
| ) |  |
| static

Definition at line 848 of file cp-namespace.c.

References check_typedef(), cp_basic_lookup_symbol(), find_symbol_in_baseclass(), lookup_static_symbol(), lookup_symbol_in_static_block(), null_block_symbol, block_symbol::symbol, and TYPE_N_BASECLASSES.

Referenced by cp_lookup_nested_symbol(), cp_search_static_and_baseclasses(), and find_symbol_in_baseclass().

## ◆ cp_lookup_symbol_imports_or_template()

struct block_symbol cp_lookup_symbol_imports_or_template | ( | const char * | scope,
|  | const char * | name,
|  | const struct block * | block,
|  | const domain_enum | domain
| ) |  |

Definition at line 503 of file cp-namespace.c.

References symbol::arch, BLOCK_FUNCTION, BLOCK_SUPERBLOCK, cp_entire_prefix_len(), cp_lookup_symbol_via_imports(), symbol::domain, domain_name(), fprintf_unfiltered(), gdb_stdlog, host_address_to_string, language_cplus, language_def(), lookup_typename(), template_symbol::n_template_arguments, name, search_symbol_list(), string, block_symbol::symbol, symbol_arch(), SYMBOL_IS_CPLUS_TEMPLATE_FUNCTION, SYMBOL_LANGUAGE, symbol_lookup_debug, SYMBOL_NATURAL_NAME, template_symbol::template_arguments, TYPE_N_TEMPLATE_ARGUMENTS, and TYPE_TEMPLATE_ARGUMENTS.

Referenced by lookup_local_symbol().

## ◆ cp_lookup_symbol_in_namespace()

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
| ) |  |
| static

Definition at line 302 of file cp-namespace.c.

References cp_basic_lookup_symbol(), cp_entire_prefix_len(), cp_is_in_anonymous(), cp_lookup_bare_symbol(), cp_search_static_and_baseclasses(), name, and block_symbol::symbol.

Referenced by cp_lookup_symbol_namespace(), cp_lookup_symbol_via_imports(), and lookup_namespace_scope().

## ◆ cp_lookup_symbol_namespace()

struct block_symbol cp_lookup_symbol_namespace | ( | const char * | scope,
|  | const char * | name,
|  | const struct block * | block,
|  | const domain_enum | domain
| ) |  |

Definition at line 632 of file cp-namespace.c.

References cp_lookup_symbol_in_namespace(), cp_lookup_symbol_via_all_imports(), domain_name(), fprintf_unfiltered(), gdb_stdlog, host_address_to_string, name, block_symbol::symbol, and symbol_lookup_debug.

Referenced by evaluate_funcall(), gen_maybe_namespace_elt(), and value_maybe_namespace_elt().

## ◆ cp_lookup_symbol_nonlocal()

struct block_symbol cp_lookup_symbol_nonlocal | ( | const struct language_defn * | langdef,
|  | const char * | name,
|  | const struct block * | block,
|  | const domain_enum | domain
| ) |  |

Definition at line 737 of file cp-namespace.c.

References block_scope(), cp_lookup_symbol_via_all_imports(), domain_name(), fprintf_unfiltered(), gdb_stdlog, host_address_to_string, lookup_namespace_scope(), name, block_symbol::symbol, and symbol_lookup_debug.

## ◆ cp_lookup_symbol_via_all_imports()

static struct block_symbol cp_lookup_symbol_via_all_imports | ( | const char * | scope,
|  | const char * | name,
|  | const struct block * | block,
|  | const domain_enum | domain
| ) |  |
| static

Definition at line 608 of file cp-namespace.c.

References BLOCK_SUPERBLOCK, cp_lookup_symbol_via_imports(), name, null_block_symbol, and block_symbol::symbol.

Referenced by cp_lookup_symbol_namespace(), and cp_lookup_symbol_nonlocal().

## ◆ cp_lookup_symbol_via_imports()

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
| ) |  |
| static

Definition at line 372 of file cp-namespace.c.

References using_direct::alias, block_symbol::block, block_using(), cp_lookup_symbol_in_namespace(), using_direct::declaration, using_direct::excludes, using_direct::import_dest, using_direct::import_src, make_scoped_restore(), name, using_direct::next, null_block_symbol, using_direct::searched, startswith(), and block_symbol::symbol.

Referenced by cp_lookup_symbol_imports_or_template(), and cp_lookup_symbol_via_all_imports().

## ◆ cp_lookup_transparent_type()

struct type* cp_lookup_transparent_type | ( | const char * | name | ) |

Definition at line 1009 of file cp-namespace.c.

References basic_lookup_transparent_type(), block_scope(), cp_lookup_transparent_type_loop(), get_selected_block(), and name.

## ◆ cp_lookup_transparent_type_loop()

static struct type * cp_lookup_transparent_type_loop | ( | const char * | name,
|  | const char * | scope,
|  | int | scope_len
| ) |  |
| static

Definition at line 1033 of file cp-namespace.c.

References basic_lookup_transparent_type(), cp_find_first_component(), type::length, and name.

Referenced by cp_lookup_transparent_type().

## ◆ cp_scan_for_anonymous_namespaces()

void cp_scan_for_anonymous_namespaces | ( | const struct symbol *const | symbol,
|  | struct objfile *const | objfile
| ) |  |

Definition at line 53 of file cp-namespace.c.

References add_using_directive(), CP_ANONYMOUS_NAMESPACE_LEN, CP_ANONYMOUS_NAMESPACE_STR, cp_find_first_component(), cp_is_in_anonymous(), local_using_directives, name, and SYMBOL_DEMANGLED_NAME.

Referenced by define_symbol(), and new_symbol_full().

## ◆ cp_search_static_and_baseclasses()

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
| ) |  |
| static

Definition at line 246 of file cp-namespace.c.

References cp_lookup_nested_symbol_1(), lookup_global_symbol(), lookup_symbol(), lookup_symbol_in_static_block(), name, null_block_symbol, string, block_symbol::symbol, SYMBOL_BLOCK_VALUE, SYMBOL_TYPE, TYPE_CODE, TYPE_CODE_FUNC, TYPE_CODE_METHOD, and VAR_DOMAIN.

Referenced by cp_lookup_symbol_in_namespace().

## ◆ find_symbol_in_baseclass()

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
| ) |  |
| static

Definition at line 805 of file cp-namespace.c.

References block_symbol::block, cp_lookup_nested_symbol_1(), name, string, block_symbol::symbol, TYPE_BASECLASS, TYPE_BASECLASS_NAME, and TYPE_N_BASECLASSES.

Referenced by cp_lookup_nested_symbol_1().

## ◆ lookup_namespace_scope()

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
| ) |  |
| static

Definition at line 680 of file cp-namespace.c.

References cp_find_first_component(), cp_lookup_bare_symbol(), cp_lookup_symbol_in_namespace(), gdb_assert, name, and block_symbol::symbol.

Referenced by cp_lookup_symbol_nonlocal().

## ◆ maintenance_cplus_namespace()

static void maintenance_cplus_namespace | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 1064 of file cp-namespace.c.

References _, and printf_unfiltered().

Referenced by _initialize_cp_namespace().

## ◆ search_symbol_list()

static struct symbol* search_symbol_list | ( | const char * | name,
|  | int | num,
|  | struct symbol ** | syms
| ) |  |
| static

Definition at line 484 of file cp-namespace.c.

References name, and SYMBOL_NATURAL_NAME.

Referenced by cp_lookup_symbol_imports_or_template().