GDB (xrefs)
Macros | Functions | Variables
/tmp/gdb-8.1/gdb/cp-support.c File Reference
#include "defs.h"
#include "cp-support.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 "gdb_setjmp.h"
#include "safe-ctype.h"
#include "selftest.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)
 
static void make_symbol_overload_list_using (const char *func_name, const char *the_namespace)
 
static void make_symbol_overload_list_qualified (const char *func_name)
 
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 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)
 
std::string cp_canonicalize_string_full (const char *string, canonicalization_ftype *finder, void *data)
 
std::string cp_canonicalize_string_no_typedefs (const char *string)
 
std::string cp_canonicalize_string (const char *string)
 
static std::unique_ptr< demangle_parse_infomangled_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)
 
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 symbol ** make_symbol_overload_list (const char *func_name, const char *the_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 *the_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)
 
struct typecp_lookup_rtti_type (const char *name, struct block *block)
 
static void gdb_demangle_signal_handler (int signo)
 
char * gdb_demangle (const char *name, int options)
 
int gdb_sniff_from_mangled_name (const char *mangled, char **demangled)
 
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_ftypecp_get_symbol_name_matcher (const lookup_name_info &lookup_name)
 
static void maint_cplus_command (const char *arg, int from_tty)
 
static void first_component_command (const char *arg, int from_tty)
 
