GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Macros | Functions | Variables
scm-type.c File Reference
#include "defs.h"
#include "arch-utils.h"
#include "value.h"
#include "gdbtypes.h"
#include "objfiles.h"
#include "language.h"
#include "bcache.h"
#include "dwarf2/loc.h"
#include "typeprint.h"
#include "guile-internal.h"
#include "type-codes.def"

Go to the source code of this file.

Classes

struct  type_smob
 
struct  field_smob
 
struct  tyscm_deleter
 

Macros

#define OP(SYM)   { #SYM, SYM },
 

Functions

static int tyscm_copy_type_recursive (void **slot, void *info)
 
static struct typetyscm_get_composite (struct type *type)
 
struct typetyscm_type_smob_type (type_smob *t_smob)
 
static std::string tyscm_type_name (struct type *type)
 
static hashval_t tyscm_hash_type_smob (const void *p)
 
static int tyscm_eq_type_smob (const void *ap, const void *bp)
 
static htab_t tyscm_type_map (struct type *type)
 
static size_t tyscm_free_type_smob (SCM self)
 
static int tyscm_print_type_smob (SCM self, SCM port, scm_print_state *pstate)
 
static SCM tyscm_equal_p_type_smob (SCM type1_scm, SCM type2_scm)
 
static SCM tyscm_make_type_smob (void)
 
int tyscm_is_type (SCM self)
 
static SCM gdbscm_type_p (SCM self)
 
SCM tyscm_scm_from_type (struct type *type)
 
static SCM tyscm_get_type_arg_unsafe (SCM self, int arg_pos, const char *func_name)
 
type_smobtyscm_get_type_smob_arg_unsafe (SCM self, int arg_pos, const char *func_name)
 
struct typetyscm_scm_to_type (SCM t_scm)
 
static int tyscm_print_field_smob (SCM self, SCM port, scm_print_state *pstate)
 
static SCM tyscm_make_field_smob (SCM type_scm, int field_num)
 
static int tyscm_is_field (SCM self)
 
static SCM gdbscm_field_p (SCM self)
 
SCM tyscm_scm_from_field (SCM type_scm, int field_num)
 
static SCM tyscm_get_field_arg_unsafe (SCM self, int arg_pos, const char *func_name)
 
static field_smobtyscm_get_field_smob_arg_unsafe (SCM self, int arg_pos, const char *func_name)
 
static struct typetyscm_field_smob_containing_type (field_smob *f_smob)
 
static struct fieldtyscm_field_smob_to_field (field_smob *f_smob)
 
static SCM gdbscm_type_code (SCM self)
 
static SCM gdbscm_type_fields (SCM self)
 
static SCM gdbscm_type_tag (SCM self)
 
static SCM gdbscm_type_name (SCM self)
 
static SCM gdbscm_type_print_name (SCM self)
 
static SCM gdbscm_type_sizeof (SCM self)
 
static SCM gdbscm_type_strip_typedefs (SCM self)
 
static SCM tyscm_array_1 (SCM self, SCM n1_scm, SCM n2_scm, int is_vector, const char *func_name)
 
static SCM gdbscm_type_array (SCM self, SCM n1, SCM n2)
 
static SCM gdbscm_type_vector (SCM self, SCM n1, SCM n2)
 
static SCM gdbscm_type_pointer (SCM self)
 
static SCM gdbscm_type_range (SCM self)
 
static SCM gdbscm_type_reference (SCM self)
 
static SCM gdbscm_type_target (SCM self)
 
static SCM gdbscm_type_const (SCM self)
 
static SCM gdbscm_type_volatile (SCM self)
 
static SCM gdbscm_type_unqualified (SCM self)
 
static SCM gdbscm_type_num_fields (SCM self)
 
static SCM gdbscm_type_field (SCM self, SCM field_scm)
 
static SCM gdbscm_type_has_field_p (SCM self, SCM field_scm)
 
static SCM gdbscm_make_field_iterator (SCM self)
 
static SCM gdbscm_type_next_field_x (SCM self)
 
static SCM gdbscm_field_name (SCM self)
 
static SCM gdbscm_field_type (SCM self)
 
