* gdbtypes.h (TYPE_FLAG_STUB_SUPPORTED, TYPE_STUB_SUPPORTED): New
authorJan Kratochvil <jan.kratochvil@redhat.com>
Wed, 11 Apr 2007 16:04:23 +0000 (16:04 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Wed, 11 Apr 2007 16:04:23 +0000 (16:04 +0000)
macros.
(TYPE_IS_OPAQUE): Empty vs. opaque structures are now
distinct on the TYPE_STUB_SUPPORTED debug targets.
* dwarf2read.c (read_structure_type): Set TYPE_FLAG_STUB_SUPPORTED.

gdb/ChangeLog
gdb/dwarf2read.c
gdb/gdbtypes.h

index 0e7168fb75737b8f8355a5d42af3e92fba9a5553..eb7d253afac0a3fe568a3f44098db71ad100b164 100644 (file)
@@ -1,3 +1,11 @@
+2007-04-11  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * gdbtypes.h (TYPE_FLAG_STUB_SUPPORTED, TYPE_STUB_SUPPORTED): New
+       macros.
+       (TYPE_IS_OPAQUE): Empty vs. opaque structures are now
+       distinct on the TYPE_STUB_SUPPORTED debug targets.
+       * dwarf2read.c (read_structure_type): Set TYPE_FLAG_STUB_SUPPORTED.
+
 2007-04-11  Joel Brobecker  <brobecker@adacore.com>
 
        * sparc-tdep.c (X_RS2): New macro.
index 0fb35006e0d50a099cfb154a203a859928f26acb..d0a1bb19d82ea2d12b0f26e65a66e43a5150c7ae 100644 (file)
@@ -3879,6 +3879,7 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu)
       TYPE_LENGTH (type) = 0;
     }
 
+  TYPE_FLAGS (type) |= TYPE_FLAG_STUB_SUPPORTED;
   if (die_is_declaration (die, cu))
     TYPE_FLAGS (type) |= TYPE_FLAG_STUB;
 
index 8cbd26ce49ea59f1d55b9fd48d6ec3cdc4480741..39ed5ccd15cea9f4d881e704b24e5b91ac2d00cb 100644 (file)
@@ -319,6 +319,14 @@ enum type_code
 
 #define TYPE_FLAG_FIXED_INSTANCE (1 << 15)
 
+/* This debug target supports TYPE_STUB(t).  In the unsupported case we have to
+   rely on NFIELDS to be zero etc., see TYPE_IS_OPAQUE ().
+   TYPE_STUB(t) with !TYPE_STUB_SUPPORTED(t) may exist if we only guessed
+   the TYPE_STUB(t) value (see dwarfread.c).  */
+
+#define TYPE_FLAG_STUB_SUPPORTED (1 << 16)
+#define TYPE_STUB_SUPPORTED(t)   (TYPE_FLAGS (t) & TYPE_FLAG_STUB_SUPPORTED)
+
 /*  Array bound type.  */
 enum array_bound_type
 {
@@ -969,7 +977,8 @@ extern void allocate_cplus_struct_type (struct type *);
 #define TYPE_IS_OPAQUE(thistype) (((TYPE_CODE (thistype) == TYPE_CODE_STRUCT) ||        \
                                    (TYPE_CODE (thistype) == TYPE_CODE_UNION))        && \
                                   (TYPE_NFIELDS (thistype) == 0)                     && \
-                                  (TYPE_CPLUS_SPECIFIC (thistype) && (TYPE_NFN_FIELDS (thistype) == 0)))
+                                  (TYPE_CPLUS_SPECIFIC (thistype) && (TYPE_NFN_FIELDS (thistype) == 0)) && \
+                                  (TYPE_STUB (thistype) || !TYPE_STUB_SUPPORTED (thistype)))
 
 struct builtin_type
 {