GDB (xrefs)
|
#include "defs.h"
#include "cp-support.h"
#include "gdb_string.h"
#include "demangle.h"
#include "gdb_assert.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 "exceptions.h"
#include "expression.h"
#include "value.h"
#include "cp-abi.h"
#include "safe-ctype.h"
Go to the source code of this file.
Defines | |
#define | d_left(dc) (dc)->u.s_binary.left |
#define | d_right(dc) (dc)->u.s_binary.right |
#define | LENGTH_OF_OPERATOR 8 |
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) |
static void | make_symbol_overload_list_using (const char *func_name, const char *namespace) |
static void | make_symbol_overload_list_qualified (const char *func_name) |
static void | maint_cplus_command (char *arg, int from_tty) |
static void | first_component_command (char *arg, int from_tty) |
static void | replace_typedefs (struct demangle_parse_info *info, struct demangle_component *ret_comp, canonicalization_ftype *finder, void *data) |
static char * | copy_string_to_obstack (struct obstack *obstack, const char *string, long *len) |
static void | do_demangled_name_parse_free_cleanup (void *data) |
struct cleanup * | make_cleanup_cp_demangled_name_parse_free (struct demangle_parse_info *info) |
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 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) |
char * | cp_canonicalize_string_full (const char *string, canonicalization_ftype *finder, void *data) |
char * | cp_canonicalize_string_no_typedefs (const char *string) |
char * | cp_canonicalize_string (const char *string) |
static struct demangle_parse_info * | mangled_name_to_comp (const char *mangled_name, int options, void **memory, 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) |
char * | cp_func_name (const char *full_name) |
char * | cp_remove_params (const char *demangled_name) |
unsigned int | cp_find_first_component (const char *name) |
unsigned int | cp_entire_prefix_len (const char *name) |
struct symbol ** | make_symbol_overload_list (const char *func_name, const char *namespace) |
static void | make_symbol_overload_list_block (const char *name, const struct block *block) |
static void | make_symbol_overload_list_namespace (const char *func_name, const char *namespace) |
static void | make_symbol_overload_list_adl_namespace (struct type *type, const char *func_name) |
struct symbol ** | make_symbol_overload_list_adl (struct type **arg_types, int nargs, const char *func_name) |
static void | reset_directive_searched (void *data) |
struct type * | cp_lookup_rtti_type (const char *name, struct block *block) |
char * | gdb_demangle (const char *name, int options) |
static void | info_vtbl_command (char *arg, int from_tty) |
void | _initialize_cp_support (void) |
Variables | |
static int | sym_return_val_size = -1 |
static int | sym_return_val_index |
static struct symbol ** | sym_return_val |
struct cmd_list_element * | maint_cplus_cmd_list = NULL |
static const char *const | ignore_typedefs [] |
initialize_file_ftype | _initialize_cp_support |
#define d_left | ( | dc | ) | (dc)->u.s_binary.left |
Definition at line 41 of file cp-support.c.
Referenced by check_cv_qualifiers(), cp_class_name_from_physname(), cp_remove_params(), replace_typedefs(), replace_typedefs_qualified_name(), and unqualified_name_from_comp().
#define d_right | ( | dc | ) | (dc)->u.s_binary.right |
Definition at line 42 of file cp-support.c.
Referenced by cp_class_name_from_physname(), replace_typedefs(), replace_typedefs_qualified_name(), and unqualified_name_from_comp().
#define LENGTH_OF_OPERATOR 8 |
Definition at line 960 of file cp-support.c.
Referenced by cp_find_first_component_aux().
void _initialize_cp_support | ( | void | ) |
Definition at line 1534 of file cp-support.c.
References _, _initialize_cp_support, add_alias_cmd(), add_cmd(), add_info(), add_prefix_cmd(), class_maintenance, first_component_command(), info_vtbl_command(), maint_cplus_command(), and maintenancelist.
static void check_cv_qualifiers | ( | struct demangle_component * | ret_comp | ) | [static] |
static char* copy_string_to_obstack | ( | struct obstack * | obstack, |
const char * | string, | ||
long * | len | ||
) | [static] |
Definition at line 92 of file cp-support.c.
Referenced by inspect_type(), and replace_typedefs_qualified_name().
static int cp_already_canonical | ( | const char * | string | ) | [static] |
Definition at line 124 of file cp-support.c.
Referenced by cp_canonicalize_string().
char* cp_canonicalize_string | ( | const char * | string | ) |
Definition at line 571 of file cp-support.c.
References _, cp_already_canonical(), cp_comp_to_string(), cp_demangled_name_parse_free(), cp_demangled_name_to_comp(), demangle_parse_info::info, demangle_parse_info::tree, warning(), and xfree().
Referenced by check_status_exception_catchpoint(), define_symbol(), demangle_for_lookup(), dwarf2_canonicalize_name(), gnuv3_get_typeid(), lookup_minimal_symbol_internal(), read_dbx_symtab(), and read_type().
char* cp_canonicalize_string_full | ( | const char * | string, |
canonicalization_ftype * | finder, | ||
void * | data | ||
) |
Definition at line 522 of file cp-support.c.
References cp_comp_to_string(), cp_demangled_name_parse_free(), cp_demangled_name_to_comp(), gdb_assert, demangle_parse_info::info, replace_typedefs(), demangle_parse_info::tree, and xfree().
Referenced by cp_canonicalize_string_no_typedefs(), and print_name_maybe_canonical().
char* cp_canonicalize_string_no_typedefs | ( | const char * | string | ) |
Definition at line 561 of file cp-support.c.
References cp_canonicalize_string_full().
Referenced by find_linespec_symbols(), and inspect_type().
char* cp_class_name_from_physname | ( | const char * | physname | ) |
Definition at line 657 of file cp-support.c.
References cp_comp_to_string(), cp_demangled_name_parse_free(), d_left, d_right, demangle_parse_info::info, mangled_name_to_comp(), demangle_parse_info::tree, and xfree().
unsigned int cp_entire_prefix_len | ( | const char * | name | ) |
Definition at line 1098 of file cp-support.c.
References cp_find_first_component(), and gdb_assert.
Referenced by cp_lookup_symbol_imports_or_template(), cp_set_block_scope(), lookup_symbol_file(), and make_symbol_overload_list_adl_namespace().
unsigned int cp_find_first_component | ( | const char * | name | ) |
Definition at line 948 of file cp-support.c.
References cp_find_first_component_aux().
Referenced by cp_entire_prefix_len(), cp_lookup_transparent_type_loop(), cp_scan_for_anonymous_namespaces(), find_oload_champ_namespace_loop(), first_component_command(), and lookup_namespace_scope().
static unsigned int cp_find_first_component_aux | ( | const char * | name, |
int | permissive | ||
) | [static] |
Definition at line 963 of file cp-support.c.
References demangled_name_complaint(), and LENGTH_OF_OPERATOR.
Referenced by cp_find_first_component().
char* cp_func_name | ( | const char * | full_name | ) |
Definition at line 839 of file cp-support.c.
References cp_comp_to_string(), cp_demangled_name_parse_free(), cp_demangled_name_to_comp(), demangle_parse_info::info, demangle_parse_info::tree, and unqualified_name_from_comp().
Referenced by find_overload_match().
struct type* cp_lookup_rtti_type | ( | const char * | name, |
struct block * | block | ||
) | [read] |
Definition at line 1437 of file cp-support.c.
References _, LOC_TYPEDEF, lookup_symbol(), STRUCT_DOMAIN, SYMBOL_CLASS, SYMBOL_TYPE, TYPE_CODE, TYPE_CODE_CLASS, TYPE_CODE_NAMESPACE, and warning().
Referenced by gnuv2_value_rtti_type(), and gnuv3_rtti_type().
char* cp_remove_params | ( | const char * | demangled_name | ) |
Definition at line 864 of file cp-support.c.
References cp_comp_to_string(), cp_demangled_name_parse_free(), cp_demangled_name_to_comp(), d_left, demangle_parse_info::info, and demangle_parse_info::tree.
Referenced by find_frame_funname(), frame_info(), overload_list_add_symbol(), and psymtab_search_name().
static void demangled_name_complaint | ( | const char * | name | ) | [static] |
Definition at line 1085 of file cp-support.c.
References complaint(), and symfile_complaints.
Referenced by cp_find_first_component_aux().
static void do_demangled_name_parse_free_cleanup | ( | void * | data | ) | [static] |
Definition at line 102 of file cp-support.c.
References cp_demangled_name_parse_free(), and demangle_parse_info::info.
Referenced by make_cleanup_cp_demangled_name_parse_free().
static void first_component_command | ( | char * | arg, |
int | from_tty | ||
) | [static] |
Definition at line 1502 of file cp-support.c.
References cp_find_first_component(), len, memcpy(), and printf_unfiltered().
Referenced by _initialize_cp_support().
char* gdb_demangle | ( | const char * | name, |
int | options | ||
) |
Definition at line 1480 of file cp-support.c.
Referenced by c_type_print_base(), check_stub_method(), demangle_for_lookup(), dwarf2_name(), dwarf2_physname(), fixup_partial_die(), gnuv3_print_method_ptr(), java_demangle(), java_type_print_base(), mangled_name_to_comp(), symbol_find_demangled_name(), and unk_lang_demangle().
static void info_vtbl_command | ( | char * | arg, |
int | from_tty | ||
) | [static] |
Definition at line 1525 of file cp-support.c.
References cplus_print_vtable(), and parse_and_eval().
Referenced by _initialize_cp_support().
static int inspect_type | ( | struct demangle_parse_info * | info, |
struct demangle_component * | ret_comp, | ||
canonicalization_ftype * | finder, | ||
void * | data | ||
) | [static] |
Definition at line 154 of file cp-support.c.
References check_typedef(), copy_string_to_obstack(), cp_canonicalize_string_no_typedefs(), cp_demangled_name_to_comp(), cp_merge_demangle_parse_infos(), ignore_typedefs, len, lookup_symbol(), mem_fileopen(), memcpy(), name, demangle_parse_info::obstack, gdb_exception::reason, replace_typedefs(), RETURN_MASK_ALL, RETURN_MASK_ERROR, SYMBOL_TYPE, TRY_CATCH, type, TYPE_CODE, TYPE_CODE_ENUM, TYPE_CODE_STRUCT, TYPE_CODE_TYPEDEF, TYPE_CODE_UNION, type_print(), TYPE_TAG_NAME, TYPE_TARGET_TYPE, ui_file_delete(), ui_file_obsavestring(), VAR_DOMAIN, and xfree().
Referenced by replace_typedefs(), and replace_typedefs_qualified_name().
static void maint_cplus_command | ( | char * | arg, |
int | from_tty | ||
) | [static] |
Definition at line 1488 of file cp-support.c.
References _, gdb_stdout, help_list(), and printf_unfiltered().
Referenced by _initialize_cp_support().
struct cleanup* make_cleanup_cp_demangled_name_parse_free | ( | struct demangle_parse_info * | info | ) | [read] |
Definition at line 112 of file cp-support.c.
References do_demangled_name_parse_free_cleanup(), and make_cleanup().
Referenced by typy_legacy_template_argument().
struct symbol** make_symbol_overload_list | ( | const char * | func_name, |
const char * | namespace | ||
) | [read] |
Definition at line 1170 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 xmalloc().
Referenced by find_oload_champ_namespace_loop().
struct symbol** make_symbol_overload_list_adl | ( | struct type ** | arg_types, |
int | nargs, | ||
const char * | func_name | ||
) | [read] |
Definition at line 1308 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().
static void make_symbol_overload_list_adl_namespace | ( | struct type * | type, |
const char * | func_name | ||
) | [static] |
Definition at line 1259 of file cp-support.c.
References BASETYPE_VIA_PUBLIC, check_typedef(), cp_entire_prefix_len(), make_symbol_overload_list_namespace(), TYPE_BASECLASS, TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_CLASS, TYPE_CODE_PTR, TYPE_CODE_REF, TYPE_CODE_TYPEDEF, TYPE_N_BASECLASSES, TYPE_NAME, and TYPE_TARGET_TYPE.
Referenced by make_symbol_overload_list_adl().
static void make_symbol_overload_list_block | ( | const char * | name, |
const struct block * | block | ||
) | [static] |
Definition at line 1209 of file cp-support.c.
References block_iter_name_first(), block_iter_name_next(), and overload_list_add_symbol().
Referenced by make_symbol_overload_list_namespace(), and make_symbol_overload_list_qualified().
static void make_symbol_overload_list_namespace | ( | const char * | func_name, |
const char * | namespace | ||
) | [static] |
Definition at line 1224 of file cp-support.c.
References block_global_block(), block_static_block(), get_selected_block(), make_symbol_overload_list_block(), and name.
Referenced by make_symbol_overload_list_adl_namespace(), and make_symbol_overload_list_using().
static void make_symbol_overload_list_qualified | ( | const char * | func_name | ) | [static] |
Definition at line 1390 of file cp-support.c.
References ALL_OBJFILES, ALL_PRIMARY_SYMTABS, block_static_block(), BLOCK_SUPERBLOCK, BLOCKVECTOR, BLOCKVECTOR_BLOCK, quick_symbol_functions::expand_symtabs_for_function, get_selected_block(), GLOBAL_BLOCK, make_symbol_overload_list_block(), sym_fns::qf, QUIT, objfile::sf, and STATIC_BLOCK.
Referenced by make_symbol_overload_list().
static void make_symbol_overload_list_using | ( | const char * | func_name, |
const char * | namespace | ||
) | [static] |
Definition at line 1338 of file cp-support.c.
References using_direct::alias, BLOCK_SUPERBLOCK, block_using(), using_direct::declaration, discard_cleanups(), get_selected_block(), using_direct::import_dest, using_direct::import_src, make_cleanup(), make_symbol_overload_list_namespace(), using_direct::next, reset_directive_searched(), and using_direct::searched.
Referenced by make_symbol_overload_list().
static struct demangle_parse_info* mangled_name_to_comp | ( | const char * | mangled_name, |
int | options, | ||
void ** | memory, | ||
char ** | demangled_p | ||
) | [static, read] |
Definition at line 611 of file cp-support.c.
References cp_demangled_name_to_comp(), cp_new_demangle_parse_info(), gdb_demangle(), demangle_parse_info::info, demangle_parse_info::tree, and xfree().
Referenced by cp_class_name_from_physname(), and method_name_from_physname().
char* method_name_from_physname | ( | const char * | physname | ) |
Definition at line 806 of file cp-support.c.
References cp_comp_to_string(), cp_demangled_name_parse_free(), demangle_parse_info::info, mangled_name_to_comp(), demangle_parse_info::tree, unqualified_name_from_comp(), and xfree().
Referenced by stabs_method_name_from_physname().
static void overload_list_add_symbol | ( | struct symbol * | sym, |
const char * | oload_name | ||
) | [static] |
Definition at line 1122 of file cp-support.c.
References cp_remove_params(), sym_return_val, sym_return_val_index, sym_return_val_size, SYMBOL_LINKAGE_NAME, SYMBOL_NATURAL_NAME, SYMBOL_TYPE, xfree(), and xrealloc().
Referenced by make_symbol_overload_list_block().
static void replace_typedefs | ( | struct demangle_parse_info * | info, |
struct demangle_component * | ret_comp, | ||
canonicalization_ftype * | finder, | ||
void * | data | ||
) | [static] |
Definition at line 426 of file cp-support.c.
References check_cv_qualifiers(), cp_comp_to_string(), d_left, d_right, inspect_type(), lookup_symbol(), gdb_exception::reason, replace_typedefs_qualified_name(), RETURN_MASK_ALL, SYMBOL_TYPE, TRY_CATCH, VAR_DOMAIN, and xfree().
Referenced by cp_canonicalize_string_full(), inspect_type(), and replace_typedefs_qualified_name().
static void replace_typedefs_qualified_name | ( | struct demangle_parse_info * | info, |
struct demangle_component * | ret_comp, | ||
canonicalization_ftype * | finder, | ||
void * | data | ||
) | [static] |
Definition at line 304 of file cp-support.c.
References copy_string_to_obstack(), cp_comp_to_string(), d_left, d_right, fputs_unfiltered(), inspect_type(), len, mem_fileopen(), name, demangle_parse_info::obstack, replace_typedefs(), ui_file_delete(), ui_file_obsavestring(), ui_file_rewind(), ui_file_write(), and xfree().
Referenced by replace_typedefs().
static void reset_directive_searched | ( | void * | data | ) | [static] |
Definition at line 1326 of file cp-support.c.
References using_direct::searched.
Referenced by make_symbol_overload_list_using().
static struct demangle_component* unqualified_name_from_comp | ( | struct demangle_component * | comp | ) | [static, read] |
Definition at line 751 of file cp-support.c.
References d_left, d_right, and gdb_assert.
Referenced by cp_func_name(), and method_name_from_physname().
Referenced by _initialize_cp_support(), and initialize_all_files().
const char* const ignore_typedefs[] [static] |
{ "std::istream", "std::iostream", "std::ostream", "std::string" }
Definition at line 75 of file cp-support.c.
Referenced by inspect_type().
struct cmd_list_element* maint_cplus_cmd_list = NULL |
Definition at line 67 of file cp-support.c.
Referenced by _initialize_cp_namespace().
struct symbol** sym_return_val [static] |
Definition at line 55 of file cp-support.c.
Referenced by make_symbol_overload_list(), make_symbol_overload_list_adl(), and overload_list_add_symbol().
int sym_return_val_index [static] |
Definition at line 54 of file cp-support.c.
Referenced by make_symbol_overload_list(), and overload_list_add_symbol().
int sym_return_val_size = -1 [static] |
Definition at line 53 of file cp-support.c.
Referenced by make_symbol_overload_list(), make_symbol_overload_list_adl(), and overload_list_add_symbol().