GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Macros | Enumerations | Functions | Variables
gnu-v3-abi.c File Reference
#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 typeget_gdb_vtable_type (struct gdbarch *arch)
 
static struct typevtable_ptrdiff_type (struct gdbarch *gdbarch)
 
static int vtable_address_point_offset (struct gdbarch *gdbarch)
 
static int gnuv3_dynamic_class (struct type *type)
 
static struct valuegnuv3_get_vtable (struct gdbarch *gdbarch, struct type *container_type, CORE_ADDR container_addr)
 
static struct typegnuv3_rtti_type (struct value *value, int *full_p, LONGEST *top_p, int *using_enc_p)
 
static struct valuegnuv3_get_virtual_fn (struct gdbarch *gdbarch, struct value *container, struct type *fntype, int vtable_index)
 
static struct valuegnuv3_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 valuegnuv3_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 typebuild_std_type_info_type (struct gdbarch *arch)
 
static struct typegnuv3_get_typeid_type (struct gdbarch *gdbarch)
 
static struct valuegnuv3_get_typeid (struct value *value)
 
static std::string gnuv3_get_typename_from_type_info (struct value *type_info_ptr)
 
static struct typegnuv3_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 typestd_type_info_gdbarch_data
 
static const registry< gdbarch >::key< struct typevtable_type_gdbarch_data
 

Macro Definition Documentation

◆ TYPEINFO_PREFIX

#define TYPEINFO_PREFIX   "typeinfo for "

◆ TYPEINFO_PREFIX_LEN

#define TYPEINFO_PREFIX_LEN   (sizeof (TYPEINFO_PREFIX) - 1)

Enumeration Type Documentation

◆ anonymous enum

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.

◆ definition_style

Enumerator
DOES_NOT_EXIST_IN_SOURCE 
DEFAULTED_INSIDE 
DEFAULTED_OUTSIDE 
DELETED 
EXPLICIT 

Definition at line 1279 of file gnu-v3-abi.c.

Function Documentation

◆ _initialize_gnu_v3_abi()

void _initialize_gnu_v3_abi ( )

Definition at line 1610 of file gnu-v3-abi.c.

Referenced by initialize_all_files().

◆ build_std_type_info_type()

static struct type * build_std_type_info_type ( struct gdbarch * arch)
static

◆ compare_value_and_voffset()

static bool compare_value_and_voffset ( const struct value_and_voffset * va,
const struct value_and_voffset * vb )
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().

◆ compute_vtable_size()

static void compute_vtable_size ( htab_t offset_hash,
std::vector< value_and_voffset * > * offset_vec,
struct value * value )
static

◆ eq_value_and_voffset()

static int eq_value_and_voffset ( const void * a,
const void * b )
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().

◆ get_def_style()

static definition_style get_def_style ( struct fn_field * fn,
int fieldelem )
static

◆ get_gdb_vtable_type()

static struct type * get_gdb_vtable_type ( struct gdbarch * arch)
static

◆ gnuv3_baseclass_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

◆ gnuv3_decode_method_ptr()

static int gnuv3_decode_method_ptr ( struct gdbarch * gdbarch,
const gdb_byte * contents,
CORE_ADDR * value_p,
LONGEST * adjustment_p )
static

◆ gnuv3_dynamic_class()

static int gnuv3_dynamic_class ( struct type * type)
static

◆ gnuv3_find_method_in()

static const char * gnuv3_find_method_in ( struct type * domain,
CORE_ADDR voffset,
LONGEST adjustment )
static

◆ gnuv3_get_type_from_type_info()

static struct type * gnuv3_get_type_from_type_info ( struct value * type_info_ptr)
static

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

◆ gnuv3_get_typeid()

static struct value * gnuv3_get_typeid ( struct value * value)
static

◆ gnuv3_get_typeid_type()

static struct type * gnuv3_get_typeid_type ( struct gdbarch * gdbarch)
static

◆ gnuv3_get_typename_from_type_info()

static std::string gnuv3_get_typename_from_type_info ( struct value * type_info_ptr)
static

◆ gnuv3_get_virtual_fn()

static struct value * gnuv3_get_virtual_fn ( struct gdbarch * gdbarch,
struct value * container,
struct type * fntype,
int vtable_index )
static

◆ gnuv3_get_vtable()

