72 N_(
"type is not a structure, union, or enum type");
144 return htab_hash_pointer (t_smob->
type);
191 if (t_smob->
type != NULL)
220 if (pstate->writingp)
223 scm_puts (name, port);
225 if (pstate->writingp)
226 scm_puts (
">", port);
228 scm_remember_upto_here_1 (
self);
240 struct type *type1, *type2;
247 type1_smob = (
type_smob *) SCM_SMOB_DATA (type1_scm);
248 type2_smob = (
type_smob *) SCM_SMOB_DATA (type2_scm);
249 type1 = type1_smob->
type;
250 type2 = type2_smob->
type;
262 return scm_from_bool (result);
316 return (*slot)->containing_scm;
319 t_smob = (
type_smob *) SCM_SMOB_DATA (t_scm);
332 SCM_ASSERT_TYPE (
tyscm_is_type (
self),
self, arg_pos, func_name,
356 htab_t copied_types = info;
364 htab_empty (copied_types);
377 t_smob_for_lookup.
type = t_smob->
type;
405 htab_delete (copied_types);
420 scm_puts (
">", port);
422 scm_remember_upto_here_1 (
self);
511 static struct field *
548 struct type *containing_type;
549 SCM containing_type_scm, result;
553 if (containing_type == NULL)
559 if (containing_type == type)
560 containing_type_scm =
self;
568 return scm_reverse_x (result, SCM_EOL);
612 SCM exception, result;
711 const char *func_name)
717 struct type *array = NULL;
720 n1_scm, &n1, n2_scm, &n2);
722 if (SCM_UNBNDP (n2_scm))
731 scm_cons (scm_from_long (n1),
733 _(
"Array length must not be negative"));
817 SCM low_scm, high_scm;
842 return scm_list_2 (low_scm, high_scm);
985 SCM_ASSERT_TYPE (scm_is_string (field_scm), field_scm, SCM_ARG2,
FUNC_NAME,
1004 if (t_field_name && (
strcmp_iw (t_field_name, field) == 0))
1014 _(
"Unknown field"));
1030 SCM_ASSERT_TYPE (scm_is_string (field_scm), field_scm, SCM_ARG2,
FUNC_NAME,
1049 if (t_field_name && (
strcmp_iw (t_field_name, field) == 0))
1070 struct type *containing_type;
1071 SCM containing_type_scm;
1074 if (containing_type == NULL)
1080 if (containing_type == type)
1081 containing_type_scm =
self;
1101 SCM it_scm, result, progress, object;
1111 t_smob = (
type_smob *) SCM_SMOB_DATA (
object);
1112 type = t_smob->
type;
1114 SCM_ASSERT_TYPE (scm_is_signed_integer (progress,
1116 progress, SCM_ARG1,
FUNC_NAME,
_(
"integer"));
1117 field = scm_to_int (progress);
1191 self, SCM_ARG1,
FUNC_NAME,
_(
"non-enum type"));
1242 static struct type *
1257 type_name, block, 0);
1276 SCM block_scm = SCM_BOOL_F;
1277 int block_arg_pos = -1;
1283 rest, &block_arg_pos, &block_scm);
1285 if (block_arg_pos != -1)
1310 #define X(SYM) { #SYM, SYM }
1346 Return #t if the object is a <gdb:type> object." },
1350 Return the <gdb:type> object representing string or #f if not found.\n\
1351 If block is given then the type is looked for in that block.\n\
1353 Arguments: string [#:block <gdb:block>]" },
1357 Return the code of the type" },
1361 Return the tag name of the type, or #f if there isn't one." },
1365 Return the name of the type as a string, or #f if there isn't one." },
1369 Return the print name of the type as a string." },
1373 Return the size of the type, in bytes." },
1377 Return a type formed by stripping the type of all typedefs." },
1381 Return a type representing an array of objects of the type.\n\
1383 Arguments: <gdb:type> [low-bound] high-bound\n\
1384 If low-bound is not provided zero is used.\n\
1385 N.B. If only the high-bound parameter is specified, it is not\n\
1387 Valid bounds for array indices are [low-bound,high-bound]." },
1391 Return a type representing a vector of objects of the type.\n\
1392 Vectors differ from arrays in that if the current language has C-style\n\
1393 arrays, vectors don't decay to a pointer to the first element.\n\
1394 They are first class values.\n\
1396 Arguments: <gdb:type> [low-bound] high-bound\n\
1397 If low-bound is not provided zero is used.\n\
1398 N.B. If only the high-bound parameter is specified, it is not\n\
1400 Valid bounds for array indices are [low-bound,high-bound]." },
1404 Return a type of pointer to the type." },
1408 Return (low high) representing the range for the type." },
1412 Return a type of reference to the type." },
1416 Return the target type of the type." },
1420 Return a const variant of the type." },
1424 Return a volatile variant of the type." },
1428 Return a variant of the type without const or volatile attributes." },
1432 Return the number of fields of the type." },
1436 Return the list of <gdb:field> objects of fields of the type." },
1440 Return a <gdb:iterator> object for iterating over the fields of the type." },
1444 Return the field named by string of the type.\n\
1446 Arguments: <gdb:type> string" },
1450 Return #t if the type has field named string.\n\
1452 Arguments: <gdb:type> string" },
1456 Return #t if the object is a <gdb:field> object." },
1460 Return the name of the field." },
1464 Return the type of the field." },
1468 Return the enum value represented by the field." },
1472 Return the offset in bits of the field in its containing type." },
1476 Return the size of the field in bits." },
1480 Return #t if the field is artificial." },
1484 Return #t if the field is a baseclass." },
1506 = scm_c_define_gsubr (
"%type-next-field!", 1, 0, 0,
1511 Internal function to assist the type fields iterator."));
static int tyscm_eq_type_smob(const void *ap, const void *bp)
struct type * lookup_array_range_type(struct type *element_type, LONGEST low_bound, LONGEST high_bound)
static SCM scm_new_smob(scm_t_bits tc, scm_t_bits data)
static SCM gdbscm_field_p(SCM self)
SCM gdbscm_make_iterator(SCM object, SCM progress, SCM next)
void gdbscm_define_functions(const scheme_function *, int is_public)
static htab_t global_types_map
static SCM tyscm_array_1(SCM self, SCM n1_scm, SCM n2_scm, int is_vector, const char *func_name)
#define TYPE_FIELD_NAME(thistype, n)
#define TYPE_N_BASECLASSES(thistype)
#define TYPE_LOW_BOUND(range_type)
static SCM gdbscm_type_const(SCM self)
int strcmp_iw(const char *string1, const char *string2)
#define TYPE_NAME(thistype)
static SCM gdbscm_type_name(SCM self)
static char * tyscm_type_name(struct type *type, SCM *excp)
char * ui_file_xstrdup(struct ui_file *file, long *length)
char * gdbscm_scm_to_c_string(SCM string)
#define TYPE_HIGH_BOUND(range_type)
#define FIELD_ARTIFICIAL(thisfld)
const struct type_print_options type_print_raw_options
static SCM gdbscm_type_code(SCM self)
static SCM gdbscm_type_range(SCM self)
static SCM gdbscm_field_bitsize(SCM self)
SCM gdbscm_scm_from_longest(LONGEST l)
scm_t_bits gdbscm_make_smob_type(const char *name, size_t size)
static SCM gdbscm_type_strip_typedefs(SCM self)
static SCM gdbscm_field_artificial_p(SCM self)
static SCM gdbscm_type_reference(SCM self)
#define TYPE_FIELD(thistype, n)
static SCM gdbscm_type_target(SCM self)
static struct type * tyscm_get_composite(struct type *type)
static SCM tyscm_equal_p_type_smob(SCM type1_scm, SCM type2_scm)
SCM tyscm_scm_from_field(SCM type_scm, int field_num)
static SCM gdbscm_type_num_fields(SCM self)
static SCM gdbscm_type_fields(SCM self)
int types_deeply_equal(struct type *type1, struct type *type2)
struct type * lookup_typename(const struct language_defn *language, struct gdbarch *gdbarch, const char *name, const struct block *block, int noerr)
static SCM gdbscm_type_field(SCM self, SCM field_scm)
struct type * check_typedef(struct type *type)
type_smob * tyscm_get_type_smob_arg_unsafe(SCM self, int arg_pos, const char *func_name)
static SCM gdbscm_field_bitpos(SCM self)
void gdbscm_init_gsmob(gdb_smob *base)
#define CATCH(EXCEPTION, MASK)
SCM itscm_get_iterator_arg_unsafe(SCM self, int arg_pos, const char *func_name)
static SCM tyscm_next_field_x_proc
SCM itscm_iterator_smob_object(iterator_smob *i_smob)
static struct parser_state * pstate
SCM gdbscm_scm_from_c_string(const char *string)
struct type * lookup_struct(const char *name, const struct block *block)
static SCM gdbscm_field_name(SCM self)
struct type * tyscm_type_smob_type(type_smob *t_smob)
SCM gdbscm_scm_from_gdb_exception(struct gdb_exception exception)
static struct field * tyscm_field_smob_to_field(field_smob *f_smob)
void itscm_set_iterator_smob_progress_x(iterator_smob *i_smob, SCM progress)
struct type * lookup_enum(const char *name, const struct block *block)
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
struct type * copy_type_recursive(struct objfile *objfile, struct type *type, htab_t copied_types)
static SCM gdbscm_type_next_field_x(SCM self)
void gdbscm_throw(SCM exception) ATTRIBUTE_NORETURN
struct gdbarch * get_current_arch(void)
static void save_objfile_types(struct objfile *objfile, void *datum)
static int startswith(const char *string, const char *pattern)
htab_t create_copied_types_hash(struct objfile *objfile)
struct type * lookup_union(const char *name, const struct block *block)
static struct type * tyscm_lookup_typename(const char *type_name, const struct block *block)
static SCM gdbscm_type_pointer(SCM self)
SCM tyscm_scm_from_type(struct type *type)
#define TYPE_FIELDS(thistype)
void gdbscm_clear_eqable_gsmob_ptr_slot(htab_t htab, eqable_gdb_smob *base)
static SCM gdbscm_field_enumval(SCM self)
static const char type_smob_name[]
static hashval_t tyscm_hash_type_smob(const void *p)
struct ui_file * mem_fileopen(void)
static SCM tyscm_get_type_arg_unsafe(SCM self, int arg_pos, const char *func_name)
void gdbscm_printf(SCM port, const char *format,...) ATTRIBUTE_PRINTF(2
static int tyscm_is_field(SCM self)
static scm_t_bits field_smob_tag
htab_t gdbscm_create_eqable_gsmob_ptr_map(htab_hash hash_fn, htab_eq eq_fn)
#define LA_PRINT_TYPE(type, varstring, stream, show, level, flags)
SCM gdbscm_end_of_iteration(void)
void gdbscm_init_eqable_gsmob(eqable_gdb_smob *base, SCM containing_scm)
void gdbscm_define_integer_constants(const scheme_integer_constant *, int is_public)
struct type * make_cv_type(int cnst, int voltl, struct type *type, struct type **typeptr)
const struct language_defn * current_language
const struct block * bkscm_scm_to_block(SCM block_scm, int arg_pos, const char *func_name, SCM *excp)
#define TYPE_TARGET_TYPE(thistype)
static htab_t tyscm_type_map(struct type *type)
static SCM gdbscm_type_p(SCM self)
static scm_t_bits type_smob_tag
void gdbscm_initialize_types(void)
static int tyscm_print_type_smob(SCM self, SCM port, scm_print_state *pstate)
static SCM gdbscm_field_type(SCM self)
struct cleanup * make_cleanup_ui_file_delete(struct ui_file *arg)
eqable_gdb_smob ** gdbscm_find_eqable_gsmob_ptr_slot(htab_t htab, eqable_gdb_smob *base)
static SCM gdbscm_type_has_field_p(SCM self, SCM field_scm)
static SCM gdbscm_lookup_type(SCM name_scm, SCM rest)
#define TYPE_CODE(thistype)
#define TYPE_INDEX_TYPE(type)
static SCM gdbscm_type_sizeof(SCM self)
#define FIELD_ENUMVAL(thisfld)
void gdbscm_out_of_range_error(const char *subr, int arg_pos, SCM bad_value, const char *error) ATTRIBUTE_NORETURN
int tyscm_is_type(SCM self)
#define TYPE_NFIELDS(thistype)
static SCM tyscm_make_type_smob(void)
SCM gdbscm_documentation_symbol
SCM itscm_iterator_smob_progress(iterator_smob *i_smob)
static SCM tyscm_make_field_smob(SCM type_scm, int field_num)
void gdbscm_parse_function_args(const char *function_name, int beginning_arg_pos, const SCM *keywords, const char *format,...)
void gdbscm_fill_eqable_gsmob_ptr_slot(eqable_gdb_smob **slot, eqable_gdb_smob *base)
#define TYPE_TAG_NAME(type)
static SCM tyscm_get_field_arg_unsafe(SCM self, int arg_pos, const char *func_name)
#define FIELD_NAME(thisfld)
#define GDBSCM_HANDLE_GDB_EXCEPTION(exception)
static SCM gdbscm_type_print_name(SCM self)
static SCM gdbscm_type_array(SCM self, SCM n1, SCM n2)
static const char not_composite_error[]
static int tyscm_print_field_smob(SCM self, SCM port, scm_print_state *pstate)
static SCM gdbscm_field_baseclass_p(SCM self)
static field_smob * tyscm_get_field_smob_arg_unsafe(SCM self, int arg_pos, const char *func_name)
struct type * lookup_reference_type(struct type *type)
int gdb_scheme_initialized
#define TYPE_LENGTH(thistype)
#define FIELD_BITPOS(thisfld)
static const struct objfile_data * tyscm_objfile_data_key
static const char field_smob_name[]
static int tyscm_copy_type_recursive(void **slot, void *info)
static struct type * tyscm_field_smob_containing_type(field_smob *f_smob)
static SCM gdbscm_type_tag(SCM self)
static SCM gdbscm_type_vector(SCM self, SCM n1, SCM n2)
void make_vector_type(struct type *array_type)
static size_t tyscm_free_type_smob(SCM self)
struct type * lookup_pointer_type(struct type *type)
static SCM gdbscm_type_volatile(SCM self)
void do_cleanups(struct cleanup *old_chain)
static SCM gdbscm_make_field_iterator(SCM self)
#define FIELD_TYPE(thisfld)
#define END_INTEGER_CONSTANTS
static SCM gdbscm_type_unqualified(SCM self)