static void info_vtbl_command (const 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_elementmaint_cplus_cmd_list = NULL
 
static const char *const ignore_typedefs []
 
static int catch_demangler_crashes = 1
 
static SIGJMP_BUF gdb_demangle_jmp_buf
 
static int gdb_demangle_attempt_core_dump = 1
 

Macro Definition Documentation

◆ d_left

#define d_left (   dc)    (dc)->u.s_binary.left

◆ d_right

#define d_right (   dc)    (dc)->u.s_binary.right

Function Documentation

◆ _initialize_cp_support()

void _initialize_cp_support ( void  )

◆ check_cv_qualifiers()

static void check_cv_qualifiers ( struct demangle_component *  ret_comp)
static

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

References d_left.

Referenced by replace_typedefs().

◆ copy_string_to_obstack()

static char* copy_string_to_obstack ( struct obstack *  obstack,
const char *  string,
long *  len 
)
static

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

Referenced by inspect_type(), and replace_typedefs_qualified_name().

◆ cp_already_canonical()

static int cp_already_canonical ( const char *  string)
static

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

Referenced by cp_canonicalize_string().

◆ cp_canonicalize_string()

std::string cp_canonicalize_string ( const char *  string)

◆ cp_canonicalize_string_full()

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

◆ 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_entire_prefix_len()

unsigned int cp_entire_prefix_len ( const char *  name)

◆ cp_find_first_component()

unsigned int cp_find_first_component ( const char *  name)

◆ cp_find_first_component_aux()

static unsigned int cp_find_first_component_aux ( const char *  name,
int  permissive 
)
static

◆ cp_fq_symbol_name_matches()

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

◆ cp_func_name()

char* cp_func_name ( const char *  full_name)

◆ cp_get_symbol_name_matcher()

symbol_name_matcher_ftype* cp_get_symbol_name_matcher ( const lookup_name_info lookup_name)

◆ cp_lookup_rtti_type()

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

◆ cp_remove_params()

gdb::unique_xmalloc_ptr<char> cp_remove_params ( const char *  demangled_name)

◆ cp_remove_params_1()

static gdb::unique_xmalloc_ptr<char> cp_remove_params_1 ( const char *  demangled_name,
bool  require_params 
)
static

Definition at line 841 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().

◆ 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_search_name_hash()

unsigned int cp_search_name_hash ( const char *  search_name)

◆ cp_symbol_name_matches()

static bool cp_symbol_name_matches ( const char *  symbol_search_name,
const lookup_name_info lookup_name,
completion_match_result comp_match_res 
)
static

◆ cp_symbol_name_matches_1()

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

◆ demangled_name_complaint()

static void demangled_name_complaint ( const char *  name)
static

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

References complaint, name, and symfile_complaints.

Referenced by cp_find_first_component_aux().

◆ first_component_command()

static void first_component_command ( const char *  arg,
int  from_tty 
)
static

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

References cp_find_first_component(), and printf_unfiltered().

Referenced by _initialize_cp_support().

◆ gdb_demangle()

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

◆ gdb_demangle_signal_handler()

static void gdb_demangle_signal_handler ( int  signo)
static

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

References dump_core(), gdb_demangle_attempt_core_dump, gdb_demangle_jmp_buf, and SIGLONGJMP.

Referenced by gdb_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().

◆ info_vtbl_command()

static void info_vtbl_command ( const char *  arg,
int  from_tty 
)
static

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

References cplus_print_vtable(), and parse_and_eval().

Referenced by _initialize_cp_support().

◆ inspect_type()

static int inspect_type ( struct demangle_parse_info info,
struct demangle_component *  ret_comp,
canonicalization_ftype finder,
void *  data 
)
static

◆ maint_cplus_command()

static void maint_cplus_command ( const char *  arg,
int  from_tty 
)
static

◆ make_symbol_overload_list()

struct symbol** make_symbol_overload_list ( const char *  func_name,
const char *  the_namespace 
)

◆ make_symbol_overload_list_adl()

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

◆ make_symbol_overload_list_adl_namespace()

static void make_symbol_overload_list_adl_namespace ( struct type type,
const char *  func_name 
)
static

◆ make_symbol_overload_list_block()

static void make_symbol_overload_list_block ( const char *  name,
const struct block block 
)
static

◆ make_symbol_overload_list_namespace()

static void make_symbol_overload_list_namespace ( const char *  func_name,
const char *  the_namespace 
)
static

◆ make_symbol_overload_list_qualified()

static void make_symbol_overload_list_qualified ( const char *  func_name)
static

◆ make_symbol_overload_list_using()

static void make_symbol_overload_list_using ( const char *  func_name,
const char *  the_namespace 
)
static

◆ mangled_name_to_comp()

static std::unique_ptr<demangle_parse_info> mangled_name_to_comp ( const char *  mangled_name,
int  options,
void **  memory,
char **  demangled_p 
)
static

◆ method_name_from_physname()

char* method_name_from_physname ( const char *  physname)

◆ overload_list_add_symbol()

static void overload_list_add_symbol ( struct symbol sym,
const char *  oload_name 
)
static

◆ replace_typedefs()

static void replace_typedefs ( struct demangle_parse_info info,
struct demangle_component *  ret_comp,
canonicalization_ftype finder,
void *  data 
)
static

◆ 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

◆ unqualified_name_from_comp()

static struct demangle_component* unqualified_name_from_comp ( struct demangle_component *  comp)
static

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

References d_left, d_right, and gdb_assert.

Referenced by cp_func_name(), and method_name_from_physname().

Variable Documentation

◆ catch_demangler_crashes

int catch_demangler_crashes = 1
static

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

Referenced by _initialize_cp_support(), and gdb_demangle().

◆ gdb_demangle_attempt_core_dump

int gdb_demangle_attempt_core_dump = 1
static

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

Referenced by gdb_demangle(), and gdb_demangle_signal_handler().

◆ gdb_demangle_jmp_buf

SIGJMP_BUF gdb_demangle_jmp_buf
static

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

Referenced by gdb_demangle(), and gdb_demangle_signal_handler().

◆ ignore_typedefs

const char* const ignore_typedefs[]
static
Initial value:
=
{
"std::istream", "std::iostream", "std::ostream", "std::string"
}

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

Referenced by inspect_type().

◆ maint_cplus_cmd_list

struct cmd_list_element* maint_cplus_cmd_list = NULL

◆ sym_return_val

struct symbol** sym_return_val
static

◆ sym_return_val_index

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().

◆ sym_return_val_size

int sym_return_val_size = -1
static