static struct value * gnuv3_get_vtable ( struct gdbarch * gdbarch,
struct type * container_type,
CORE_ADDR container_addr )
static

◆ gnuv3_is_operator_name()

static int gnuv3_is_operator_name ( const char * name)
static

Definition at line 52 of file gnu-v3-abi.c.

References CP_OPERATOR_STR, and name.

Referenced by init_gnuv3_ops().

◆ gnuv3_is_vtable_name()

static int gnuv3_is_vtable_name ( const char * name)
static

Definition at line 46 of file gnu-v3-abi.c.

References name.

Referenced by init_gnuv3_ops().

◆ gnuv3_make_method_ptr()

static void gnuv3_make_method_ptr ( struct type * type,
gdb_byte * contents,
CORE_ADDR value,
int is_virtual )
static

◆ gnuv3_method_ptr_size()

static int gnuv3_method_ptr_size ( struct type * type)
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().

◆ gnuv3_method_ptr_to_value()

static struct value * gnuv3_method_ptr_to_value ( struct value ** this_p,
struct value * method_ptr )
static

◆ gnuv3_pass_by_reference()

static struct language_pass_by_ref_info gnuv3_pass_by_reference ( struct type * type)
static

◆ gnuv3_print_method_ptr()

static void gnuv3_print_method_ptr ( const gdb_byte * contents,
struct type * type,
struct ui_file * stream )
static

◆ gnuv3_print_vtable()

static void gnuv3_print_vtable ( struct value * value)
static

◆ gnuv3_rtti_type()

static struct type * gnuv3_rtti_type ( struct value * value,
int * full_p,
LONGEST * top_p,
int * using_enc_p )
static

◆ gnuv3_skip_trampoline()

static CORE_ADDR gnuv3_skip_trampoline ( frame_info_ptr frame,
CORE_ADDR stop_pc )
static

◆ gnuv3_virtual_fn_field()

static struct value * gnuv3_virtual_fn_field ( struct value ** value_p,
struct fn_field * f,
int j,
struct type * vfn_base,
int offset )
static

◆ hash_value_and_voffset()

static hashval_t hash_value_and_voffset ( const void * p)
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().

◆ init_gnuv3_ops()

static void init_gnuv3_ops ( void )
static

◆ is_copy_constructor_type()

static bool is_copy_constructor_type ( struct type * class_type,
struct type * method_type )
static

Definition at line 1381 of file gnu-v3-abi.c.

References is_copy_or_move_constructor_type().

Referenced by gnuv3_pass_by_reference().

◆ is_copy_or_move_constructor_type()

static bool is_copy_or_move_constructor_type ( struct type * class_type,
struct type * method_type,
type_code expected )
static

◆ is_implicit_def()

static bool is_implicit_def ( definition_style def)
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().

◆ is_move_constructor_type()

static bool is_move_constructor_type ( struct type * class_type,
struct type * method_type )
static

Definition at line 1391 of file gnu-v3-abi.c.

References is_copy_or_move_constructor_type().

Referenced by gnuv3_pass_by_reference().

◆ is_user_provided_def()

static bool is_user_provided_def ( definition_style def)
static

Definition at line 1320 of file gnu-v3-abi.c.

References DEFAULTED_OUTSIDE, and EXPLICIT.

Referenced by gnuv3_pass_by_reference().

◆ print_one_vtable()

static void print_one_vtable ( struct gdbarch * gdbarch,
struct value * value,
int max_voffset,
struct value_print_options * opts )
static

◆ vtable_address_point_offset()

static int vtable_address_point_offset ( struct gdbarch * gdbarch)
static

◆ vtable_ptrdiff_type()

static struct type * vtable_ptrdiff_type ( struct gdbarch * gdbarch)
static

Variable Documentation

◆ gnu_v3_abi_ops

struct cp_abi_ops gnu_v3_abi_ops
static

Definition at line 37 of file gnu-v3-abi.c.

Referenced by init_gnuv3_ops().

◆ std_type_info_gdbarch_data

const registry<gdbarch>::key<struct type> std_type_info_gdbarch_data
static

Definition at line 42 of file gnu-v3-abi.c.

Referenced by gnuv3_get_typeid_type().

◆ vtable_type_gdbarch_data

const registry<gdbarch>::key<struct type> vtable_type_gdbarch_data
static

Definition at line 95 of file gnu-v3-abi.c.

Referenced by get_gdb_vtable_type().