GDB (xrefs)
|
#include "defs.h"
#include "value.h"
#include "cp-abi.h"
#include "cp-support.h"
#include "demangle.h"
#include "dwarf2.h"
#include "objfiles.h"
#include "valprint.h"
#include "c-lang.h"
#include "typeprint.h"
#include <algorithm>
#include "cli/cli-style.h"
#include "dwarf2/loc.h"
#include "inferior.h"
Go to the source code of this file.
Classes | |
struct | value_and_voffset |
Macros | |
#define | TYPEINFO_PREFIX "typeinfo for " |
#define | TYPEINFO_PREFIX_LEN (sizeof (TYPEINFO_PREFIX) - 1) |
Enumerations | |
enum | { vtable_field_vcall_and_vbase_offsets , vtable_field_offset_to_top , vtable_field_type_info , vtable_field_virtual_functions } |
enum | definition_style { DOES_NOT_EXIST_IN_SOURCE , DEFAULTED_INSIDE , DEFAULTED_OUTSIDE , DELETED , EXPLICIT } |
Functions | |
static int | gnuv3_is_vtable_name (const char *name) |
static int | gnuv3_is_operator_name (const char *name) |
static struct type * | get_gdb_vtable_type (struct gdbarch *arch) |
static struct type * | vtable_ptrdiff_type (struct gdbarch *gdbarch) |
static int | vtable_address_point_offset (struct gdbarch *gdbarch) |
static int | gnuv3_dynamic_class (struct type *type) |
static struct value * | gnuv3_get_vtable (struct gdbarch *gdbarch, struct type *container_type, CORE_ADDR container_addr) |
static struct type * | gnuv3_rtti_type (struct value *value, int *full_p, LONGEST *top_p, int *using_enc_p) |
static struct value * | gnuv3_get_virtual_fn (struct gdbarch *gdbarch, struct value *container, struct type *fntype, int vtable_index) |
static struct value * | gnuv3_virtual_fn_field (struct value **value_p, struct fn_field *f, int j, struct type *vfn_base, int offset) |
static int | gnuv3_baseclass_offset (struct type *type, int index, const bfd_byte *valaddr, LONGEST embedded_offset, CORE_ADDR address, const struct value *val) |
static const char * | gnuv3_find_method_in (struct type *domain, CORE_ADDR voffset, LONGEST adjustment) |
static int | gnuv3_decode_method_ptr (struct gdbarch *gdbarch, const gdb_byte *contents, CORE_ADDR *value_p, LONGEST *adjustment_p) |
static void | gnuv3_print_method_ptr (const gdb_byte *contents, struct type *type, struct ui_file *stream) |
static int | gnuv3_method_ptr_size (struct type *type) |
static void | gnuv3_make_method_ptr (struct type *type, gdb_byte *contents, CORE_ADDR value, int is_virtual) |
static struct value * | gnuv3_method_ptr_to_value (struct value **this_p, struct value *method_ptr) |
static hashval_t | hash_value_and_voffset (const void *p) |
static int | eq_value_and_voffset (const void *a, const void *b) |
static bool | compare_value_and_voffset (const struct value_and_voffset *va, const struct value_and_voffset *vb) |
static void | compute_vtable_size (htab_t offset_hash, std::vector< value_and_voffset * > *offset_vec, struct value *value) |
static void | print_one_vtable (struct gdbarch *gdbarch, struct value *value, int max_voffset, struct value_print_options *opts) |
static void | gnuv3_print_vtable (struct value *value) |
static struct type * | build_std_type_info_type (struct gdbarch *arch) |
static struct type * | gnuv3_get_typeid_type (struct gdbarch *gdbarch) |
static struct value * | gnuv3_get_typeid (struct value *value) |
static std::string | gnuv3_get_typename_from_type_info (struct value *type_info_ptr) |
static struct type * | gnuv3_get_type_from_type_info (struct value *type_info_ptr) |
static CORE_ADDR | gnuv3_skip_trampoline (frame_info_ptr frame, CORE_ADDR stop_pc) |
static definition_style | get_def_style (struct fn_field *fn, int fieldelem) |
static bool | is_user_provided_def (definition_style def) |
static bool | is_implicit_def (definition_style def) |
static bool | is_copy_or_move_constructor_type (struct type *class_type, struct type *method_type, type_code expected) |
static bool | is_copy_constructor_type (struct type *class_type, struct type *method_type) |
static bool | is_move_constructor_type (struct type *class_type, struct type *method_type) |
static struct language_pass_by_ref_info | gnuv3_pass_by_reference (struct type *type) |
static void | init_gnuv3_ops (void) |
void | _initialize_gnu_v3_abi () |
Variables | |
static struct cp_abi_ops | gnu_v3_abi_ops |
static const registry< gdbarch >::key< struct type > | std_type_info_gdbarch_data |
static const registry< gdbarch >::key< struct type > | vtable_type_gdbarch_data |
#define TYPEINFO_PREFIX "typeinfo for " |
#define TYPEINFO_PREFIX_LEN (sizeof (TYPEINFO_PREFIX) - 1) |
anonymous enum |
Enumerator | |
---|---|
vtable_field_vcall_and_vbase_offsets | |
vtable_field_offset_to_top | |
vtable_field_type_info | |
vtable_field_virtual_functions |
Definition at line 98 of file gnu-v3-abi.c.
enum definition_style |
Enumerator | |
---|---|
DOES_NOT_EXIST_IN_SOURCE | |
DEFAULTED_INSIDE | |
DEFAULTED_OUTSIDE | |
DELETED | |
EXPLICIT |
Definition at line 1269 of file gnu-v3-abi.c.
void _initialize_gnu_v3_abi | ( | ) |
Definition at line 1600 of file gnu-v3-abi.c.
Referenced by initialize_all_files().
Definition at line 1023 of file gnu-v3-abi.c.
References type::arch(), arch_type(), builtin_type::builtin_char, builtin_type::builtin_data_ptr, INIT_CPLUS_SPECIFIC, type::length(), make_cv_type(), make_pointer_type(), type::set_fields(), field::set_loc_bitpos(), field::set_name(), type::set_name(), type::set_num_fields(), field::set_type(), and field::type().
Referenced by gnuv3_get_typeid_type().
|
static |
Definition at line 824 of file gnu-v3-abi.c.
References value_and_voffset::value, value_address(), and value_embedded_offset().
Referenced by gnuv3_print_vtable().
|
static |
Definition at line 842 of file gnu-v3-abi.c.
References check_typedef(), type::code(), compute_vtable_size(), gnuv3_dynamic_class(), value_and_voffset::max_voffset, TYPE_FN_FIELD_VIRTUAL_P, TYPE_FN_FIELD_VOFFSET, TYPE_FN_FIELDLIST1, TYPE_FN_FIELDLIST_LENGTH, TYPE_N_BASECLASSES, TYPE_NFN_FIELDS, value_and_voffset::value, value_field(), value_type(), and fn_field::voffset.
Referenced by compute_vtable_size(), and gnuv3_print_vtable().
|
static |
Definition at line 812 of file gnu-v3-abi.c.
References value_and_voffset::value, value_address(), and value_embedded_offset().
Referenced by gnuv3_print_vtable().
|
static |
Definition at line 1281 of file gnu-v3-abi.c.
References DEFAULTED_INSIDE, DEFAULTED_OUTSIDE, DELETED, DOES_NOT_EXIST_IN_SOURCE, EXPLICIT, TYPE_FN_FIELD_ARTIFICIAL, TYPE_FN_FIELD_DEFAULTED, and TYPE_FN_FIELD_DELETED.
Referenced by gnuv3_pass_by_reference().
Definition at line 112 of file gnu-v3-abi.c.
References type::arch(), arch_integer_type(), arch_type(), builtin_type::builtin_data_ptr, builtin_type::builtin_func_ptr, gdbarch_ptr_bit(), registry< T >::get(), INIT_CPLUS_SPECIFIC, type::length(), lookup_array_range_type(), make_type_with_address_space(), registry< T >::set(), type::set_fields(), field::set_loc_bitpos(), field::set_name(), type::set_name(), type::set_num_fields(), field::set_type(), field::type(), TYPE_INSTANCE_FLAG_CODE_SPACE, and vtable_type_gdbarch_data.
Referenced by gnuv3_get_vtable(), vtable_address_point_offset(), and vtable_ptrdiff_type().
|
static |
Definition at line 450 of file gnu-v3-abi.c.
References property_addr_info::addr, type::arch(), BASETYPE_VIA_VIRTUAL, dynamic_prop::baton(), builtin_type::builtin_data_ptr, dwarf2_evaluate_property(), type::field(), FIELD_LOC_KIND_DWARF_BLOCK, gnuv3_get_vtable(), type::length(), field::loc_dwarf_block(), field::loc_kind(), dwarf2_property_baton::locexpr, lookup_pointer_type(), property_addr_info::next, dwarf2_property_baton::property_type, dynamic_prop::set_locexpr(), property_addr_info::type, field::type(), TYPE_BASECLASS_BITPOS, value_as_long(), value_field(), value_subscript(), vtable_address_point_offset(), and vtable_field_vcall_and_vbase_offsets.
Referenced by init_gnuv3_ops().
|
static |
Definition at line 569 of file gnu-v3-abi.c.
References builtin_type::builtin_func_ptr, extract_signed_integer(), extract_typed_address(), gdbarch_byte_order(), gdbarch_vbit_in_delta(), type::length(), and vtable_ptrdiff_type().
Referenced by gnuv3_method_ptr_to_value(), and gnuv3_print_method_ptr().
|
static |
Definition at line 211 of file gnu-v3-abi.c.
References ALLOCATE_CPLUS_STRUCT_TYPE, BASETYPE_VIA_VIRTUAL, check_typedef(), type::code(), f(), type::field(), gnuv3_dynamic_class(), field::type(), TYPE_CPLUS_DYNAMIC, TYPE_FN_FIELD_VIRTUAL_P, TYPE_FN_FIELDLIST1, TYPE_FN_FIELDLIST_LENGTH, TYPE_N_BASECLASSES, and TYPE_NFN_FIELDS.
Referenced by compute_vtable_size(), gnuv3_dynamic_class(), gnuv3_get_typeid(), gnuv3_get_vtable(), gnuv3_pass_by_reference(), and gnuv3_rtti_type().
|
static |
Definition at line 519 of file gnu-v3-abi.c.
References BASETYPE_VIA_VIRTUAL, check_stub_method_group(), f(), type::field(), gnuv3_find_method_in(), type::length(), field::type(), TYPE_BASECLASS_BITPOS, TYPE_FN_FIELD_PHYSNAME, TYPE_FN_FIELD_VOFFSET, TYPE_FN_FIELDLIST1, TYPE_FN_FIELDLIST_LENGTH, TYPE_N_BASECLASSES, TYPE_NFN_FIELDS, and fn_field::voffset.
Referenced by gnuv3_find_method_in(), and gnuv3_print_method_ptr().
Definition at line 1202 of file gnu-v3-abi.c.
References evaluate_type(), gnuv3_get_typename_from_type_info(), parse_expression(), and value_type().
Referenced by init_gnuv3_ops().
Definition at line 1092 of file gnu-v3-abi.c.
References value::address, type::arch(), check_typedef(), type::code(), coerce_ref(), cp_canonicalize_string(), gnuv3_dynamic_class(), gnuv3_get_typeid_type(), gnuv3_get_vtable(), lookup_minimal_symbol(), lval_memory, make_cv_type(), make_pointer_type(), bound_minimal_symbol::minsym, name, type::target_type(), type_to_string(), bound_minimal_symbol::value_address(), value_address(), value_at_lazy(), value_cast(), value_embedded_offset(), value_field(), value_ind(), value_lval_const(), value_type(), and vtable_field_type_info.
Referenced by init_gnuv3_ops().
Definition at line 1067 of file gnu-v3-abi.c.
References build_std_type_info_type(), registry< T >::get(), lookup_symbol(), registry< T >::set(), std_type_info_gdbarch_data, STRUCT_DOMAIN, block_symbol::symbol, and symbol::type().
Referenced by gnuv3_get_typeid(), and init_gnuv3_ops().
|
static |
Definition at line 1168 of file gnu-v3-abi.c.
References type::arch(), general_symbol_info::demangled_name, general_symbol_info::linkage_name(), lookup_minimal_symbol_by_pc(), bound_minimal_symbol::minsym, paddress(), TYPEINFO_PREFIX, TYPEINFO_PREFIX_LEN, value_as_address(), and value_type().
Referenced by gnuv3_get_type_from_type_info(), and init_gnuv3_ops().
|
static |
Definition at line 385 of file gnu-v3-abi.c.
References gdbarch_vtable_function_descriptors(), gnuv3_get_vtable(), lookup_pointer_type(), value_addr(), value_as_address(), value_cast(), value_field(), value_subscript(), value_type(), and vtable_field_virtual_functions.
Referenced by gnuv3_method_ptr_to_value(), and gnuv3_virtual_fn_field().
|
static |
Definition at line 257 of file gnu-v3-abi.c.
References check_typedef(), type::code(), get_gdb_vtable_type(), gnuv3_dynamic_class(), lookup_pointer_type(), value_as_address(), value_at(), value_at_lazy(), and vtable_address_point_offset().
Referenced by gnuv3_baseclass_offset(), gnuv3_get_typeid(), gnuv3_get_virtual_fn(), gnuv3_print_vtable(), gnuv3_rtti_type(), and print_one_vtable().
|
static |
Definition at line 51 of file gnu-v3-abi.c.
References CP_OPERATOR_STR, and name.
Referenced by init_gnuv3_ops().
|
static |
|
static |
Definition at line 702 of file gnu-v3-abi.c.
References type::arch(), builtin_type::builtin_data_ptr, gdbarch_vbit_in_delta(), type::length(), size, store_unsigned_integer(), and type_byte_order().
Referenced by init_gnuv3_ops().
|
static |
Definition at line 694 of file gnu-v3-abi.c.
References type::arch(), builtin_type::builtin_data_ptr, and type::length().
Referenced by init_gnuv3_ops().
|
static |
Definition at line 733 of file gnu-v3-abi.c.
References type::arch(), check_typedef(), gnuv3_decode_method_ptr(), gnuv3_get_virtual_fn(), type::length(), lookup_pointer_type(), type::target_type(), TYPE_SELF_TYPE, value_cast(), value_contents(), value_from_pointer(), value_ind(), value_ptradd(), value_type(), and vtable_ptrdiff_type().
Referenced by init_gnuv3_ops().
|
static |
Definition at line 1407 of file gnu-v3-abi.c.
References check_typedef(), type::code(), DELETED, DOES_NOT_EXIST_IN_SOURCE, type::field(), field_is_static(), get_def_style(), gnuv3_dynamic_class(), gnuv3_pass_by_reference(), is_constructor_name(), is_copy_constructor_type(), is_implicit_def(), is_move_constructor_type(), is_user_provided_def(), name, type::num_fields(), type::target_type(), field::type(), TYPE_CPLUS_CALLING_CONVENTION, TYPE_FN_FIELD_CONSTRUCTOR, TYPE_FN_FIELD_PHYSNAME, TYPE_FN_FIELD_TYPE, TYPE_FN_FIELDLIST1, TYPE_FN_FIELDLIST_LENGTH, TYPE_FN_FIELDLIST_NAME, and TYPE_NFN_FIELDS.
Referenced by gnuv3_pass_by_reference(), and init_gnuv3_ops().
|
static |
Definition at line 613 of file gnu-v3-abi.c.
References type::arch(), c_print_type(), current_language, demangle, gdb_demangle(), gdb_printf(), gdb_puts(), get_user_print_options(), gnuv3_decode_method_ptr(), gnuv3_find_method_in(), language_defn::la_language, type::length(), print_address_demangle(), print_longest(), type_print_raw_options, TYPE_SELF_TYPE, and vtable_ptrdiff_type().
Referenced by init_gnuv3_ops().
|
static |
Definition at line 956 of file gnu-v3-abi.c.
References type::arch(), check_typedef(), type::code(), coerce_ref(), compare_value_and_voffset(), compute_vtable_size(), eq_value_and_voffset(), gdb_printf(), get_user_print_options(), gnuv3_get_vtable(), hash_value_and_voffset(), print_one_vtable(), value_addr(), value_as_address(), value_full_object(), value_ind(), value_type(), xcalloc(), and xfree().
Referenced by init_gnuv3_ops().
|
static |
Definition at line 296 of file gnu-v3-abi.c.
References type::arch(), check_typedef(), type::code(), cp_lookup_rtti_type(), general_symbol_info::demangled_name, gnuv3_dynamic_class(), gnuv3_get_vtable(), type::length(), lookup_minimal_symbol_by_pc(), bound_minimal_symbol::minsym, TYPE_SAFE_NAME, value_addr(), value_address(), value_as_address(), value_as_long(), value_embedded_offset(), value_enclosing_type(), value_field(), value_type(), and vtable_field_offset_to_top.
Referenced by init_gnuv3_ops().
|
static |
Definition at line 1218 of file gnu-v3-abi.c.
References current_inferior(), general_symbol_info::demangled_name, find_pc_section(), gdbarch_convert_from_func_ptr_addr(), gdbarch_skip_trampoline_code(), get_frame_arch(), lookup_minimal_symbol(), lookup_minimal_symbol_by_pc(), bound_minimal_symbol::minsym, obj_section::objfile, and bound_minimal_symbol::value_address().
Referenced by init_gnuv3_ops().
|
static |
Definition at line 417 of file gnu-v3-abi.c.
References type::arch(), check_typedef(), type::code(), f(), gnuv3_get_virtual_fn(), TYPE_FN_FIELD_TYPE, TYPE_FN_FIELD_VOFFSET, value_cast(), and value_type().
Referenced by init_gnuv3_ops().
|
static |
Definition at line 802 of file gnu-v3-abi.c.
References value_and_voffset::value, value_address(), and value_embedded_offset().
Referenced by gnuv3_print_vtable().
|
static |
Definition at line 1570 of file gnu-v3-abi.c.
References cp_abi_ops::baseclass_offset, cp_abi_ops::doc, cp_abi_ops::get_type_from_type_info, cp_abi_ops::get_typeid, cp_abi_ops::get_typeid_type, cp_abi_ops::get_typename_from_type_info, gnu_v3_abi_ops, gnuv3_baseclass_offset(), gnuv3_get_type_from_type_info(), gnuv3_get_typeid(), gnuv3_get_typeid_type(), gnuv3_get_typename_from_type_info(), gnuv3_is_operator_name(), gnuv3_is_vtable_name(), gnuv3_make_method_ptr(), gnuv3_method_ptr_size(), gnuv3_method_ptr_to_value(), gnuv3_pass_by_reference(), gnuv3_print_method_ptr(), gnuv3_print_vtable(), gnuv3_rtti_type(), gnuv3_skip_trampoline(), gnuv3_virtual_fn_field(), cp_abi_ops::is_constructor_name, cp_abi_ops::is_destructor_name, cp_abi_ops::is_operator_name, cp_abi_ops::is_vtable_name, cp_abi_ops::longname, cp_abi_ops::make_method_ptr, cp_abi_ops::method_ptr_size, cp_abi_ops::method_ptr_to_value, cp_abi_ops::pass_by_reference, cp_abi_ops::print_method_ptr, cp_abi_ops::print_vtable, cp_abi_ops::rtti_type, cp_abi_ops::shortname, cp_abi_ops::skip_trampoline, and cp_abi_ops::virtual_fn_field.
Definition at line 1371 of file gnu-v3-abi.c.
References is_copy_or_move_constructor_type().
Referenced by gnuv3_pass_by_reference().
|
static |
Definition at line 1329 of file gnu-v3-abi.c.
References check_typedef(), class_types_same_p(), type::code(), type::field(), type::num_fields(), type::target_type(), and field::type().
Referenced by is_copy_constructor_type(), and is_move_constructor_type().
|
static |
Definition at line 1316 of file gnu-v3-abi.c.
References DEFAULTED_INSIDE, and DOES_NOT_EXIST_IN_SOURCE.
Referenced by gnuv3_pass_by_reference().
Definition at line 1381 of file gnu-v3-abi.c.
References is_copy_or_move_constructor_type().
Referenced by gnuv3_pass_by_reference().
|
static |
Definition at line 1310 of file gnu-v3-abi.c.
References DEFAULTED_OUTSIDE, and EXPLICIT.
Referenced by gnuv3_pass_by_reference().
|
static |
Definition at line 899 of file gnu-v3-abi.c.
References check_typedef(), fprintf_styled(), gdb_printf(), gdb_stdout, gdbarch_vtable_function_descriptors(), gnuv3_get_vtable(), metadata_style, paddress(), print_function_pointer_address(), cli_style_option::style(), TYPE_SAFE_NAME, value_addr(), value_address(), value_as_address(), value_embedded_offset(), value_field(), value_subscript(), value_type(), and vtable_field_virtual_functions.
Referenced by gnuv3_print_vtable().
|
static |
Definition at line 198 of file gnu-v3-abi.c.
References type::field(), get_gdb_vtable_type(), field::loc_bitpos(), and vtable_field_virtual_functions.
Referenced by gnuv3_baseclass_offset(), and gnuv3_get_vtable().
Definition at line 186 of file gnu-v3-abi.c.
References type::field(), get_gdb_vtable_type(), field::type(), and vtable_field_offset_to_top.
Referenced by gnuv3_decode_method_ptr(), gnuv3_method_ptr_to_value(), and gnuv3_print_method_ptr().
|
static |
Definition at line 36 of file gnu-v3-abi.c.
Referenced by init_gnuv3_ops().
Definition at line 41 of file gnu-v3-abi.c.
Referenced by gnuv3_get_typeid_type().
Definition at line 94 of file gnu-v3-abi.c.
Referenced by get_gdb_vtable_type().