* gdbtypes.h (struct type): Doc fix.
[deliverable/binutils-gdb.git] / gdb / gdbtypes.h
index 19fd152f5ed238efd42350a7a6076fed041dd34a..1e9832c7e8800c92e2137e118a7ef7432c9cd5d8 100644 (file)
@@ -1,5 +1,6 @@
 /* Internal type definitions for GDB.
-   Copyright (C) 1992-1994, 1996, 1998-2000 Free Software Foundation, Inc.
+   Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+   Free Software Foundation, Inc.
    Contributed by Cygnus Support, using pieces from other GDB modules.
 
    This file is part of GDB.
@@ -147,7 +148,7 @@ enum type_code
 
 /* No sign for this type.  In C++, "char", "signed char", and "unsigned
    char" are distinct types; so we need an extra flag to indicate the
-   absence ofa sign! */
+   absence of a sign! */
 
 #define TYPE_FLAG_NOSIGN       (1 << 1)
 
@@ -230,17 +231,29 @@ struct type
 
     char *tag_name;
 
-    /* Length of storage for a value of this type.  Various places pass
-       this to memcpy and such, meaning it must be in units of
-       HOST_CHAR_BIT.  Various other places expect they can calculate
-       addresses by adding it and such, meaning it must be in units of
-       TARGET_CHAR_BIT.  For some DSP targets, in which HOST_CHAR_BIT
-       will (presumably) be 8 and TARGET_CHAR_BIT will be (say) 32, this
-       is a problem.  One fix would be to make this field in bits
-       (requiring that it always be a multiple of HOST_CHAR_BIT and
-       TARGET_CHAR_BIT)--the other choice would be to make it
-       consistently in units of HOST_CHAR_BIT.  */
-
+    /* Length of storage for a value of this type.  This is what
+       sizeof(type) would return; use it for address arithmetic,
+       memory reads and writes, etc.  This size includes padding.  For
+       example, an i386 extended-precision floating point value really
+       only occupies ten bytes, but most ABI's declare its size to be
+       12 bytes, to preserve alignment.  A `struct type' representing
+       such a floating-point type would have a `length' value of 12,
+       even though the last two bytes are unused.
+
+       There's a bit of a host/target mess here, if you're concerned
+       about machines whose bytes aren't eight bits long, or who don't
+       have byte-addressed memory.  Various places pass this to memcpy
+       and such, meaning it must be in units of host bytes.  Various
+       other places expect they can calculate addresses by adding it
+       and such, meaning it must be in units of target bytes.  For
+       some DSP targets, in which HOST_CHAR_BIT will (presumably) be 8
+       and TARGET_CHAR_BIT will be (say) 32, this is a problem.
+
+       One fix would be to make this field in bits (requiring that it
+       always be a multiple of HOST_CHAR_BIT and TARGET_CHAR_BIT) ---
+       the other choice would be to make it consistently in units of
+       HOST_CHAR_BIT.  However, this would still fail to address
+       machines based on a ternary or decimal representation.  */
     unsigned length;
 
     /* FIXME, these should probably be restricted to a Fortran-specific
@@ -408,6 +421,11 @@ struct type
 
        struct cplus_struct_type *cplus_stuff;
 
+       /* FLOATFORMAT is for TYPE_CODE_FLT.  It is a pointer to the
+           floatformat object that describes the floating-point value
+           that resides within the type.  */
+
+       const struct floatformat *floatformat;
       }
     type_specific;
   };
@@ -717,6 +735,7 @@ extern void allocate_cplus_struct_type (struct type *);
 #define        TYPE_TYPE_SPECIFIC(thistype) (thistype)->type_specific
 #define TYPE_ARG_TYPES(thistype) (thistype)->type_specific.arg_types
 #define TYPE_CPLUS_SPECIFIC(thistype) (thistype)->type_specific.cplus_stuff
+#define TYPE_FLOATFORMAT(thistype) (thistype)->type_specific.floatformat
 #define TYPE_BASECLASS(thistype,index) (thistype)->fields[index].type
 #define TYPE_N_BASECLASSES(thistype) TYPE_CPLUS_SPECIFIC(thistype)->n_baseclasses
 #define TYPE_BASECLASS_NAME(thistype,index) (thistype)->fields[index].name
@@ -845,9 +864,20 @@ extern struct type *builtin_type_string;
 extern struct type *builtin_type_bool;
 
 /* Address/pointer types: */