static SCM gdbscm_field_enumval (SCM self)
 
static SCM gdbscm_field_bitpos (SCM self)
 
static SCM gdbscm_field_bitsize (SCM self)
 
static SCM gdbscm_field_artificial_p (SCM self)
 
static SCM gdbscm_field_baseclass_p (SCM self)
 
static struct typetyscm_lookup_typename (const char *type_name, const struct block *block)
 
static SCM gdbscm_lookup_type (SCM name_scm, SCM rest)
 
void gdbscm_initialize_types (void)
 

Variables

static const char type_smob_name [] = "gdb:type"
 
static const char field_smob_name [] = "gdb:field"
 
static const char not_composite_error []
 
static scm_t_bits type_smob_tag
 
static scm_t_bits field_smob_tag
 
static SCM tyscm_next_field_x_proc
 
static SCM block_keyword
 
static const registry< objfile >::key< htab, tyscm_deletertyscm_objfile_data_key
 
static htab_t global_types_map
 
static const scheme_integer_constant type_integer_constants []
 
static const scheme_function type_functions []
 

Macro Definition Documentation

◆ OP

#define OP (   SYM)    { #SYM, SYM },

Function Documentation

◆ gdbscm_field_artificial_p()

static SCM gdbscm_field_artificial_p ( SCM  self)
static

◆ gdbscm_field_baseclass_p()

static SCM gdbscm_field_baseclass_p ( SCM  self)
static

◆ gdbscm_field_bitpos()

static SCM gdbscm_field_bitpos ( SCM  self)
static

◆ gdbscm_field_bitsize()

static SCM gdbscm_field_bitsize ( SCM  self)
static

◆ gdbscm_field_enumval()

static SCM gdbscm_field_enumval ( SCM  self)
static

◆ gdbscm_field_name()

static SCM gdbscm_field_name ( SCM  self)
static

◆ gdbscm_field_p()

static SCM gdbscm_field_p ( SCM  self)
static

Definition at line 450 of file scm-type.c.

References tyscm_is_field().

◆ gdbscm_field_type()

static SCM gdbscm_field_type ( SCM  self)
static

◆ gdbscm_initialize_types()

void gdbscm_initialize_types ( void  )

◆ gdbscm_lookup_type()

static SCM gdbscm_lookup_type ( SCM  name_scm,
SCM  rest 
)
static

◆ gdbscm_make_field_iterator()

static SCM gdbscm_make_field_iterator ( SCM  self)
static

◆ gdbscm_type_array()

static SCM gdbscm_type_array ( SCM  self,
SCM  n1,
SCM  n2 
)
static

Definition at line 755 of file scm-type.c.

References FUNC_NAME, n1, n2, and tyscm_array_1().

◆ gdbscm_type_code()

static SCM gdbscm_type_code ( SCM  self)
static

Definition at line 521 of file scm-type.c.

References type::code(), FUNC_NAME, type_smob::type, and tyscm_get_type_smob_arg_unsafe().

◆ gdbscm_type_const()

static SCM gdbscm_type_const ( SCM  self)
static

◆ gdbscm_type_field()

static SCM gdbscm_type_field ( SCM  self,
SCM  field_scm 
)
static

◆ gdbscm_type_fields()

static SCM gdbscm_type_fields ( SCM  self)
static

◆ gdbscm_type_has_field_p()

static SCM gdbscm_type_has_field_p ( SCM  self,
SCM  field_scm 
)
static

◆ gdbscm_type_name()

static SCM gdbscm_type_name ( SCM  self)
static

◆ gdbscm_type_next_field_x()

static SCM gdbscm_type_next_field_x ( SCM  self)
static

◆ gdbscm_type_num_fields()

static SCM gdbscm_type_num_fields ( SCM  self)
static

◆ gdbscm_type_p()

static SCM gdbscm_type_p ( SCM  self)
static

Definition at line 299 of file scm-type.c.

References tyscm_is_type().

◆ gdbscm_type_pointer()

static SCM gdbscm_type_pointer ( SCM  self)
static

◆ gdbscm_type_print_name()

