X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fgdbtypes.h;h=49653ffcaf7d58f106689471c907e773e2f89f39;hb=abdb711e0855f0597a96db0486b598144b788212;hp=a6d4f64e9b7630d87c17f964f53fde382f18d62c;hpb=42a4f53d2bf8938c2aeda9f52be7a20534b214a9;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index a6d4f64e9b..49653ffcaf 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -350,6 +350,10 @@ DEF_ENUM_FLAGS_TYPE (enum type_instance_flag_value, type_instance_flags); #define TYPE_IS_REFERENCE(t) \ (TYPE_CODE (t) == TYPE_CODE_REF || TYPE_CODE (t) == TYPE_CODE_RVALUE_REF) +/* * True if this type is allocatable. */ +#define TYPE_IS_ALLOCATABLE(t) \ + (get_dyn_prop (DYN_PROP_ALLOCATED, t) != NULL) + /* * Instruction-space delimited type. This is for Harvard architectures which have separate instruction and data address spaces (and perhaps others). @@ -615,7 +619,7 @@ struct range_bounds struct dynamic_prop high; /* True if HIGH range bound contains the number of elements in the - subrange. This affects how the final hight bound is computed. */ + subrange. This affects how the final high bound is computed. */ int flag_upper_bound_is_count : 1; @@ -859,7 +863,7 @@ struct type type_length_units function should be used in order to get the length expressed in target addressable memory units. */ - unsigned int length; + ULONGEST length; /* * Core type, shared by a group of qualified types. */ @@ -1255,6 +1259,10 @@ extern void allocate_cplus_struct_type (struct type *); (TYPE_SPECIFIC_FIELD (type) == TYPE_SPECIFIC_CPLUS_STUFF \ && TYPE_RAW_CPLUS_SPECIFIC (type) != &cplus_struct_default) +#define INIT_NONE_SPECIFIC(type) \ + (TYPE_SPECIFIC_FIELD (type) = TYPE_SPECIFIC_NONE, \ + TYPE_MAIN_TYPE (type)->type_specific = {}) + extern const struct gnat_aux_type gnat_aux_default; extern void allocate_gnat_aux_type (struct type *); @@ -1268,6 +1276,12 @@ extern void allocate_gnat_aux_type (struct type *); #define HAVE_GNAT_AUX_INFO(type) \ (TYPE_SPECIFIC_FIELD (type) == TYPE_SPECIFIC_GNAT_STUFF) +/* * True if TYPE is known to be an Ada type of some kind. */ +#define ADA_TYPE_P(type) \ + (TYPE_SPECIFIC_FIELD (type) == TYPE_SPECIFIC_GNAT_STUFF \ + || (TYPE_SPECIFIC_FIELD (type) == TYPE_SPECIFIC_NONE \ + && TYPE_FIXED_INSTANCE (type))) + #define INIT_FUNC_SPECIFIC(type) \ (TYPE_SPECIFIC_FIELD (type) = TYPE_SPECIFIC_FUNC, \ TYPE_MAIN_TYPE (type)->type_specific.func_stuff = (struct func_type *) \ @@ -1355,7 +1369,8 @@ extern bool set_type_align (struct type *, ULONGEST); dynprop->kind -/* Moto-specific stuff for FORTRAN arrays. */ +/* Accessors for struct range_bounds data attached to an array type's + index type. */ #define TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED(arraytype) \ TYPE_HIGH_BOUND_UNDEFINED(TYPE_INDEX_TYPE(arraytype)) @@ -1581,6 +1596,7 @@ struct builtin_type struct type *builtin_unsigned_short; struct type *builtin_unsigned_int; struct type *builtin_unsigned_long; + struct type *builtin_half; struct type *builtin_float; struct type *builtin_double; struct type *builtin_long_double; @@ -1676,6 +1692,7 @@ struct objfile_type struct type *builtin_unsigned_int; struct type *builtin_unsigned_long; struct type *builtin_unsigned_long_long; + struct type *builtin_half; struct type *builtin_float; struct type *builtin_double; struct type *builtin_long_double; @@ -1849,7 +1866,7 @@ extern struct type *make_atomic_type (struct type *); extern void replace_type (struct type *, struct type *); -extern int address_space_name_to_int (struct gdbarch *, char *); +extern int address_space_name_to_int (struct gdbarch *, const char *); extern const char *address_space_int_to_name (struct gdbarch *, int); @@ -1873,6 +1890,44 @@ extern struct type *allocate_stub_method (struct type *); extern const char *type_name_or_error (struct type *type); +struct struct_elt +{ + /* The field of the element, or NULL if no element was found. */ + struct field *field; + + /* The bit offset of the element in the parent structure. */ + LONGEST offset; +}; + +/* Given a type TYPE, lookup the field and offset of the component named + NAME. + + TYPE can be either a struct or union, or a pointer or reference to + a struct or union. If it is a pointer or reference, its target + type is automatically used. Thus '.' and '->' are interchangable, + as specified for the definitions of the expression element types + STRUCTOP_STRUCT and STRUCTOP_PTR. + + If NOERR is nonzero, the returned structure will have field set to + NULL if there is no component named NAME. + + If the component NAME is a field in an anonymous substructure of + TYPE, the returned offset is a "global" offset relative to TYPE + rather than an offset within the substructure. */ + +extern struct_elt lookup_struct_elt (struct type *, const char *, int); + +/* Given a type TYPE, lookup the type of the component named NAME. + + TYPE can be either a struct or union, or a pointer or reference to + a struct or union. If it is a pointer or reference, its target + type is automatically used. Thus '.' and '->' are interchangable, + as specified for the definitions of the expression element types + STRUCTOP_STRUCT and STRUCTOP_PTR. + + If NOERR is nonzero, return NULL if there is no component named + NAME. */ + extern struct type *lookup_struct_elt_type (struct type *, const char *, int); extern struct type *make_pointer_type (struct type *, struct type **); @@ -1957,7 +2012,7 @@ extern struct type *lookup_typename (const struct language_defn *, struct gdbarch *, const char *, const struct block *, int); -extern struct type *lookup_template_type (char *, struct type *, +extern struct type *lookup_template_type (const char *, struct type *, const struct block *); extern int get_vptr_fieldno (struct type *, struct type **);