GDB (xrefs)
Classes | Macros | Enumerations | Functions | Variables
/tmp/gdb-8.1/gdb/gnu-v3-abi.c File Reference
#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"
#include <algorithm>

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 }
 

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 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 void * build_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 (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_datastd_type_info_gdbarch_data
 
static struct gdbarch_datavtable_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 94 of file gnu-v3-abi.c.

Function Documentation

◆ _initialize_gnu_v3_abi()

void _initialize_gnu_v3_abi ( void  )

◆ build_gdb_vtable_type()

static void* build_gdb_vtable_type ( struct gdbarch arch)
static

◆ build_std_type_info_type()

static void* 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 796 of file gnu-v3-abi.c.

References value_and_voffset::value, value_address(), and value_embedded_offset().

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 784 of file gnu-v3-abi.c.

References value_and_voffset::value, value_address(), and value_embedded_offset().

Referenced by gnuv3_print_vtable().

◆ 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

◆ 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 47 of file gnu-v3-abi.c.

References CP_OPERATOR_STR, name, and startswith().

Referenced by init_gnuv3_ops().

◆ gnuv3_is_vtable_name()

static int gnuv3_is_vtable_name ( const char *  name)
static

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

References name, and startswith().

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 664 of file gnu-v3-abi.c.

References get_type_arch(), 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 int 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 ( struct frame_info 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 774 of file gnu-v3-abi.c.

References value_and_voffset::value, value_address(), and value_embedded_offset().

Referenced by gnuv3_print_vtable().

◆ init_gnuv3_ops()

static void init_gnuv3_ops ( void  )
static

◆ 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 32 of file gnu-v3-abi.c.

Referenced by _initialize_gnu_v3_abi(), and init_gnuv3_ops().

◆ std_type_info_gdbarch_data

struct gdbarch_data* std_type_info_gdbarch_data
static

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

Referenced by gnuv3_get_typeid_type(), and init_gnuv3_ops().

◆ vtable_type_gdbarch_data

struct gdbarch_data* vtable_type_gdbarch_data
static