GDB (xrefs)
|
#include "defs.h"
#include "cp-support.h"
#include "language.h"
#include "demangle.h"
#include "gdbcmd.h"
#include "dictionary.h"
#include "objfiles.h"
#include "frame.h"
#include "symtab.h"
#include "block.h"
#include "complaints.h"
#include "gdbtypes.h"
#include "expression.h"
#include "value.h"
#include "cp-abi.h"
#include "namespace.h"
#include <signal.h>
#include "gdbsupport/gdb_setjmp.h"
#include "gdbsupport/gdb-safe-ctype.h"
#include "gdbsupport/selftest.h"
#include "gdbsupport/gdb-sigmask.h"
#include <atomic>
#include "event-top.h"
#include "run-on-main-thread.h"
#include "typeprint.h"
Go to the source code of this file.
Macros | |
#define | d_left(dc) (dc)->u.s_binary.left |
#define | d_right(dc) (dc)->u.s_binary.right |
Functions | |
static unsigned int | cp_find_first_component_aux (const char *name, int permissive) |
static void | demangled_name_complaint (const char *name) |
static void | overload_list_add_symbol (struct symbol *sym, const char *oload_name, std::vector< symbol * > *overload_list) |
static void | add_symbol_overload_list_using (const char *func_name, const char *the_namespace, std::vector< symbol * > *overload_list) |
static void | add_symbol_overload_list_qualified (const char *func_name, std::vector< symbol * > *overload_list) |
static void | replace_typedefs (struct demangle_parse_info *info, struct demangle_component *ret_comp, canonicalization_ftype *finder, void *data) |
static struct demangle_component * | gdb_cplus_demangle_v3_components (const char *mangled, int options, void **mem) |
static char * | copy_string_to_obstack (struct obstack *obstack, const char *string, long *len) |
static int | cp_already_canonical (const char *string) |
static int | inspect_type (struct demangle_parse_info *info, struct demangle_component *ret_comp, canonicalization_ftype *finder, void *data) |
static bool | replace_typedefs_template (struct demangle_parse_info *info, string_file &buf, struct demangle_component *tmpl, struct demangle_component *repl, canonicalization_ftype *finder, void *data) |
static void | replace_typedefs_qualified_name (struct demangle_parse_info *info, struct demangle_component *ret_comp, canonicalization_ftype *finder, void *data) |
static void | check_cv_qualifiers (struct demangle_component *ret_comp) |
gdb::unique_xmalloc_ptr< char > | cp_canonicalize_string_full (const char *string, canonicalization_ftype *finder, void *data) |
gdb::unique_xmalloc_ptr< char > | cp_canonicalize_string_no_typedefs (const char *string) |
gdb::unique_xmalloc_ptr< char > | cp_canonicalize_string (const char *string) |
static std::unique_ptr< demangle_parse_info > | mangled_name_to_comp (const char *mangled_name, int options, void **memory, gdb::unique_xmalloc_ptr< char > *demangled_p) |
char * | cp_class_name_from_physname (const char *physname) |
static struct demangle_component * | unqualified_name_from_comp (struct demangle_component *comp) |
char * | method_name_from_physname (const char *physname) |
gdb::unique_xmalloc_ptr< char > | cp_func_name (const char *full_name) |
static gdb::unique_xmalloc_ptr< char > | cp_remove_params_1 (const char *demangled_name, bool require_params) |
gdb::unique_xmalloc_ptr< char > | cp_remove_params (const char *demangled_name) |
gdb::unique_xmalloc_ptr< char > | cp_remove_params_if_any (const char *demangled_name, bool completion_mode) |
unsigned int | cp_find_first_component (const char *name) |
unsigned int | cp_entire_prefix_len (const char *name) |
struct std::vector< symbol * > | make_symbol_overload_list (const char *func_name, const char *the_namespace) |
static void | add_symbol_overload_list_block (const char *name, const struct block *block, std::vector< symbol * > *overload_list) |
static void | add_symbol_overload_list_namespace (const char *func_name, const char *the_namespace, std::vector< symbol * > *overload_list) |
static void | add_symbol_overload_list_adl_namespace (struct type *type, const char *func_name, std::vector< symbol * > *overload_list) |
void | add_symbol_overload_list_adl (gdb::array_view< type * > arg_types, const char *func_name, std::vector< symbol * > *overload_list) |
struct type * | cp_lookup_rtti_type (const char *name, const struct block *block) |
gdb::unique_xmalloc_ptr< char > | gdb_demangle (const char *name, int options) |
char * | gdb_cplus_demangle_print (int options, struct demangle_component *tree, int estimated_length, size_t *p_allocated_size) |
unsigned int | cp_search_name_hash (const char *search_name) |
static bool | cp_symbol_name_matches_1 (const char *symbol_search_name, const char *lookup_name, size_t lookup_name_len, strncmp_iw_mode mode, completion_match_result *comp_match_res) |
static bool | cp_fq_symbol_name_matches (const char *symbol_search_name, const lookup_name_info &lookup_name, completion_match_result *comp_match_res) |
static bool | cp_symbol_name_matches (const char *symbol_search_name, const lookup_name_info &lookup_name, completion_match_result *comp_match_res) |
symbol_name_matcher_ftype * | cp_get_symbol_name_matcher (const lookup_name_info &lookup_name) |
static void | first_component_command (const char *arg, int from_tty) |
static void | info_vtbl_command (const char *arg, int from_tty) |
const char * | find_toplevel_char (const char *s, char c) |
void | _initialize_cp_support () |
Variables | |
struct cmd_list_element * | maint_cplus_cmd_list = NULL |
#define d_left | ( | dc | ) | (dc)->u.s_binary.left |
Definition at line 47 of file cp-support.c.
Referenced by check_cv_qualifiers(), cp_class_name_from_physname(), cp_remove_params_1(), replace_typedefs(), replace_typedefs_qualified_name(), and unqualified_name_from_comp().
#define d_right | ( | dc | ) | (dc)->u.s_binary.right |
Definition at line 48 of file cp-support.c.
Referenced by cp_class_name_from_physname(), replace_typedefs(), replace_typedefs_qualified_name(), replace_typedefs_template(), and unqualified_name_from_comp().
void _initialize_cp_support | ( | ) |
Definition at line 2325 of file cp-support.c.
Referenced by initialize_all_files().
void add_symbol_overload_list_adl | ( | gdb::array_view< type * > | arg_types, |
const char * | func_name, | ||
std::vector< symbol * > * | overload_list ) |
Definition at line 1374 of file cp-support.c.
References add_symbol_overload_list_adl_namespace().
Referenced by find_oload_champ_namespace_loop().
|
static |
Definition at line 1324 of file cp-support.c.
References add_symbol_overload_list_adl_namespace(), add_symbol_overload_list_namespace(), BASETYPE_VIA_PUBLIC, check_typedef(), type::code(), cp_entire_prefix_len(), type::is_pointer_or_reference(), type::name(), type::target_type(), TYPE_BASECLASS, and TYPE_N_BASECLASSES.
Referenced by add_symbol_overload_list_adl(), and add_symbol_overload_list_adl_namespace().
|
static |
Definition at line 1273 of file cp-support.c.
References FULL, name, and overload_list_add_symbol().
Referenced by add_symbol_overload_list_namespace(), and add_symbol_overload_list_qualified().
|
static |
Definition at line 1286 of file cp-support.c.
References add_symbol_overload_list_block(), get_selected_block(), block::global_block(), name, nullptr, and block::static_block().
Referenced by add_symbol_overload_list_adl_namespace(), and add_symbol_overload_list_using().
|
static |
Definition at line 1439 of file cp-support.c.
References add_symbol_overload_list_block(), objfile::arch(), current_program_space, gdbarch_iterate_over_objfiles_in_search_order(), get_selected_block(), block::global_block(), nullptr, block::objfile(), program_space::objfiles(), QUIT, block::static_block(), block::superblock(), and target_gdbarch().
Referenced by make_symbol_overload_list().
|
static |
Definition at line 1389 of file cp-support.c.
References add_symbol_overload_list_namespace(), add_symbol_overload_list_using(), using_direct::alias, using_direct::declaration, get_selected_block(), block::get_using(), using_direct::import_dest, using_direct::import_src, using_direct::next, using_direct::searched, and block::superblock().
Referenced by add_symbol_overload_list_using(), and make_symbol_overload_list().
|
static |
|
static |
Definition at line 91 of file cp-support.c.
Referenced by inspect_type(), and replace_typedefs_qualified_name().
|
static |
Definition at line 105 of file cp-support.c.
Referenced by cp_canonicalize_string().
gdb::unique_xmalloc_ptr< char > cp_canonicalize_string | ( | const char * | string | ) |
Definition at line 627 of file cp-support.c.
References cp_already_canonical(), cp_comp_to_string(), and cp_demangled_name_to_comp().
Referenced by c_canonicalize_name(), exception_catchpoint::check_status(), define_symbol(), demangle_for_lookup(), cooked_index_shard::do_finalize(), dwarf2_canonicalize_name(), gnuv3_get_typeid(), read_dbx_symtab(), read_type(), and yyparse().
gdb::unique_xmalloc_ptr< char > cp_canonicalize_string_full | ( | const char * | string, |
canonicalization_ftype * | finder, | ||
void * | data ) |
Definition at line 583 of file cp-support.c.
References cp_comp_to_string(), cp_demangled_name_to_comp(), and replace_typedefs().
Referenced by cp_canonicalize_string_no_typedefs(), and print_name_maybe_canonical().
gdb::unique_xmalloc_ptr< char > cp_canonicalize_string_no_typedefs | ( | const char * | string | ) |
Definition at line 617 of file cp-support.c.
References cp_canonicalize_string_full().
Referenced by completion_list_add_symbol(), find_linespec_symbols(), and inspect_type().
char * cp_class_name_from_physname | ( | const char * | physname | ) |
Definition at line 706 of file cp-support.c.
References cp_comp_to_string(), d_left, d_right, mangled_name_to_comp(), and xfree().
Referenced by cplus_language::class_name_from_physname().
unsigned int cp_entire_prefix_len | ( | const char * | name | ) |
Definition at line 1188 of file cp-support.c.
References cp_find_first_component(), and name.
Referenced by add_symbol_overload_list_adl_namespace(), cp_lookup_symbol_imports_or_template(), cp_lookup_symbol_in_namespace(), cp_search_name_hash(), and cp_set_block_scope().
unsigned int cp_find_first_component | ( | const char * | name | ) |
Definition at line 1037 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_language::lookup_symbol_nonlocal(), rust_crate_for_block(), split_name(), rust_parser::super_name(), and type_name_to_scope().
|
static |
Definition at line 1048 of file cp-support.c.
References cp_find_first_component_aux(), CP_OPERATOR_LEN, CP_OPERATOR_STR, demangled_name_complaint(), and name.
Referenced by cp_find_first_component(), and cp_find_first_component_aux().
|
static |
Definition at line 1839 of file cp-support.c.
References lookup_name_info::completion_mode(), lookup_name_info::cplus(), language_cplus, demangle_for_lookup_info::lookup_name(), completion_match_result::match_for_lcd, MATCH_PARAMS, name, NORMAL, completion_match_result::set_match(), and strncmp_iw_with_mode().
Referenced by cp_get_symbol_name_matcher().
gdb::unique_xmalloc_ptr< char > cp_func_name | ( | const char * | full_name | ) |
Definition at line 883 of file cp-support.c.
References cp_comp_to_string(), cp_demangled_name_to_comp(), and unqualified_name_from_comp().
Referenced by compile_cplus_instance::decl_name(), and find_overload_match().
symbol_name_matcher_ftype * cp_get_symbol_name_matcher | ( | const lookup_name_info & | lookup_name | ) |
Definition at line 1886 of file cp-support.c.
References cp_fq_symbol_name_matches(), cp_symbol_name_matches(), EXPRESSION, FULL, lookup_name_info::match_type(), SEARCH_NAME, and WILD.
Referenced by cplus_language::get_symbol_name_matcher_inner(), and f_language::get_symbol_name_matcher_inner().
Definition at line 1495 of file cp-support.c.
References symbol::aclass(), check_typedef(), type::code(), LOC_TYPEDEF, lookup_symbol(), name, block_symbol::symbol, symbol::type(), and VAR_DOMAIN.
Referenced by gnuv2_value_rtti_type(), and gnuv3_rtti_type().
gdb::unique_xmalloc_ptr< char > cp_remove_params | ( | const char * | demangled_name | ) |
Definition at line 959 of file cp-support.c.
References cp_remove_params_1().
Referenced by find_frame_funname(), dw2_debug_names_iterator::find_vec_in_debug_names(), info_frame_command_core(), and overload_list_add_symbol().
|
static |
Definition at line 908 of file cp-support.c.
References cp_comp_to_string(), cp_demangled_name_to_comp(), and d_left.
Referenced by cp_remove_params(), and 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 967 of file cp-support.c.
References cp_remove_params_1().
Referenced by demangle_for_lookup_info::demangle_for_lookup_info().
unsigned int cp_search_name_hash | ( | const char * | search_name | ) |
Definition at line 1704 of file cp-support.c.
References cp_entire_prefix_len(), and SYMBOL_HASH_NEXT.
Referenced by cplus_language::search_name_hash(), and f_language::search_name_hash().
|
static |
Definition at line 1867 of file cp-support.c.
References lookup_name_info::completion_mode(), cp_symbol_name_matches_1(), lookup_name_info::cplus(), demangle_for_lookup_info::lookup_name(), MATCH_PARAMS, name, and NORMAL.
Referenced by cp_get_symbol_name_matcher().
|
static |
Definition at line 1775 of file cp-support.c.
References completion_match_for_lcd::clear(), cp_find_first_component(), completion_match_for_lcd::empty(), language_cplus, completion_match_result::match_for_lcd, completion_match_result::set_match(), and strncmp_iw_with_mode().
Referenced by cp_symbol_name_matches().
|
static |
Definition at line 1176 of file cp-support.c.
References complaint, and name.
Referenced by cp_find_first_component_aux().
const char * find_toplevel_char | ( | const char * | s, |
char | c ) |
Definition at line 2252 of file cp-support.c.
References CP_OPERATOR_LEN, CP_OPERATOR_STR, and scan().
Referenced by explicit_location_spec_lex_one_function(), find_toplevel_string(), skip_op_false_positives(), skip_quote_char(), and skip_template_parameter_list().
|
static |
Definition at line 2221 of file cp-support.c.
References cp_find_first_component(), gdb_printf(), and prefix.
char * gdb_cplus_demangle_print | ( | int | options, |
struct demangle_component * | tree, | ||
int | estimated_length, | ||
size_t * | p_allocated_size ) |
Definition at line 1682 of file cp-support.c.
Referenced by cp_comp_to_string().
|
static |
Definition at line 1695 of file cp-support.c.
Referenced by mangled_name_to_comp().
gdb::unique_xmalloc_ptr< char > gdb_demangle | ( | const char * | name, |
int | options ) |
Definition at line 1609 of file cp-support.c.
References name, and run_on_main_thread().
Referenced by c_type_print_base_struct_union(), check_stub_method(), d_demangle(), demangle_for_lookup(), cplus_language::demangle_symbol(), unknown_language::demangle_symbol(), dwarf2_name(), dwarf2_physname(), gnuv2_value_rtti_type(), gnuv3_print_method_ptr(), mangled_name_to_comp(), and cplus_language::sniff_from_mangled_name().
|
static |
Definition at line 2241 of file cp-support.c.
References cplus_print_vtable(), parse_and_eval(), and value.
|
static |
Definition at line 135 of file cp-support.c.
References check_typedef(), type::code(), copy_string_to_obstack(), cp_canonicalize_string_no_typedefs(), cp_demangled_name_to_comp(), cp_merge_demangle_parse_infos(), general_symbol_info::language(), language_def(), lookup_symbol(), name, type::name(), language_defn::print_type(), replace_typedefs(), string_file::size(), string_file::string(), block_symbol::symbol, type::target_type(), type, symbol::type(), type_print_raw_options, and VAR_DOMAIN.
Referenced by replace_typedefs(), and replace_typedefs_qualified_name().
struct std::vector< symbol * > make_symbol_overload_list | ( | const char * | func_name, |
const char * | the_namespace ) |
Definition at line 1243 of file cp-support.c.
References add_symbol_overload_list_qualified(), add_symbol_overload_list_using(), and name.
Referenced by find_oload_champ_namespace_loop().
|
static |
Definition at line 663 of file cp-support.c.
References cp_demangled_name_to_comp(), gdb_cplus_demangle_v3_components(), and gdb_demangle().
Referenced by cp_class_name_from_physname(), and method_name_from_physname().
char * method_name_from_physname | ( | const char * | physname | ) |
Definition at line 853 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().
|
static |
Definition at line 1212 of file cp-support.c.
References cp_remove_params(), general_symbol_info::linkage_name(), general_symbol_info::natural_name(), and symbol::type().
Referenced by add_symbol_overload_list_block().
|
static |
Definition at line 483 of file cp-support.c.
References check_cv_qualifiers(), cp_comp_to_string(), d_left, d_right, inspect_type(), lookup_symbol(), replace_typedefs(), replace_typedefs_qualified_name(), block_symbol::symbol, symbol::type(), and VAR_DOMAIN.
Referenced by cp_canonicalize_string_full(), inspect_type(), replace_typedefs(), replace_typedefs_qualified_name(), and replace_typedefs_template().
|
static |
Definition at line 338 of file cp-support.c.
References string_file::clear(), copy_string_to_obstack(), cp_comp_to_string(), d_left, d_right, inspect_type(), name, ui_file::puts(), replace_typedefs(), replace_typedefs_template(), string_file::size(), string_file::string(), and string_file::write().
Referenced by replace_typedefs().
|
static |
Definition at line 305 of file cp-support.c.
References cp_comp_to_string(), d_right, ui_file::puts(), replace_typedefs(), string_file::size(), and string_file::string().
Referenced by replace_typedefs_qualified_name().
|
static |
Definition at line 798 of file cp-support.c.
References d_left, and d_right.
Referenced by cp_func_name(), and method_name_from_physname().
struct cmd_list_element* maint_cplus_cmd_list = NULL |
Definition at line 73 of file cp-support.c.