GDB (xrefs)
|
#include "defs.h"
#include "language.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 99 of file gnu-v3-abi.c.
enum definition_style |
Enumerator | |
---|---|
DOES_NOT_EXIST_IN_SOURCE | |
DEFAULTED_INSIDE | |
DEFAULTED_OUTSIDE | |
DELETED | |
EXPLICIT |
Definition at line 1279 of file gnu-v3-abi.c.
void _initialize_gnu_v3_abi | ( | ) |
Definition at line 1610 of file gnu-v3-abi.c.
Referenced by initialize_all_files().
Definition at line 1031 of file gnu-v3-abi.c.
References type::alloc_fields(), type::arch(), builtin_type::builtin_char, builtin_type::builtin_data_ptr, builtin_type(), type::field(), INIT_CPLUS_SPECIFIC, type::length(), make_cv_type(), make_pointer_type(), type_allocator::new_type(), type::set_length(), field::set_loc_bitpos(), field::set_name(), type::set_name(), field::set_type(), and field::type().
Referenced by gnuv3_get_typeid_type().
|
static |
Definition at line 832 of file gnu-v3-abi.c.
References value::address, value::embedded_offset(), and value_and_voffset::value.
Referenced by gnuv3_print_vtable().
|
static |
Definition at line 850 of file gnu-v3-abi.c.
References check_typedef(), type::code(), compute_vtable_size(), gnuv3_dynamic_class(), value_and_voffset::max_voffset, value::type(), 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, value_field(), and fn_field::voffset.
Referenced by compute_vtable_size(), and gnuv3_print_vtable().
|
static |
Definition at line 820 of file gnu-v3-abi.c.
References value::address, value::embedded_offset(), and value_and_voffset::value.
Referenced by gnuv3_print_vtable().
|
static |
Definition at line 1291 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 113 of file gnu-v3-abi.c.
References type::alloc_fields(), type::arch(), builtin_type::builtin_data_ptr, builtin_type::builtin_func_ptr, builtin_type(), type::field(), gdbarch_ptr_bit(), registry< T >::get(), INIT_CPLUS_SPECIFIC, init_integer_type(), type::length(), lookup_array_range_type(), make_type_with_address_space(), type_allocator::new_type(), registry< T >::set(), type::set_length(), field::set_loc_bitpos(), field::set_name(), type::set_name(), 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 458 of file gnu-v3-abi.c.
References property_addr_info::addr, type::arch(), BASETYPE_VIA_VIRTUAL, dynamic_prop::baton(), builtin_type::builtin_data_ptr, builtin_type(), 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, 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 577 of file gnu-v3-abi.c.
References builtin_type::builtin_func_ptr, builtin_type(), 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 219 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 527 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 1212 of file gnu-v3-abi.c.
References gnuv3_get_typename_from_type_info(), parse_expression(), and value::type().
Referenced by init_gnuv3_ops().
Definition at line 1102 of file gnu-v3-abi.c.
References value::address, type::arch(), check_typedef(), type::code(), coerce_ref(), cp_canonicalize_string(), value::embedded_offset(), gnuv3_dynamic_class(), gnuv3_get_typeid_type(), gnuv3_get_vtable(), lookup_minimal_symbol(), value::lval(), lval_memory, make_cv_type(), make_pointer_type(), bound_minimal_symbol::minsym, name, type::target_type(), type, value::type(), type_to_string(), bound_minimal_symbol::value_address(), value_at_lazy(), value_cast(), value_field(), value_ind(), and vtable_field_type_info.
Referenced by init_gnuv3_ops().
Definition at line 1077 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 1178 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(), value::type(), TYPEINFO_PREFIX, TYPEINFO_PREFIX_LEN, and value_as_address().
Referenced by gnuv3_get_type_from_type_info(), and init_gnuv3_ops().
|
static |
Definition at line 393 of file gnu-v3-abi.c.
References gdbarch_vtable_function_descriptors(), gnuv3_get_vtable(), lookup_pointer_type(), value::type(), value_addr(), value_as_address(), value_cast(), value_field(), value_subscript(), and vtable_field_virtual_functions.
Referenced by gnuv3_method_ptr_to_value(), and gnuv3_virtual_fn_field().
|
static |
Definition at line 265 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 52 of file gnu-v3-abi.c.
References CP_OPERATOR_STR, and name.
Referenced by init_gnuv3_ops().
|
static |
|
static |
Definition at line 710 of file gnu-v3-abi.c.
References type::arch(), builtin_type::builtin_data_ptr, builtin_type(), gdbarch_vbit_in_delta(), type::length(), size, store_unsigned_integer(), and type_byte_order().
Referenced by init_gnuv3_ops().
|
static |
Definition at line 702 of file gnu-v3-abi.c.
References type::arch(), builtin_type::builtin_data_ptr, builtin_type(), and type::length().
Referenced by init_gnuv3_ops().
|
static |
Definition at line 741 of file gnu-v3-abi.c.
References type::arch(), check_typedef(), value::contents(), gnuv3_decode_method_ptr(), gnuv3_get_virtual_fn(), type::length(), lookup_pointer_type(), type::target_type(), value::type(), TYPE_SELF_TYPE, value_cast(), value_from_pointer(), value_ind(), value_ptradd(), and vtable_ptrdiff_type().
Referenced by init_gnuv3_ops().
|
static |
Definition at line 1417 of file gnu-v3-abi.c.
References check_typedef(), type::code(), DELETED, DOES_NOT_EXIST_IN_SOURCE, type::field(), get_def_style(), gnuv3_dynamic_class(), gnuv3_pass_by_reference(), is_constructor_name(), is_copy_constructor_type(), is_implicit_def(), is_move_constructor_type(), field::is_static(), 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 621 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 964 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(), type, value::type(), value_addr(), value_as_address(), value_full_object(), value_ind(), xcalloc(), and xfree().
Referenced by init_gnuv3_ops().
|
static |
Definition at line 304 of file gnu-v3-abi.c.
References value::address, type::arch(), check_typedef(), type::code(), cp_lookup_rtti_type(), general_symbol_info::demangled_name, value::embedded_offset(), value::enclosing_type(), gnuv3_dynamic_class(), gnuv3_get_vtable(), type::length(), lookup_minimal_symbol_by_pc(), bound_minimal_symbol::minsym, value::type(), TYPE_SAFE_NAME, value_addr(), value_as_address(), value_as_long(), value_field(), and vtable_field_offset_to_top.
Referenced by init_gnuv3_ops().
|
static |
Definition at line 1228 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 425 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, and value_cast().
Referenced by init_gnuv3_ops().
|
static |
Definition at line 810 of file gnu-v3-abi.c.
References value::address, value::embedded_offset(), and value_and_voffset::value.
Referenced by gnuv3_print_vtable().
|
static |
Definition at line 1580 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 1381 of file gnu-v3-abi.c.
References is_copy_or_move_constructor_type().
Referenced by gnuv3_pass_by_reference().
|
static |
Definition at line 1339 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 1326 of file gnu-v3-abi.c.
References DEFAULTED_INSIDE, and DOES_NOT_EXIST_IN_SOURCE.
Referenced by gnuv3_pass_by_reference().
Definition at line 1391 of file gnu-v3-abi.c.
References is_copy_or_move_constructor_type().
Referenced by gnuv3_pass_by_reference().
|
static |
Definition at line 1320 of file gnu-v3-abi.c.
References DEFAULTED_OUTSIDE, and EXPLICIT.
Referenced by gnuv3_pass_by_reference().
|
static |
Definition at line 907 of file gnu-v3-abi.c.
References value::address, check_typedef(), value::embedded_offset(), fprintf_styled(), gdb_printf(), gdb_stdout, gdbarch_vtable_function_descriptors(), gnuv3_get_vtable(), metadata_style, paddress(), print_function_pointer_address(), cli_style_option::style(), value::type(), TYPE_SAFE_NAME, value_addr(), value_as_address(), value_field(), value_subscript(), and vtable_field_virtual_functions.
Referenced by gnuv3_print_vtable().
|
static |
Definition at line 206 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 194 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 37 of file gnu-v3-abi.c.
Referenced by init_gnuv3_ops().
Definition at line 42 of file gnu-v3-abi.c.
Referenced by gnuv3_get_typeid_type().
Definition at line 95 of file gnu-v3-abi.c.
Referenced by get_gdb_vtable_type().