static SCM gdbscm_type_print_name ( SCM  self)
static

◆ gdbscm_type_range()

static SCM gdbscm_type_range ( SCM  self)
static

◆ gdbscm_type_reference()

static SCM gdbscm_type_reference ( SCM  self)
static

◆ gdbscm_type_sizeof()

static SCM gdbscm_type_sizeof ( SCM  self)
static

◆ gdbscm_type_strip_typedefs()

static SCM gdbscm_type_strip_typedefs ( SCM  self)
static

◆ gdbscm_type_tag()

static SCM gdbscm_type_tag ( SCM  self)
static

◆ gdbscm_type_target()

static SCM gdbscm_type_target ( SCM  self)
static

◆ gdbscm_type_unqualified()

static SCM gdbscm_type_unqualified ( SCM  self)
static

◆ gdbscm_type_vector()

static SCM gdbscm_type_vector ( SCM  self,
SCM  n1,
SCM  n2 
)
static

Definition at line 771 of file scm-type.c.

References FUNC_NAME, n1, n2, and tyscm_array_1().

◆ gdbscm_type_volatile()

static SCM gdbscm_type_volatile ( SCM  self)
static

◆ tyscm_array_1()

static SCM tyscm_array_1 ( SCM  self,
SCM  n1_scm,
SCM  n2_scm,
int  is_vector,
const char *  func_name 
)
static

◆ tyscm_copy_type_recursive()

static int tyscm_copy_type_recursive ( void **  slot,
void *  info 
)
static

◆ tyscm_eq_type_smob()

static int tyscm_eq_type_smob ( const void *  ap,
const void *  bp 
)
static

Definition at line 158 of file scm-type.c.

References bp, and type_smob::type.

Referenced by gdbscm_initialize_types(), and tyscm_type_map().

◆ tyscm_equal_p_type_smob()

static SCM tyscm_equal_p_type_smob ( SCM  type1_scm,
SCM  type2_scm 
)
static

◆ tyscm_field_smob_containing_type()

static struct type * tyscm_field_smob_containing_type ( field_smob f_smob)
static

◆ tyscm_field_smob_to_field()

static struct field * tyscm_field_smob_to_field ( field_smob f_smob)
static

◆ tyscm_free_type_smob()

static size_t tyscm_free_type_smob ( SCM  self)
static

◆ tyscm_get_composite()

static struct type * tyscm_get_composite ( struct type type)
static

◆ tyscm_get_field_arg_unsafe()

static SCM tyscm_get_field_arg_unsafe ( SCM  self,
int  arg_pos,
const char *  func_name 
)
static

Definition at line 468 of file scm-type.c.

References field_smob_name, and tyscm_is_field().

Referenced by tyscm_get_field_smob_arg_unsafe().

◆ tyscm_get_field_smob_arg_unsafe()

static field_smob * tyscm_get_field_smob_arg_unsafe ( SCM  self,
int  arg_pos,
const char *  func_name 
)
static

◆ tyscm_get_type_arg_unsafe()

static SCM tyscm_get_type_arg_unsafe ( SCM  self,
int  arg_pos,
const char *  func_name 
)
static

Definition at line 335 of file scm-type.c.

References type_smob_name, and tyscm_is_type().

Referenced by tyscm_get_type_smob_arg_unsafe().

◆ tyscm_get_type_smob_arg_unsafe()

type_smob * tyscm_get_type_smob_arg_unsafe ( SCM  self,
int  arg_pos,
const char *  func_name 
)

◆ tyscm_hash_type_smob()

static hashval_t tyscm_hash_type_smob ( const void *  p)
static

Definition at line 148 of file scm-type.c.

References type_smob::type.

Referenced by gdbscm_initialize_types(), and tyscm_type_map().

◆ tyscm_is_field()

static int tyscm_is_field ( SCM  self)
static

Definition at line 442 of file scm-type.c.

References field_smob_tag.

Referenced by gdbscm_field_p(), and tyscm_get_field_arg_unsafe().

◆ tyscm_is_type()

int tyscm_is_type ( SCM  self)

◆ tyscm_lookup_typename()

