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 "exceptions.h"
#include "typeprint.h"
#include "gdb_assert.h"
#include "gdb_string.h"
Go to the source code of this file.
#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 768 of file gnu-v3-abi.c.
anonymous enum |
vtable_field_vcall_and_vbase_offsets | |
vtable_field_offset_to_top | |
vtable_field_type_info | |
vtable_field_virtual_functions |
Definition at line 97 of file gnu-v3-abi.c.
void _initialize_gnu_v3_abi | ( | void | ) |
Definition at line 1378 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 void* build_gdb_vtable_type | ( | struct gdbarch * | arch | ) | [static] |
Definition at line 111 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(), memset(), offset, SET_FIELD_BITPOS, TYPE_CODE_STRUCT, TYPE_FIELDS, TYPE_LENGTH, TYPE_NFIELDS, TYPE_TAG_NAME, and xmalloc().
Referenced by init_gnuv3_ops().
static void* build_std_type_info_type | ( | struct gdbarch * | arch | ) | [static] |
Definition at line 1000 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(), memset(), offset, SET_FIELD_BITPOS, TYPE_CODE_STRUCT, TYPE_FIELDS, TYPE_LENGTH, TYPE_NFIELDS, TYPE_TAG_NAME, and xmalloc().
Referenced by init_gnuv3_ops().
static int compare_value_and_voffset | ( | const void * | a, |
const void * | b | ||
) | [static] |
Definition at line 796 of file gnu-v3-abi.c.
References value_address(), and value_embedded_offset().
Referenced by gnuv3_print_vtable().
static void compute_vtable_size | ( | htab_t | offset_hash, |
VEC(value_and_voffset_p)** | offset_vec, | ||
struct value * | value | ||
) | [static] |
Definition at line 819 of file gnu-v3-abi.c.
References check_typedef(), 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 VEC_safe_push.
Referenced by gnuv3_print_vtable().
static int eq_value_and_voffset | ( | const void * | a, |
const void * | b | ||
) | [static] |
Definition at line 784 of file gnu-v3-abi.c.
References value_and_voffset::value, value_address(), and value_embedded_offset().
Referenced by gnuv3_print_vtable().
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] |
Definition at line 438 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 int gnuv3_decode_method_ptr | ( | struct gdbarch * | gdbarch, |
const gdb_byte * | contents, | ||
CORE_ADDR * | value_p, | ||
LONGEST * | adjustment_p | ||
) | [static] |
Definition at line 534 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(), LONGEST, TYPE_LENGTH, and vtable_ptrdiff_type().
Referenced by gnuv3_method_ptr_to_value(), and gnuv3_print_method_ptr().
static int gnuv3_dynamic_class | ( | struct type * | type | ) | [static] |
Definition at line 205 of file gnu-v3-abi.c.
References ALLOCATE_CPLUS_STRUCT_TYPE, BASETYPE_VIA_VIRTUAL, 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(), and gnuv3_get_vtable().
static const char* gnuv3_find_method_in | ( | struct type * | domain, |
CORE_ADDR | voffset, | ||
LONGEST | adjustment | ||
) | [static] |
Definition at line 484 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().
static struct type* gnuv3_get_type_from_type_info | ( | struct value * | type_info_ptr | ) | [static, read] |
Definition at line 1178 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().
static struct value* gnuv3_get_typeid | ( | struct value * | value | ) | [static, read] |
Definition at line 1062 of file gnu-v3-abi.c.
References _, 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(), SYMBOL_VALUE_ADDRESS, type, TYPE_CODE, TYPE_CODE_CLASS, TYPE_CODE_REF, 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().
static struct type* gnuv3_get_typeid_type | ( | struct gdbarch * | gdbarch | ) | [static, read] |
Definition at line 1045 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 char* gnuv3_get_typename_from_type_info | ( | struct value * | type_info_ptr | ) | [static] |
Definition at line 1144 of file gnu-v3-abi.c.
References _, error(), get_type_arch(), lookup_minimal_symbol_by_pc(), bound_minimal_symbol::minsym, paddress(), savestring(), strchr(), SYMBOL_DEMANGLED_NAME, SYMBOL_LINKAGE_NAME, TYPEINFO_PREFIX, TYPEINFO_PREFIX_LEN, value_as_address(), and value_type().
Referenced by gnuv3_get_type_from_type_info(), and init_gnuv3_ops().
static struct value* gnuv3_get_virtual_fn | ( | struct gdbarch * | gdbarch, |
struct value * | container, | ||
struct type * | fntype, | ||
int | vtable_index | ||
) | [static, read] |
Definition at line 373 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 struct value* gnuv3_get_vtable | ( | struct gdbarch * | gdbarch, |
struct type * | container_type, | ||
CORE_ADDR | container_addr | ||
) | [static, read] |
Definition at line 244 of file gnu-v3-abi.c.
References check_typedef(), gdbarch_data(), 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 int gnuv3_is_operator_name | ( | const char * | name | ) | [static] |
Definition at line 50 of file gnu-v3-abi.c.
Referenced by init_gnuv3_ops().
static int gnuv3_is_vtable_name | ( | const char * | name | ) | [static] |
Definition at line 44 of file gnu-v3-abi.c.
Referenced by init_gnuv3_ops().
static void gnuv3_make_method_ptr | ( | struct type * | type, |
gdb_byte * | contents, | ||
CORE_ADDR | value, | ||
int | is_virtual | ||
) | [static] |
Definition at line 671 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().
static int gnuv3_method_ptr_size | ( | struct type * | type | ) | [static] |
Definition at line 661 of file gnu-v3-abi.c.
References get_type_arch(), and TYPE_LENGTH.
Referenced by init_gnuv3_ops().
static struct value* gnuv3_method_ptr_to_value | ( | struct value ** | this_p, |
struct value * | method_ptr | ||
) | [static, read] |
Definition at line 702 of file gnu-v3-abi.c.
References check_typedef(), get_type_arch(), gnuv3_decode_method_ptr(), gnuv3_get_virtual_fn(), LONGEST, lookup_pointer_type(), TYPE_DOMAIN_TYPE, TYPE_LENGTH, 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().
static int gnuv3_pass_by_reference | ( | struct type * | type | ) | [static] |
Definition at line 1276 of file gnu-v3-abi.c.
References check_typedef(), CHECK_TYPEDEF, field_is_static(), is_constructor_name(), name, TYPE_CODE, TYPE_CODE_CLASS, 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 void gnuv3_print_method_ptr | ( | const gdb_byte * | contents, |
struct type * | type, | ||
struct ui_file * | stream | ||
) | [static] |
Definition at line 578 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(), LONGEST, print_address_demangle(), print_longest(), TYPE_DOMAIN_TYPE, TYPE_LENGTH, type_print_raw_options, vtable_ptrdiff_type(), and xfree().
Referenced by init_gnuv3_ops().
static void gnuv3_print_vtable | ( | struct value * | value | ) | [static] |
Definition at line 926 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, 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 struct type* gnuv3_rtti_type | ( | struct value * | value, |
int * | full_p, | ||
int * | top_p, | ||
int * | using_enc_p | ||
) | [static, read] |
Definition at line 281 of file gnu-v3-abi.c.
References _, check_typedef(), cp_lookup_rtti_type(), get_type_arch(), gnuv3_get_vtable(), LONGEST, lookup_minimal_symbol_by_pc(), memcpy(), bound_minimal_symbol::minsym, strchr(), SYMBOL_DEMANGLED_NAME, TYPE_CODE, TYPE_CODE_CLASS, 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 CORE_ADDR gnuv3_skip_trampoline | ( | struct frame_info * | frame, |
CORE_ADDR | stop_pc | ||
) | [static] |
Definition at line 1208 of file gnu-v3-abi.c.
References 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, obj_section::objfile, stop_pc, strstr(), SYMBOL_DEMANGLED_NAME, and SYMBOL_VALUE_ADDRESS.
Referenced by init_gnuv3_ops().
static struct value* gnuv3_virtual_fn_field | ( | struct value ** | value_p, |
struct fn_field * | f, | ||
int | j, | ||
struct type * | vfn_base, | ||
int | offset | ||
) | [static, read] |
Definition at line 405 of file gnu-v3-abi.c.
References _, check_typedef(), error(), get_type_arch(), gnuv3_get_virtual_fn(), TYPE_CODE, TYPE_CODE_CLASS, TYPE_FN_FIELD_TYPE, TYPE_FN_FIELD_VOFFSET, value_cast(), and value_type().
Referenced by init_gnuv3_ops().
static hashval_t hash_value_and_voffset | ( | const void * | p | ) | [static] |
Definition at line 774 of file gnu-v3-abi.c.
References value_and_voffset::value, value_address(), and value_embedded_offset().
Referenced by gnuv3_print_vtable().
static void init_gnuv3_ops | ( | void | ) | [static] |
Definition at line 1342 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 void print_one_vtable | ( | struct gdbarch * | gdbarch, |
struct value * | value, | ||
int | max_voffset, | ||
struct value_print_options * | opts | ||
) | [static] |
Definition at line 874 of file gnu-v3-abi.c.
References _, check_typedef(), gdb_stdout, gdbarch_vtable_function_descriptors(), gnuv3_get_vtable(), gdb_exception::message, paddress(), print_function_pointer_address(), printf_filtered(), gdb_exception::reason, RETURN_MASK_ERROR, TRY_CATCH, 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 int vtable_address_point_offset | ( | struct gdbarch * | gdbarch | ) | [static] |
Definition at line 192 of file gnu-v3-abi.c.
References gdbarch_data(), TYPE_FIELD_BITPOS, and vtable_field_virtual_functions.
Referenced by gnuv3_baseclass_offset(), and gnuv3_get_vtable().
static struct type* vtable_ptrdiff_type | ( | struct gdbarch * | gdbarch | ) | [static, read] |
Definition at line 180 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().
Referenced by initialize_all_files().
struct cp_abi_ops gnu_v3_abi_ops [static] |
Definition at line 35 of file gnu-v3-abi.c.
Referenced by _initialize_gnu_v3_abi(), and init_gnuv3_ops().
struct gdbarch_data* std_type_info_gdbarch_data [static] |
Definition at line 40 of file gnu-v3-abi.c.
struct gdbarch_data* vtable_type_gdbarch_data [static] |
Definition at line 93 of file gnu-v3-abi.c.