GDB (xrefs)
|
#include "defs.h"
#include "value.h"
#include "cp-abi.h"
#include "cp-support.h"
#include "demangle.h"
#include "objfiles.h"
#include "valprint.h"
#include "c-lang.h"
#include "typeprint.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) |
Typedefs | |
typedef struct value_and_voffset * | value_and_voffset_p |
Enumerations | |
enum | { vtable_field_vcall_and_vbase_offsets, vtable_field_offset_to_top, vtable_field_type_info, vtable_field_virtual_functions } |
Functions | |
static int | gnuv3_is_vtable_name (const char *name) |
static int | gnuv3_is_operator_name (const char *name) |
static void * | build_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, int *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, int 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) |
DEF_VEC_P (value_and_voffset_p) | |
static hashval_t | hash_value_and_voffset (const void *p) |
static int | eq_value_and_voffset (const void *a, const void *b) |
static int | compare_value_and_voffset (const void *a, const void *b) |
static void | compute_vtable_size (htab_t offset_hash, VEC(value_and_voffset_p)**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 void * | 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 char * | 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 (struct frame_info *frame, CORE_ADDR stop_pc) |
static int | gnuv3_pass_by_reference (struct type *type) |
static void | init_gnuv3_ops (void) |
void | _initialize_gnu_v3_abi (void) |
Variables | |
static struct cp_abi_ops | gnu_v3_abi_ops |
static struct gdbarch_data * | std_type_info_gdbarch_data |
static struct gdbarch_data * | vtable_type_gdbarch_data |
initialize_file_ftype | _initialize_gnu_v3_abi |
#define TYPEINFO_PREFIX "typeinfo for " |
Referenced by gnuv3_get_typename_from_type_info().
#define TYPEINFO_PREFIX_LEN (sizeof (TYPEINFO_PREFIX) - 1) |
Referenced by gnuv3_get_typename_from_type_info().
typedef struct value_and_voffset* value_and_voffset_p |
Definition at line 774 of file gnu-v3-abi.c.
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 93 of file gnu-v3-abi.c.
void _initialize_gnu_v3_abi | ( | void | ) |
Definition at line 1406 of file gnu-v3-abi.c.
References gnu_v3_abi_ops, init_gnuv3_ops(), register_cp_abi(), set_cp_abi_as_auto_default(), and cp_abi_ops::shortname.
|
static |
Definition at line 107 of file gnu-v3-abi.c.
References arch_integer_type(), arch_type(), builtin_type::builtin_data_ptr, builtin_type::builtin_func_ptr, builtin_type(), FIELD_NAME, FIELD_TYPE, gdb_assert, gdbarch_ptr_bit(), INIT_CPLUS_SPECIFIC, lookup_array_range_type(), make_type_with_address_space(), offset, SET_FIELD_BITPOS, TARGET_CHAR_BIT, TYPE_CODE_STRUCT, TYPE_FIELDS, TYPE_INSTANCE_FLAG_CODE_SPACE, TYPE_LENGTH, TYPE_NFIELDS, TYPE_TAG_NAME, and xmalloc().
Referenced by init_gnuv3_ops().
|
static |
Definition at line 1016 of file gnu-v3-abi.c.
References arch_type(), builtin_type::builtin_char, builtin_type::builtin_data_ptr, builtin_type(), FIELD_NAME, FIELD_TYPE, gdb_assert, INIT_CPLUS_SPECIFIC, make_cv_type(), make_pointer_type(), offset, SET_FIELD_BITPOS, TARGET_CHAR_BIT, TYPE_CODE_STRUCT, TYPE_FIELDS, TYPE_LENGTH, TYPE_NFIELDS, TYPE_TAG_NAME, and xmalloc().
Referenced by init_gnuv3_ops().
Definition at line 802 of file gnu-v3-abi.c.
References value_address(), and value_embedded_offset().
Referenced by gnuv3_print_vtable().
|
static |
Definition at line 825 of file gnu-v3-abi.c.
References check_typedef(), gdb_assert, gnuv3_dynamic_class(), value_and_voffset::max_voffset, TYPE_CODE, TYPE_CODE_STRUCT, 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(), VEC_safe_push, and fn_field::voffset.
Referenced by gnuv3_print_vtable().
DEF_VEC_P | ( | value_and_voffset_p | ) |
Definition at line 790 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 444 of file gnu-v3-abi.c.
References _, BASETYPE_VIA_VIRTUAL, builtin_type::builtin_data_ptr, builtin_type(), error(), gdb_assert, get_type_arch(), gnuv3_get_vtable(), int, TYPE_BASECLASS_BITPOS, TYPE_CPLUS_REALLY_JAVA, TYPE_LENGTH, 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 540 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().
Definition at line 201 of file gnu-v3-abi.c.
References ALLOCATE_CPLUS_STRUCT_TYPE, BASETYPE_VIA_VIRTUAL, CHECK_TYPEDEF, gdb_assert, TYPE_CODE, TYPE_CODE_STRUCT, TYPE_CODE_UNION, TYPE_CPLUS_DYNAMIC, TYPE_FIELD_TYPE, 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_get_typeid(), gnuv3_get_vtable(), and gnuv3_pass_by_reference().
|
static |
Definition at line 490 of file gnu-v3-abi.c.
References BASETYPE_VIA_VIRTUAL, check_stub_method_group(), len, TYPE_BASECLASS_BITPOS, TYPE_FIELD_TYPE, TYPE_FN_FIELD_PHYSNAME, TYPE_FN_FIELD_VOFFSET, TYPE_FN_FIELDLIST1, TYPE_FN_FIELDLIST_LENGTH, TYPE_LENGTH, TYPE_N_BASECLASSES, and TYPE_NFN_FIELDS.
Referenced by gnuv3_print_method_ptr().
Definition at line 1194 of file gnu-v3-abi.c.
References do_cleanups(), evaluate_type(), gnuv3_get_typename_from_type_info(), make_cleanup(), parse_expression(), value_type(), and xfree().
Referenced by init_gnuv3_ops().
Definition at line 1078 of file gnu-v3-abi.c.
References _, value::address, BMSYMBOL_VALUE_ADDRESS, check_typedef(), coerce_ref(), cp_canonicalize_string(), do_cleanups(), error(), get_type_arch(), gnuv3_dynamic_class(), gnuv3_get_typeid_type(), gnuv3_get_vtable(), lookup_minimal_symbol(), lval_memory, make_cleanup(), make_cv_type(), make_pointer_type(), bound_minimal_symbol::minsym, type, TYPE_CODE, TYPE_CODE_REF, TYPE_CODE_STRUCT, TYPE_TARGET_TYPE, type_to_string(), value_address(), value_at_lazy(), value_cast(), value_embedded_offset(), value_field(), value_ind(), value_lval_const(), value_type(), vtable_field_type_info, and xfree().
Referenced by init_gnuv3_ops().
Definition at line 1061 of file gnu-v3-abi.c.
References gdbarch_data(), lookup_symbol(), STRUCT_DOMAIN, and SYMBOL_TYPE.
Referenced by gnuv3_get_typeid(), and init_gnuv3_ops().
|
static |
Definition at line 1160 of file gnu-v3-abi.c.
References _, error(), get_type_arch(), lookup_minimal_symbol_by_pc(), bound_minimal_symbol::minsym, MSYMBOL_DEMANGLED_NAME, MSYMBOL_LINKAGE_NAME, paddress(), savestring(), 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 379 of file gnu-v3-abi.c.
References gdb_assert, 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 247 of file gnu-v3-abi.c.
References CHECK_TYPEDEF, gdb_assert, gdbarch_data(), gnuv3_dynamic_class(), lookup_pointer_type(), TYPE_CODE, TYPE_CODE_STRUCT, 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().
Definition at line 46 of file gnu-v3-abi.c.
References startswith().
Referenced by init_gnuv3_ops().
Definition at line 40 of file gnu-v3-abi.c.
References startswith().
Referenced by init_gnuv3_ops().
|
static |
Definition at line 677 of file gnu-v3-abi.c.
References gdbarch::byte_order, gdbarch_byte_order(), gdbarch_vbit_in_delta(), get_type_arch(), size, store_unsigned_integer(), and TYPE_LENGTH.
Referenced by init_gnuv3_ops().
Definition at line 667 of file gnu-v3-abi.c.
References get_type_arch(), and TYPE_LENGTH.
Referenced by init_gnuv3_ops().
|
static |
Definition at line 708 of file gnu-v3-abi.c.
References check_typedef(), get_type_arch(), gnuv3_decode_method_ptr(), gnuv3_get_virtual_fn(), lookup_pointer_type(), TYPE_LENGTH, TYPE_SELF_TYPE, TYPE_TARGET_TYPE, value_cast(), value_contents(), value_from_pointer(), value_ind(), value_ptradd(), value_type(), and vtable_ptrdiff_type().
Referenced by init_gnuv3_ops().
Definition at line 1292 of file gnu-v3-abi.c.
References CHECK_TYPEDEF, check_typedef(), class_types_same_p(), field_is_static(), gnuv3_dynamic_class(), is_constructor_name(), name, TYPE_CODE, TYPE_CODE_REF, TYPE_CODE_STRUCT, TYPE_CODE_UNION, TYPE_FIELD, TYPE_FIELD_TYPE, TYPE_FN_FIELD_ARTIFICIAL, TYPE_FN_FIELD_CONSTRUCTOR, TYPE_FN_FIELD_PHYSNAME, TYPE_FN_FIELD_TYPE, TYPE_FN_FIELDLIST1, TYPE_FN_FIELDLIST_LENGTH, TYPE_FN_FIELDLIST_NAME, TYPE_NFIELDS, TYPE_NFN_FIELDS, and TYPE_TARGET_TYPE.
Referenced by init_gnuv3_ops().
|
static |
Definition at line 584 of file gnu-v3-abi.c.
References c_print_type(), demangle, fprintf_filtered(), fputs_filtered(), gdb_demangle(), get_type_arch(), get_user_print_options(), gnuv3_decode_method_ptr(), gnuv3_find_method_in(), print_address_demangle(), print_longest(), TYPE_LENGTH, type_print_raw_options, TYPE_SELF_TYPE, vtable_ptrdiff_type(), and xfree().
Referenced by init_gnuv3_ops().
|
static |
Definition at line 939 of file gnu-v3-abi.c.
References _, check_typedef(), coerce_ref(), compare_value_and_voffset(), compute_vtable_size(), do_cleanups(), eq_value_and_voffset(), get_type_arch(), get_user_print_options(), gnuv3_get_vtable(), hash_value_and_voffset(), make_cleanup(), make_cleanup_htab_delete(), value_and_voffset::max_voffset, value_print_options::objectprint, print_one_vtable(), printf_filtered(), qsort, type, TYPE_CODE, TYPE_CODE_PTR, TYPE_CODE_STRUCT, value_and_voffset::value, value_addr(), value_as_address(), value_full_object(), value_ind(), value_type(), VEC, VEC_address, VEC_cleanup, VEC_iterate, VEC_length, xcalloc(), and xfree().
Referenced by init_gnuv3_ops().
|
static |
Definition at line 287 of file gnu-v3-abi.c.
References _, check_typedef(), cp_lookup_rtti_type(), get_type_arch(), gnuv3_get_vtable(), lookup_minimal_symbol_by_pc(), bound_minimal_symbol::minsym, MSYMBOL_DEMANGLED_NAME, startswith(), TYPE_CODE, TYPE_CODE_STRUCT, TYPE_CPLUS_REALLY_JAVA, TYPE_LENGTH, TYPE_SAFE_NAME, value_addr(), value_address(), value_as_address(), value_as_long(), value_embedded_offset(), value_enclosing_type(), value_field(), value_type(), vtable_field_offset_to_top, and warning().
Referenced by init_gnuv3_ops().
|
static |
Definition at line 1224 of file gnu-v3-abi.c.
References BMSYMBOL_VALUE_ADDRESS, current_target, 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, MSYMBOL_DEMANGLED_NAME, obj_section::objfile, and stop_pc.
Referenced by init_gnuv3_ops().
|
static |
Definition at line 411 of file gnu-v3-abi.c.
References _, check_typedef(), error(), get_type_arch(), gnuv3_get_virtual_fn(), TYPE_CODE, TYPE_CODE_STRUCT, TYPE_FN_FIELD_TYPE, TYPE_FN_FIELD_VOFFSET, value_cast(), and value_type().
Referenced by init_gnuv3_ops().
|
static |
Definition at line 780 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 1370 of file gnu-v3-abi.c.
References cp_abi_ops::baseclass_offset, build_gdb_vtable_type(), build_std_type_info_type(), cp_abi_ops::doc, gdbarch_data_register_post_init(), 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.
Referenced by _initialize_gnu_v3_abi().
|
static |
Definition at line 882 of file gnu-v3-abi.c.
References _, CATCH, check_typedef(), END_CATCH, gdb_stdout, gdbarch_vtable_function_descriptors(), gnuv3_get_vtable(), paddress(), print_function_pointer_address(), printf_filtered(), RETURN_MASK_ERROR, TRY, 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().
Definition at line 188 of file gnu-v3-abi.c.
References gdbarch_data(), TARGET_CHAR_BIT, TYPE_FIELD_BITPOS, and vtable_field_virtual_functions.
Referenced by gnuv3_baseclass_offset(), and gnuv3_get_vtable().
Definition at line 176 of file gnu-v3-abi.c.
References gdbarch_data(), 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().
initialize_file_ftype _initialize_gnu_v3_abi |
|
static |
Definition at line 31 of file gnu-v3-abi.c.
Referenced by _initialize_gnu_v3_abi(), and init_gnuv3_ops().
|
static |
Definition at line 36 of file gnu-v3-abi.c.
|
static |
Definition at line 89 of file gnu-v3-abi.c.