GDB (xrefs)

Classes | Macros | Typedefs | Functions | Variables
/tmp/gdb-8.1/gdb/cp-support.h File Reference
`#include "symtab.h"`
`#include "vec.h"`
`#include "gdb_vecs.h"`
`#include "gdb_obstack.h"`

Go to the source code of this file.

## Classes
struct | demangle_parse_info

## Macros
#define | CP_ANONYMOUS_NAMESPACE_STR "(anonymous namespace)"
#define | CP_ANONYMOUS_NAMESPACE_LEN 21
#define | CP_OPERATOR_STR "operator"
#define | CP_OPERATOR_LEN 8

## Typedefs
typedef const char *() | canonicalization_ftype(struct type *, void *)

## Functions
std::string | cp_canonicalize_string (const char *string)
std::string | cp_canonicalize_string_no_typedefs (const char *string)
std::string | cp_canonicalize_string_full (const char *string, canonicalization_ftype *finder, void *data)
char * | cp_class_name_from_physname (const char *physname)
char * | method_name_from_physname (const char *physname)
unsigned int | cp_find_first_component (const char *name)
unsigned int | cp_entire_prefix_len (const char *name)
char * | cp_func_name (const char *full_name)
gdb::unique_xmalloc_ptr< char > | cp_remove_params (const char *demanged_name)
gdb::unique_xmalloc_ptr< char > | cp_remove_params_if_any (const char *demangled_name, bool completion_mode)
struct symbol ** | make_symbol_overload_list (const char *, const char *)
struct symbol ** | make_symbol_overload_list_adl (struct type **arg_types, int nargs, const char *func_name)
struct type * | cp_lookup_rtti_type (const char *name, struct block *block)
unsigned int | cp_search_name_hash (const char *search_name)
symbol_name_matcher_ftype * | cp_get_symbol_name_matcher (const lookup_name_info &lookup_name)
int | cp_is_in_anonymous (const char *symbol_name)
void | cp_scan_for_anonymous_namespaces (const struct symbol *symbol, struct objfile *objfile)
struct block_symbol | cp_lookup_symbol_nonlocal (const struct language_defn *langdef, const char *name, const struct block *block, const domain_enum domain)
struct block_symbol | cp_lookup_symbol_namespace (const char *the_namespace, const char *name, const struct block *block, const domain_enum domain)
struct block_symbol | cp_lookup_symbol_imports_or_template (const char *scope, const char *name, const struct block *block, const domain_enum domain)
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)
struct type * | cp_find_type_baseclass_by_name (struct type *parent_type, const char *name)
std::unique_ptr< demangle_parse_info > | cp_demangled_name_to_comp (const char *demangled_name, const char **errmsg)
gdb::unique_xmalloc_ptr< char > | cp_comp_to_string (struct demangle_component *result, int estimated_len)
void | cp_merge_demangle_parse_infos (struct demangle_parse_info *, struct demangle_component *, struct demangle_parse_info *)
char * | gdb_demangle (const char *name, int options)
int | gdb_sniff_from_mangled_name (const char *mangled, char **demangled)

## Variables
struct cmd_list_element * | maint_cplus_cmd_list

## Macro Definition Documentation

## ◆ CP_ANONYMOUS_NAMESPACE_LEN

#define CP_ANONYMOUS_NAMESPACE_LEN 21

Definition at line 47 of file cp-support.h.

Referenced by cp_scan_for_anonymous_namespaces().

## ◆ CP_ANONYMOUS_NAMESPACE_STR

#define CP_ANONYMOUS_NAMESPACE_STR "(anonymous namespace)"

Definition at line 43 of file cp-support.h.

Referenced by cp_is_in_anonymous(), cp_scan_for_anonymous_namespaces(), dwarf2_name(), fixup_partial_die(), and namespace_name().

## ◆ CP_OPERATOR_LEN

#define CP_OPERATOR_LEN 8

Definition at line 55 of file cp-support.h.

Referenced by cp_find_first_component_aux(), cp_is_operator(), explicit_location_lex_one(), find_toplevel_char(), is_cp_operator(), linespec_lexer_lex_string(), operator_chars(), operator_stoken(), and strncmp_iw_with_mode().

## ◆ CP_OPERATOR_STR

#define CP_OPERATOR_STR "operator"

Definition at line 51 of file cp-support.h.

Referenced by cp_find_first_component_aux(), cp_is_operator(), explicit_location_lex_one(), find_toplevel_char(), gnuv2_is_operator_name(), gnuv3_is_operator_name(), is_cp_operator(), is_type_conversion_operator(), linespec_lexer_lex_string(), operator_chars(), and operator_stoken().

## Typedef Documentation

## ◆ canonicalization_ftype

typedef const char*() canonicalization_ftype(struct type *, void *)

