* dbxread.c (discarding_local_symbols_complaint): New complaint.
[binutils-gdb.git] / gdb / gdbtypes.h
index 8ceed9d7940714160458e4ab7a62f86ca08a7b5d..0411aaacb623f814f085ce375468bade034a93c2 100644 (file)
@@ -1,5 +1,5 @@
 /* Internal type definitions for GDB.
-   Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+   Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
    Free Software Foundation, Inc.
    Contributed by Cygnus Support, using pieces from other GDB modules.
 
@@ -248,6 +248,13 @@ enum type_code
 #define TYPE_FLAG_VARARGS      (1 << 11)
 #define TYPE_VARARGS(t)                ((t)->flags & TYPE_FLAG_VARARGS)
 
+/* Identify a vector type.  Gcc is handling this by adding an extra
+   attribute to the array type.  We slurp that in as a new flag of a
+   type.  This is used only in dwarf2read.c.  */
+#define TYPE_FLAG_VECTOR       (1 << 12)
+#define TYPE_VECTOR(t)         ((t)->flags & TYPE_FLAG_VECTOR)
+
+
 struct type
   {
 
@@ -383,17 +390,12 @@ struct type
 
     struct field
       {
-
-
-
        union field_location
          {
            /* Position of this field, counting in bits from start of
               containing structure.
               For BITS_BIG_ENDIAN=1 targets, it is the bit offset to the MSB.
               For BITS_BIG_ENDIAN=0 targets, it is the bit offset to the LSB.
-              For a function type, this is the position in the argument list
-              of this argument.
               For a range bound or enum value, this is the value itself. */
 
            int bitpos;
@@ -404,6 +406,11 @@ struct type
 
            CORE_ADDR physaddr;
            char *physname;
+
+           /* For a function type, this is 1 if the argument is marked
+              artificial.  Artificial arguments should not be shown to the
+              user.  */
+           int artificial;
          }
        loc;
 
@@ -619,6 +626,7 @@ struct cplus_struct_type
            unsigned int is_final:1;
            unsigned int is_synchronized:1;
            unsigned int is_native:1;
+           unsigned int is_artificial:1;
 
            /* A stub method only has some fields valid (but they are enough
               to reconstruct the rest of the fields).  */
@@ -628,7 +636,7 @@ struct cplus_struct_type
            unsigned int is_inlined:1;
 
            /* Unused.  */
-           unsigned int dummy:4;
+           unsigned int dummy:3;
 
            /* Index into that baseclass's virtual function table,
               minus 2; else if static: VOFFSET_STATIC; else: 0.  */
@@ -796,6 +804,7 @@ extern void allocate_cplus_struct_type (struct type *);
 #define FIELD_TYPE(thisfld) ((thisfld).type)
 #define FIELD_NAME(thisfld) ((thisfld).name)
 #define FIELD_BITPOS(thisfld) ((thisfld).loc.bitpos)
+#define FIELD_ARTIFICIAL(thisfld) ((thisfld).loc.artificial)
 #define FIELD_BITSIZE(thisfld) ((thisfld).bitsize)
 #define FIELD_PHYSNAME(thisfld) ((thisfld).loc.physname)
 #define FIELD_PHYSADDR(thisfld) ((thisfld).loc.physaddr)
@@ -807,6 +816,7 @@ extern void allocate_cplus_struct_type (struct type *);
 #define TYPE_FIELD_TYPE(thistype, n) FIELD_TYPE(TYPE_FIELD(thistype, n))
 #define TYPE_FIELD_NAME(thistype, n) FIELD_NAME(TYPE_FIELD(thistype, n))
 #define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS(TYPE_FIELD(thistype,n))
+#define TYPE_FIELD_ARTIFICIAL(thistype, n) FIELD_ARTIFICIAL(TYPE_FIELD(thistype,n))
 #define TYPE_FIELD_BITSIZE(thistype, n) FIELD_BITSIZE(TYPE_FIELD(thistype,n))
 #define TYPE_FIELD_PACKED(thistype, n) (FIELD_BITSIZE(TYPE_FIELD(thistype,n))!=0)
 #define TYPE_TEMPLATE_ARG(thistype, n) TYPE_CPLUS_SPECIFIC(thistype)->template_args[n]
@@ -865,6 +875,7 @@ extern void allocate_cplus_struct_type (struct type *);
 #define TYPE_FN_FIELD_FINAL(thisfn, n) ((thisfn)[n].is_final)
 #define TYPE_FN_FIELD_SYNCHRONIZED(thisfn, n) ((thisfn)[n].is_synchronized)
 #define TYPE_FN_FIELD_NATIVE(thisfn, n) ((thisfn)[n].is_native)
+#define TYPE_FN_FIELD_ARTIFICIAL(thisfn, n) ((thisfn)[n].is_artificial)
 #define TYPE_FN_FIELD_ABSTRACT(thisfn, n) ((thisfn)[n].is_abstract)
 #define TYPE_FN_FIELD_STUB(thisfn, n) ((thisfn)[n].is_stub)
 #define TYPE_FN_FIELD_INLINED(thisfn, n) ((thisfn)[n].is_inlined)
@@ -1050,6 +1061,16 @@ extern struct type *alloc_type (struct objfile *);
 extern struct type *init_type (enum type_code, int, int, char *,
                               struct objfile *);
 
+/* Helper functions to construct a struct or record type.  An
+   initially empty type is created using init_composite_type().
+   Fields are then added using append_struct_type_field().  A union
+   type has its size set to the largest field.  A struct type has each
+   field packed against the previous.  */
+
+extern struct type *init_composite_type (char *name, enum type_code code);
+extern void append_composite_type_field (struct type *t, char *name,
+                                        struct type *field);
+
 extern struct type *lookup_reference_type (struct type *);
 
 extern struct type *make_reference_type (struct type *, struct type **);
@@ -1058,6 +1079,8 @@ extern struct type *make_cv_type (int, int, struct type *, struct type **);
 
 extern void finish_cv_type (struct type *);
 
+extern void replace_type (struct type *, struct type *);
+
 extern int address_space_name_to_int (char *);
 
 extern char *address_space_int_to_name (int);