GDB (xrefs)
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 "vec.h"
#include "bcache.h"
#include "dwarf2loc.h"
#include "typeprint.h"
#include "guile-internal.h"

Go to the source code of this file.

Classes

struct  _type_smob
 
struct  field_smob
 

Macros

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

Functions

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_copy_type_recursive (void **slot, void *info)
 
static void save_objfile_types (struct objfile *objfile, void *datum)
 
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 struct objfile_data * tyscm_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

◆ X

#define X (   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 456 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 753 of file scm-type.c.

References FUNC_NAME, and tyscm_array_1().

◆ gdbscm_type_code()

static SCM gdbscm_type_code ( SCM  self)
static

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

References FUNC_NAME, _type_smob::type, TYPE_CODE, 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 280 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 769 of file scm-type.c.

References FUNC_NAME, and tyscm_array_1().

◆ gdbscm_type_volatile()

static SCM gdbscm_type_volatile ( SCM  self)
static

◆ save_objfile_types()

static void save_objfile_types ( struct objfile objfile,
void *  datum 
)
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 140 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 474 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 316 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 130 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 448 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

◆ tyscm_scm_from_field()

SCM tyscm_scm_from_field ( SCM  type_scm,
int  field_num 
)

Definition at line 465 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 340 of file scm-type.c.

References gdb_assert, _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 97 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 84 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 78 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 89 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")
#define N_(String)
Definition: gdb_locale.h:36

Definition at line 71 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 1333 of file scm-type.c.

Referenced by gdbscm_initialize_types().

◆ type_integer_constants

const scheme_integer_constant type_integer_constants[]
static

Definition at line 1299 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 75 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 81 of file scm-type.c.

Referenced by gdbscm_initialize_types(), and gdbscm_make_field_iterator().

◆ tyscm_objfile_data_key

const struct objfile_data* tyscm_objfile_data_key
static

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

Referenced by gdbscm_initialize_types(), and tyscm_type_map().