Definition at line 82 of file cp-support.h.

## Function Documentation

## ◆ cp_canonicalize_string()

std::string cp_canonicalize_string | ( | const char * | string | ) |

Definition at line 552 of file cp-support.c.

References _, cp_already_canonical(), cp_comp_to_string(), cp_demangled_name_to_comp(), string, and warning().

Referenced by check_status_exception_catchpoint(), define_symbol(), demangle_for_lookup(), dwarf2_canonicalize_name(), gnuv3_get_typeid(), read_dbx_symtab(), read_type(), and yyparse().

## ◆ cp_canonicalize_string_full()

std::string cp_canonicalize_string_full | ( | const char * | string,
|  | canonicalization_ftype * | finder,
|  | void * | data
| ) |  |

Definition at line 508 of file cp-support.c.

References cp_comp_to_string(), cp_demangled_name_to_comp(), gdb_assert, replace_typedefs(), and string.

Referenced by cp_canonicalize_string_no_typedefs(), and print_name_maybe_canonical().

## ◆ cp_canonicalize_string_no_typedefs()

std::string cp_canonicalize_string_no_typedefs | ( | const char * | string | ) |

Definition at line 542 of file cp-support.c.

References cp_canonicalize_string_full().

Referenced by find_linespec_symbols(), and inspect_type().

## ◆ cp_class_name_from_physname()

char* cp_class_name_from_physname | ( | const char * | physname | ) |

Definition at line 636 of file cp-support.c.

References cp_comp_to_string(), d_left, d_right, mangled_name_to_comp(), and xfree().

## ◆ cp_comp_to_string()

gdb::unique_xmalloc_ptr<char> cp_comp_to_string | ( | struct demangle_component * | result,
|  | int | estimated_len
| ) |  |

Definition at line 4195 of file cp-name-parser.c.

References err.

Referenced by cp_canonicalize_string(), cp_canonicalize_string_full(), cp_class_name_from_physname(), cp_func_name(), cp_remove_params_1(), method_name_from_physname(), replace_typedefs(), replace_typedefs_qualified_name(), and typy_lookup_type().

## ◆ cp_demangled_name_to_comp()

std::unique_ptr<demangle_parse_info> cp_demangled_name_to_comp | ( | const char * | demangled_name,
|  | const char ** | errmsg
| ) |  |

Definition at line 4266 of file cp-name-parser.c.

References allocate_info(), demangle_info, errmsg, error_lexptr, global_errmsg, global_result, lexptr, prev_lexptr, and yyparse.

Referenced by cp_canonicalize_string(), cp_canonicalize_string_full(), cp_func_name(), cp_remove_params_1(), inspect_type(), mangled_name_to_comp(), and typy_legacy_template_argument().

## ◆ cp_entire_prefix_len()

unsigned int cp_entire_prefix_len | ( | const char * | name | ) |

Definition at line 1122 of file cp-support.c.

References cp_find_first_component(), gdb_assert, and name.

Referenced by cp_lookup_symbol_imports_or_template(), cp_lookup_symbol_in_namespace(), cp_search_name_hash(), cp_set_block_scope(), and make_symbol_overload_list_adl_namespace().

## ◆ cp_find_first_component()

unsigned int cp_find_first_component | ( | const char * | name | ) |

Definition at line 970 of file cp-support.c.

References cp_find_first_component_aux(), and name.

Referenced by mapped_index_base::build_name_components(), cp_entire_prefix_len(), cp_lookup_transparent_type_loop(), cp_scan_for_anonymous_namespaces(), cp_symbol_name_matches_1(), find_oload_champ_namespace_loop(), first_component_command(), lookup_namespace_scope(), rust_crate_for_block(), rust_lookup_symbol_nonlocal(), and super_name().

## ◆ 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_func_name()

char* cp_func_name | ( | const char * | full_name | ) |

Definition at line 816 of file cp-support.c.

References cp_comp_to_string(), cp_demangled_name_to_comp(), and unqualified_name_from_comp().

Referenced by find_overload_match().

## ◆ cp_get_symbol_name_matcher()

symbol_name_matcher_ftype* cp_get_symbol_name_matcher | ( | const lookup_name_info & | lookup_name | ) |

Definition at line 1790 of file cp-support.c.

References cp_fq_symbol_name_matches(), cp_symbol_name_matches(), EXPRESSION, FULL, gdb_assert_not_reached, lookup_name_info::match_type(), SEARCH_NAME, and WILD.

## ◆ 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_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_rtti_type()

struct type* cp_lookup_rtti_type | ( | const char * | name,
|  | struct block * | block
| ) |  |

Definition at line 1440 of file cp-support.c.