static struct type * tyscm_lookup_typename ( const char *  type_name,
const struct block block 
)
static

◆ tyscm_make_field_smob()

static SCM tyscm_make_field_smob ( SCM  type_scm,
int  field_num 
)
static

◆ tyscm_make_type_smob()

static SCM tyscm_make_type_smob ( void  )
static

◆ tyscm_print_field_smob()

static int tyscm_print_field_smob ( SCM  self,
SCM  port,
scm_print_state *  pstate 
)
static

◆ tyscm_print_type_smob()

static int tyscm_print_type_smob ( SCM  self,
SCM  port,
scm_print_state *  pstate 
)
static

Definition at line 215 of file scm-type.c.

References gdbscm_printf(), name, pstate, type_smob::type, type_smob_name, and tyscm_type_name().

Referenced by gdbscm_initialize_types().

◆ tyscm_scm_from_field()

SCM tyscm_scm_from_field ( SCM  type_scm,
int  field_num 
)

Definition at line 459 of file scm-type.c.

References tyscm_make_field_smob().

◆ tyscm_scm_from_type()

SCM tyscm_scm_from_type ( struct type type)

◆ tyscm_scm_to_type()

struct type * tyscm_scm_to_type ( SCM  t_scm)

Definition at line 359 of file scm-type.c.

References type_smob::type, and tyscm_is_type().

Referenced by lsscm_elt_type(), and lsscm_safe_lazy_string_to_value().

◆ tyscm_type_map()

static htab_t tyscm_type_map ( struct type type)
static

◆ tyscm_type_name()

static std::string tyscm_type_name ( struct type type)
static

◆ tyscm_type_smob_type()

struct type * tyscm_type_smob_type ( type_smob t_smob)

Definition at line 115 of file scm-type.c.

References type_smob::type.

Referenced by gdbscm_make_lazy_value(), gdbscm_make_value(), and vlscm_do_cast().

Variable Documentation

◆ block_keyword

SCM block_keyword
static

Definition at line 82 of file scm-type.c.

Referenced by gdbscm_initialize_types(), and gdbscm_lookup_type().

◆ field_smob_name

const char field_smob_name[] = "gdb:field"
static

◆ field_smob_tag

scm_t_bits field_smob_tag
static

Definition at line 76 of file scm-type.c.

Referenced by gdbscm_initialize_types(), tyscm_is_field(), and tyscm_make_field_smob().

◆ global_types_map

htab_t global_types_map
static

Definition at line 107 of file scm-type.c.

Referenced by gdbscm_initialize_types(), and tyscm_type_map().

◆ not_composite_error

const char not_composite_error[]
static
Initial value:
=
N_("type is not a structure, union, or enum type")

Definition at line 69 of file scm-type.c.

Referenced by gdbscm_make_field_iterator(), gdbscm_type_field(), gdbscm_type_fields(), gdbscm_type_has_field_p(), and gdbscm_type_num_fields().

◆ type_functions

const scheme_function type_functions[]
static

Definition at line 1310 of file scm-type.c.

Referenced by gdbscm_initialize_types().

◆ type_integer_constants

const scheme_integer_constant type_integer_constants[]
static
Initial value:
=
{
{ "TYPE_CODE_BITSTRING", -1 },
#define OP(SYM)
}
#define END_INTEGER_CONSTANTS

Definition at line 1298 of file scm-type.c.

Referenced by gdbscm_initialize_types().

◆ type_smob_name

const char type_smob_name[] = "gdb:type"
static

◆ type_smob_tag

scm_t_bits type_smob_tag
static

Definition at line 73 of file scm-type.c.

Referenced by gdbscm_initialize_types(), tyscm_is_type(), and tyscm_make_type_smob().

◆ tyscm_next_field_x_proc

SCM tyscm_next_field_x_proc
static

Definition at line 79 of file scm-type.c.

Referenced by gdbscm_initialize_types(), and gdbscm_make_field_iterator().

◆ tyscm_objfile_data_key

const registry<objfile>::key<htab, tyscm_deleter> tyscm_objfile_data_key
static

Definition at line 104 of file scm-type.c.

Referenced by tyscm_type_map().