X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gdb%2Fgdbtypes.h;h=bd1a0ab2fe0b1ee09592d309618c0e1563d29bd7;hb=6144afba18bc86c04804bfc7df535e778e3c4e31;hp=e91ab977251339159ef2bdbf723ddacb0293566f;hpb=6b662e19e420d2ef28f14b985390977080bcd341;p=platform%2Fupstream%2Fbinutils.git diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index e91ab97..bd1a0ab 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -1,3 +1,4 @@ + /* Internal type definitions for GDB. Copyright (C) 1992-2014 Free Software Foundation, Inc. @@ -28,18 +29,19 @@ languages using a common representation defined in gdbtypes.h. The main data structure is main_type; it consists of a code (such - as TYPE_CODE_ENUM for enumeration types), a number of + as #TYPE_CODE_ENUM for enumeration types), a number of generally-useful fields such as the printable name, and finally a - field type_specific that is a union of info specific to particular - languages or other special cases (such as calling convention). + field main_type::type_specific that is a union of info specific to + particular languages or other special cases (such as calling + convention). - The available type codes are defined in enum type_code. The enum + The available type codes are defined in enum #type_code. The enum includes codes both for types that are common across a variety of languages, and for types that are language-specific. - Most accesses to type fields go through macros such as TYPE_CODE - and TYPE_FN_FIELD_CONST. These are written such that they can be - used as both rvalues and lvalues. + Most accesses to type fields go through macros such as + #TYPE_CODE(thistype) and #TYPE_FN_FIELD_CONST(thisfn, n). These are + written such that they can be used as both rvalues and lvalues. */ #include "hashtab.h" @@ -130,10 +132,9 @@ enum type_code TYPE_CODE_RANGE, /**< Range (integers within spec'd bounds). */ /* * A string type which is like an array of character but prints - differently (at least for (the deleted) CHILL). It does not - contain a length field as Pascal strings (for many Pascals, - anyway) do; if we want to deal with such strings, we should use - a new type code. */ + differently. It does not contain a length field as Pascal + strings (for many Pascals, anyway) do; if we want to deal with + such strings, we should use a new type code. */ TYPE_CODE_STRING, /* * Unknown type. The length field is valid if we were able to @@ -177,7 +178,10 @@ enum type_code TYPE_CODE_MODULE, /**< Fortran module. */ /* * Internal function type. */ - TYPE_CODE_INTERNAL_FUNCTION + TYPE_CODE_INTERNAL_FUNCTION, + + /* * Methods implemented in extension languages. */ + TYPE_CODE_XMETHOD }; /* * For now allow source to use TYPE_CODE_CLASS for C++ classes, as @@ -330,8 +334,10 @@ enum type_instance_flag_value #define TYPE_OBJFILE(t) (TYPE_OBJFILE_OWNED(t)? TYPE_OWNER(t).objfile : NULL) /* * True if this type was declared using the "class" keyword. This is - only valid for C++ structure types, and only used for displaying - the type. If false, the structure was declared as a "struct". */ + only valid for C++ structure and enum types. If false, a structure + was declared as a "struct"; if true it was declared "class". For + enum types, this is true when "enum class" or "enum struct" was + used to declare the type.. */ #define TYPE_DECLARED_CLASS(t) (TYPE_MAIN_TYPE (t)->flag_declared_class) @@ -662,6 +668,16 @@ struct main_type /* * High bound of range. */ 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. */ + + int flag_upper_bound_is_count : 1; + + /* True if LOW or/and HIGH are resolved into a static bound from + a dynamic one. */ + + int flag_bound_evaluated : 1; } *bounds; } flds_bnds; @@ -708,6 +724,11 @@ struct main_type struct func_type *func_stuff; } type_specific; + + /* * Contains a location description value for the current type. Evaluating + this field yields to the location of the data for an object. */ + + struct dynamic_prop *data_location; }; /* * A ``struct type'' describes a particular instance of a type, with @@ -1187,6 +1208,16 @@ extern void allocate_gnat_aux_type (struct type *); #define TYPE_LOW_BOUND_KIND(range_type) \ TYPE_RANGE_DATA(range_type)->low.kind +/* Attribute accessors for the type data location. */ +#define TYPE_DATA_LOCATION(thistype) \ + TYPE_MAIN_TYPE(thistype)->data_location +#define TYPE_DATA_LOCATION_BATON(thistype) \ + TYPE_DATA_LOCATION (thistype)->data.baton +#define TYPE_DATA_LOCATION_ADDR(thistype) \ + TYPE_DATA_LOCATION (thistype)->data.const_val +#define TYPE_DATA_LOCATION_KIND(thistype) \ + TYPE_DATA_LOCATION (thistype)->kind + /* Moto-specific stuff for FORTRAN arrays. */ #define TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED(arraytype) \ @@ -1205,7 +1236,6 @@ extern void allocate_gnat_aux_type (struct type *); #define TYPE_VPTR_BASETYPE(thistype) TYPE_MAIN_TYPE(thistype)->vptr_basetype #define TYPE_DOMAIN_TYPE(thistype) TYPE_MAIN_TYPE(thistype)->vptr_basetype #define TYPE_VPTR_FIELDNO(thistype) TYPE_MAIN_TYPE(thistype)->vptr_fieldno -#define TYPE_FN_FIELDS(thistype) TYPE_CPLUS_SPECIFIC(thistype)->fn_fields #define TYPE_NFN_FIELDS(thistype) TYPE_CPLUS_SPECIFIC(thistype)->nfn_fields #define TYPE_SPECIFIC_FIELD(thistype) \ TYPE_MAIN_TYPE(thistype)->type_specific_field @@ -1455,6 +1485,9 @@ struct builtin_type /* * This type is used to represent a GDB internal function. */ struct type *internal_fn; + + /* * This type is used to represent an xmethod. */ + struct type *xmethod; }; /* * Return the type table for the specified architecture. */ @@ -1682,6 +1715,15 @@ extern void get_unsigned_type_max (struct type *, ULONGEST *); extern void get_signed_type_minmax (struct type *, LONGEST *, LONGEST *); +/* * Resolve all dynamic values of a type e.g. array bounds to static values. + ADDR specifies the location of the variable the type is bound to. + If TYPE has no dynamic properties return TYPE; otherwise a new type with + static properties is returned. */ +extern struct type *resolve_dynamic_type (struct type *type, CORE_ADDR addr); + +/* * Predicate if the type has dynamic values, which are not resolved yet. */ +extern int is_dynamic_type (struct type *type); + extern struct type *check_typedef (struct type *); #define CHECK_TYPEDEF(TYPE) \