References _, check_typedef(), LOC_TYPEDEF, lookup_symbol(), name, block_symbol::symbol, SYMBOL_CLASS, SYMBOL_TYPE, TYPE_CODE, TYPE_CODE_NAMESPACE, TYPE_CODE_STRUCT, VAR_DOMAIN, and warning().

Referenced by gnuv2_value_rtti_type(), and gnuv3_rtti_type().

## ◆ 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_namespace()

struct block_symbol cp_lookup_symbol_namespace | ( | const char * | the_namespace,
|  | 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_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_merge_demangle_parse_infos()

void cp_merge_demangle_parse_infos | ( | struct demangle_parse_info * | ,
|  | struct demangle_component * | ,
|  | struct demangle_parse_info * |
| ) |  |

Definition at line 4241 of file cp-name-parser.c.

References demangle_parse_info::info, demangle_info::next, and demangle_parse_info::tree.

Referenced by inspect_type().

## ◆ cp_remove_params()

gdb::unique_xmalloc_ptr<char> cp_remove_params | ( | const char * | demanged_name | ) |

Definition at line 892 of file cp-support.c.

References cp_remove_params_1().

Referenced by find_frame_funname(), find_slot_in_mapped_hash(), dw2_debug_names_iterator::find_vec_in_debug_names(), info_frame_command(), overload_list_add_symbol(), and psymtab_search_name().

## ◆ cp_remove_params_if_any()

gdb::unique_xmalloc_ptr<char> cp_remove_params_if_any | ( | const char * | demangled_name,
|  | bool | completion_mode
| ) |  |

Definition at line 900 of file cp-support.c.

References cp_remove_params_1(), and string.

Referenced by demangle_for_lookup_info::demangle_for_lookup_info().

## ◆ cp_scan_for_anonymous_namespaces()

void cp_scan_for_anonymous_namespaces | ( | const struct symbol * | symbol,
|  | struct objfile * | 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_name_hash()

unsigned int cp_search_name_hash | ( | const char * | search_name | ) |

Definition at line 1621 of file cp-support.c.

References cp_entire_prefix_len(), hash(), skip_spaces(), startswith(), string, and SYMBOL_HASH_NEXT.

## ◆ gdb_demangle()

char* gdb_demangle | ( | const char * | name,
|  | int | options
| ) |  |

Definition at line 1518 of file cp-support.c.

References _, begin_line(), can_dump_core(), catch_demangler_crashes, demangler_warning(), fprintf_unfiltered(), gdb_demangle_attempt_core_dump, gdb_demangle_jmp_buf, gdb_demangle_signal_handler(), gdb_stderr, LIMIT_CUR, name, ofunc, target_terminal::ours_for_output(), SIGSETJMP, string, string_printf(), and warn_cant_dump_core().

Referenced by c_type_print_base_struct_union(), check_stub_method(), d_demangle(), demangle_for_lookup(), dwarf2_name(), dwarf2_physname(), fixup_partial_die(), gdb_sniff_from_mangled_name(), gnuv2_value_rtti_type(), gnuv3_print_method_ptr(), mangled_name_to_comp(), rust_sniff_from_mangled_name(), and unk_lang_demangle().

## ◆ gdb_sniff_from_mangled_name()

int gdb_sniff_from_mangled_name | ( | const char * | mangled,
|  | char ** | demangled
| ) |  |

Definition at line 1612 of file cp-support.c.

References gdb_demangle().

## ◆ make_symbol_overload_list()

struct symbol** make_symbol_overload_list | ( | const char * | ,
|  | const char * |
| ) |  |

Definition at line 1189 of file cp-support.c.

References discard_cleanups(), make_cleanup(), make_symbol_overload_list_qualified(), make_symbol_overload_list_using(), name, sym_return_val, sym_return_val_index, sym_return_val_size, xfree(), and XNEWVEC.

Referenced by find_oload_champ_namespace_loop().

## ◆ make_symbol_overload_list_adl()

struct symbol** make_symbol_overload_list_adl | ( | struct type ** | arg_types,
|  | int | nargs,
|  | const char * | func_name
| ) |  |

Definition at line 1326 of file cp-support.c.

References gdb_assert, make_symbol_overload_list_adl_namespace(), sym_return_val, and sym_return_val_size.

Referenced by find_oload_champ_namespace_loop().

## ◆ method_name_from_physname()

char* method_name_from_physname | ( | const char * | physname | ) |

Definition at line 784 of file cp-support.c.

References cp_comp_to_string(), mangled_name_to_comp(), unqualified_name_from_comp(), and xfree().

Referenced by stabs_method_name_from_physname().

## Variable Documentation

## ◆ maint_cplus_cmd_list

struct cmd_list_element* maint_cplus_cmd_list

Definition at line 67 of file cp-support.c.

Referenced by _initialize_cp_namespace(), _initialize_cp_support(), and maint_cplus_command().