GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Macros | Enumerations | Functions | Variables
/tmp/gdb-13.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 "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 98 of file gnu-v3-abi.c.

◆ definition_style

Enumerator
DOES_NOT_EXIST_IN_SOURCE 
DEFAULTED_INSIDE 
DEFAULTED_OUTSIDE 
DELETED 
EXPLICIT 

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

Function Documentation

◆ _initialize_gnu_v3_abi()

void _initialize_gnu_v3_abi ( )

Definition at line 1600 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 824 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 812 of file gnu-v3-abi.c.

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

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

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

References type::arch(), builtin_type::builtin_data_ptr, 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 802 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

◆ is_copy_constructor_type()

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

Definition at line 1371 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 1316 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 1381 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 1310 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 36 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 41 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 94 of file gnu-v3-abi.c.

Referenced by get_gdb_vtable_type().