-/* (C) Language pointer type. Some target platforms use an implicitly
-   {sign,zero} -extended 32 bit C language pointer on a 64 bit ISA. */
-extern struct type *builtin_type_ptr;
+/* (C) Language `pointer to data' type.  Some target platforms use an
+   implicitly {sign,zero} -extended 32 bit C language pointer on a 64
+   bit ISA.  */
+extern struct type *builtin_type_void_data_ptr;
+
+/* (C) Language `pointer to function returning void' type.  Since
+   ANSI, C standards have explicitly said that pointers to functions
+   and pointers to data are not interconvertible --- that is, you
+   can't cast a function pointer to void * and back, and expect to get
+   the same value.  However, all function pointer types are
+   interconvertible, so void (*) () can server as a generic function
+   pointer.  */
+extern struct type *builtin_type_void_func_ptr;
+
 /* The target CPU's address type.  This is the ISA address size. */
 extern struct type *builtin_type_CORE_ADDR;
 /* The symbol table address type.  Some object file formats have a 32
@@ -872,6 +902,24 @@ extern struct type *builtin_type_v8qi;
 extern struct type *builtin_type_v4hi;
 extern struct type *builtin_type_v2si;
 
+/* Explicit floating-point formats.  See "floatformat.h".  */
+extern struct type *builtin_type_ieee_single_big;
+extern struct type *builtin_type_ieee_single_little;
+extern struct type *builtin_type_ieee_double_big;
+extern struct type *builtin_type_ieee_double_little;
+extern struct type *builtin_type_ieee_double_littlebyte_bigword;
+extern struct type *builtin_type_i387_ext;
+extern struct type *builtin_type_m68881_ext;
+extern struct type *builtin_type_i960_ext;
+extern struct type *builtin_type_m88110_ext;
+extern struct type *builtin_type_m88110_harris_ext;
+extern struct type *builtin_type_arm_ext_big;
+extern struct type *builtin_type_arm_ext_littlebyte_bigword;
+extern struct type *builtin_type_ia64_spill_big;
+extern struct type *builtin_type_ia64_spill_little;
+extern struct type *builtin_type_ia64_quad_big;
+extern struct type *builtin_type_ia64_quad_little;
+
 /* We use this for the '/c' print format, because builtin_type_char is
    just a one-byte integral type, which languages less laid back than
    C will print as ... well, a one-byte integral type.  */
@@ -905,11 +953,10 @@ extern struct type *builtin_type_chill_real;
 
 extern struct type *builtin_type_f_character;
 extern struct type *builtin_type_f_integer;
+extern struct type *builtin_type_f_integer_s2;
 extern struct type *builtin_type_f_logical;
 extern struct type *builtin_type_f_logical_s1;
 extern struct type *builtin_type_f_logical_s2;
-extern struct type *builtin_type_f_integer;
-extern struct type *builtin_type_f_integer_s2;
 extern struct type *builtin_type_f_real;
 extern struct type *builtin_type_f_real_s8;
 extern struct type *builtin_type_f_real_s16;
@@ -924,12 +971,12 @@ extern struct type *builtin_type_f_void;
 /* Maximum and minimum values of built-in types */
 
 #define        MAX_OF_TYPE(t)  \
-   TYPE_UNSIGNED(t) ? UMAX_OF_SIZE(TYPE_LENGTH(t)) \
-    : MAX_OF_SIZE(TYPE_LENGTH(t))
+   (TYPE_UNSIGNED(t) ? UMAX_OF_SIZE(TYPE_LENGTH(t)) \
+    : MAX_OF_SIZE(TYPE_LENGTH(t)))
 
 #define MIN_OF_TYPE(t) \
-   TYPE_UNSIGNED(t) ? UMIN_OF_SIZE(TYPE_LENGTH(t)) \
-    : MIN_OF_SIZE(TYPE_LENGTH(t))
+   (TYPE_UNSIGNED(t) ? UMIN_OF_SIZE(TYPE_LENGTH(t)) \
+    : MIN_OF_SIZE(TYPE_LENGTH(t)))
 
 /* Allocate space for storing data associated with a particular type.
    We ensure that the space is allocated using the same mechanism that
@@ -1125,8 +1172,4 @@ extern int is_integral_type (struct type *);
 
 extern void maintenance_print_type (char *, int);
 
-/* typeprint.c */
-
-extern void print_type_scalar (struct type *, LONGEST, struct ui_file *);
-
 #endif /* GDBTYPES_H */
This page took 0.026544 seconds and 4 git commands to generate.