#if !defined (GDBTYPES_H)
#define GDBTYPES_H 1
-/* When gdb creates fundamental types, it uses one of the following
- type identifiers. The identifiers are used to index a vector of
- pointers to any types that are created. */
+/* Codes for `fundamental types'. This is a monstrosity based on the
+ bogus notion that there are certain compiler-independent
+ `fundamental types'. None of these is well-defined (how big is
+ FT_SHORT? Does it depend on the language? How does the
+ language-specific code know which type to correlate to FT_SHORT?) */
#define FT_VOID 0
#define FT_BOOLEAN 1
TYPE_CODE_SET, /* Pascal sets */
TYPE_CODE_RANGE, /* Range (integers within spec'd bounds) */
- TYPE_CODE_STRING, /* String types, distinct from array of char */
- TYPE_CODE_BITSTRING, /* String of bits, distinct from bool array */
+
+ /* A string type which is like an array of character but prints
+ differently (at least for 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. */
+ TYPE_CODE_STRING,
+
+ /* String of bits; like TYPE_CODE_SET but prints differently (at least
+ for CHILL). */
+ TYPE_CODE_BITSTRING,
/* Unknown type. The length field is valid if we were able to
deduce that much about the type, or 0 if we don't even know that. */
/* Some bits for the type's flags word. */
-/* Explicitly unsigned integer type */
+/* Unsigned integer type. If this is not set for a TYPE_CODE_INT, the
+ type is signed. */
#define TYPE_FLAG_UNSIGNED (1 << 0)
-/* Explicitly signed integer type */
-
-#define TYPE_FLAG_SIGNED (1 << 1)
-
/* This appears in a type's flags word if it is a stub type (e.g., if
someone referenced a type that wasn't defined in a source file
via (struct sir_not_appearing_in_this_film *)). */
#define TYPE_FLAG_STUB (1 << 2)
+/* The target type of this type is a stub type, and this type needs to
+ be updated if it gets un-stubbed in check_stub_type. Currently only
+ used for arrays, in which TYPE_LENGTH of the array gets set based
+ on the TYPE_LENGTH of the target type. */
+
+#define TYPE_FLAG_TARGET_STUB (1 << 3)
struct type
{
#define TYPE_NFIELDS(thistype) (thistype)->nfields
#define TYPE_FIELDS(thistype) (thistype)->fields
+#define TYPE_LOW_BOUND(range_type) TYPE_FIELD_BITPOS (range_type, 0)
+#define TYPE_HIGH_BOUND(range_type) TYPE_FIELD_BITPOS (range_type, 1)
+/* If TYPE_DUMMY_RANGE is true for a range type, it was allocated
+ by force_to_range_type. */
+#define TYPE_DUMMY_RANGE(type) ((type)->vptr_fieldno)
+
/* C++ */
#define TYPE_VPTR_BASETYPE(thistype) (thistype)->vptr_basetype
extern struct type *
create_string_type PARAMS ((struct type *, struct type *));
+extern struct type *
+create_set_type PARAMS ((struct type *, struct type *));
+
extern struct type *
lookup_unsigned_typename PARAMS ((char *));