Modified Files:
authorKung Hsu <kung@cygnus>
Sat, 6 Nov 1993 01:32:11 +0000 (01:32 +0000)
committerKung Hsu <kung@cygnus>
Sat, 6 Nov 1993 01:32:11 +0000 (01:32 +0000)
gdbtypes.h stabsread.c cp-valprint.c ChangeLog

        * gdbtypes.h : add a field 'ignore_field_bits in cplus_specific,
        and macros to handle the bits.
        * stabsread.c (read_one_struct_field): add VISIBILITY_IGNORE, and
        for field of length 0, set this bit on.
        * cp-valprint.c (cp_print_value_fields): for VISIBILITY_IGNORE
        field, print <no value>.

gdb/ChangeLog
gdb/cp-valprint.c
gdb/gdbtypes.h
gdb/stabsread.c

index 9e483d83df43939d1af7d73ce971b1de40e7ceb7..d346183859d316595c8ce2c45ac4e068aac21d63 100644 (file)
@@ -1,3 +1,12 @@
+Fri Nov  5 17:19:30 1993  Kung Hsu  (kung@cirdan.cygnus.com)
+
+       * gdbtypes.h : add a field 'ignore_field_bits in cplus_specific,
+       and macros to handle the bits.
+       * stabsread.c (read_one_struct_field): add VISIBILITY_IGNORE, and
+       for field of length 0, set this bit on.
+       * cp-valprint.c (cp_print_value_fields): for VISIBILITY_IGNORE
+       field, print <no value>.
+
 Fri Nov  5 14:43:46 1993  Jim Kingdon  (kingdon@lioth.cygnus.com)
 
        * Version 4.11.2.
index cce1f191407e728eb633d529123b3b11f042e9f3..806687ebd8b81d092cd98c546e15e82fd0c4abb8 100644 (file)
@@ -296,17 +296,31 @@ cp_print_value_fields (type, valaddr, stream, format, recurse, pretty,
 
              /* Bitfields require special handling, especially due to byte
                 order problems.  */
-             v = value_from_longest (TYPE_FIELD_TYPE (type, i),
+             if (TYPE_FIELD_IGNORE (type, i))
+               {
+                  fputs_filtered ("<no value>", stream);
+               }
+             else
+               {
+                  v = value_from_longest (TYPE_FIELD_TYPE (type, i),
                                   unpack_field_as_long (type, valaddr, i));
 
-             c_val_print (TYPE_FIELD_TYPE (type, i), VALUE_CONTENTS (v), 0,
+                   c_val_print (TYPE_FIELD_TYPE(type, i), VALUE_CONTENTS (v), 0,
                           stream, format, 0, recurse + 1, pretty);
+               }
            }
          else
            {
-             c_val_print (TYPE_FIELD_TYPE (type, i), 
+             if (TYPE_FIELD_IGNORE (type, i))
+               {
+                  fputs_filtered ("<no value>", stream);
+               }
+             else
+               {
+                  c_val_print (TYPE_FIELD_TYPE (type, i), 
                           valaddr + TYPE_FIELD_BITPOS (type, i) / 8,
                           0, stream, format, 0, recurse + 1, pretty);
+               }
            }
        }
       if (pretty)
index 2ab04060681fd1f3938a5fd3b3b5e74afa833bf6..84abd86eeb9e6cff941f23eca9ee7bb92c87e9dd 100644 (file)
@@ -347,6 +347,11 @@ struct cplus_struct_type
 
   B_TYPE *protected_field_bits;
 
+  /* for classes with fields to be ignored, either this is optimized out
+     or this field has length 0 */
+
+  B_TYPE *ignore_field_bits;
+
   /* For classes, structures, and unions, a description of each field,
      which consists of an overloaded name, followed by the types of
      arguments that the method expects, and then the name after it
@@ -484,12 +489,16 @@ allocate_cplus_struct_type PARAMS ((struct type *));
   TYPE_CPLUS_SPECIFIC(thistype)->private_field_bits
 #define TYPE_FIELD_PROTECTED_BITS(thistype) \
   TYPE_CPLUS_SPECIFIC(thistype)->protected_field_bits
+#define TYPE_FIELD_IGNORE_BITS(thistype) \
+  TYPE_CPLUS_SPECIFIC(thistype)->ignore_field_bits
 #define TYPE_FIELD_VIRTUAL_BITS(thistype) \
   TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits
 #define SET_TYPE_FIELD_PRIVATE(thistype, n) \
   B_SET (TYPE_CPLUS_SPECIFIC(thistype)->private_field_bits, (n))
 #define SET_TYPE_FIELD_PROTECTED(thistype, n) \
   B_SET (TYPE_CPLUS_SPECIFIC(thistype)->protected_field_bits, (n))
+#define SET_TYPE_FIELD_IGNORE(thistype, n) \
+  B_SET (TYPE_CPLUS_SPECIFIC(thistype)->ignore_field_bits, (n))
 #define SET_TYPE_FIELD_VIRTUAL(thistype, n) \
   B_SET (TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits, (n))
 #define TYPE_FIELD_PRIVATE(thistype, n) \
@@ -498,6 +507,9 @@ allocate_cplus_struct_type PARAMS ((struct type *));
 #define TYPE_FIELD_PROTECTED(thistype, n) \
   (TYPE_CPLUS_SPECIFIC(thistype)->protected_field_bits == NULL ? 0 \
     : B_TST(TYPE_CPLUS_SPECIFIC(thistype)->protected_field_bits, (n)))
+#define TYPE_FIELD_IGNORE(thistype, n) \
+  (TYPE_CPLUS_SPECIFIC(thistype)->ignore_field_bits == NULL ? 0 \
+    : B_TST(TYPE_CPLUS_SPECIFIC(thistype)->ignore_field_bits, (n)))
 #define TYPE_FIELD_VIRTUAL(thistype, n) \
        B_TST(TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits, (n))
 
index ddb18c963a0de7364fc5b8193ae7e1712891753f..c35ea6c8087e0b3c19520ee103711b881aaaa83a 100644 (file)
@@ -1730,6 +1730,7 @@ rs6000_builtin_type (typenum)
 #define VISIBILITY_PRIVATE     '0'     /* Stabs character for private field */
 #define VISIBILITY_PROTECTED   '1'     /* Stabs character for protected fld */
 #define VISIBILITY_PUBLIC      '2'     /* Stabs character for public field */
+#define VISIBILITY_IGNORE      '9'     /* artificial character for ignore the                                             field */ 
 
 /* Read member function stabs info for C++ classes.  The form of each member
    function data is:
@@ -2217,7 +2218,9 @@ read_one_struct_field (fip, pp, p, type, objfile)
        return;
       }
   }
-#if 0
+  /* kung: I add a new visibility type VISIBILITY_IGNORE, so that
+     when printing value, this field will print <no value>. ptype
+     will still print the type info of the field. */
   /* FIXME-tiemann: Can't the compiler put out something which
      lets us distinguish these? (or maybe just not put out anything
      for the field).  What is the story here?  What does the compiler
@@ -2240,12 +2243,11 @@ read_one_struct_field (fip, pp, p, type, objfile)
      stuff.  */
   if (fip -> list -> field.bitpos == 0 && fip -> list -> field.bitsize == 0)
     {
-      complain (&dbx_class_complaint);
+      /* complain (&dbx_class_complaint); */
       /* Ignore this field.  */
-      fip -> list = fip -> list -> next;
+      fip -> list-> visibility = VISIBILITY_IGNORE;
     }
   else
-#endif /* 0 */
     {
       /* Detect an unpacked field and mark it as such.
         dbx gives a bit size for all fields.
@@ -2664,6 +2666,10 @@ attach_fields_to_type (fip, type, objfile)
       TYPE_FIELD_PROTECTED_BITS (type) =
        (B_TYPE *) TYPE_ALLOC (type, B_BYTES (nfields));
       B_CLRALL (TYPE_FIELD_PROTECTED_BITS (type), nfields);
+
+      TYPE_FIELD_IGNORE_BITS (type) =
+       (B_TYPE *) TYPE_ALLOC (type, B_BYTES (nfields));
+      B_CLRALL (TYPE_FIELD_IGNORE_BITS (type), nfields);
     }
 
   /* Copy the saved-up fields into the field vector.  Start from the head
@@ -2683,6 +2689,9 @@ attach_fields_to_type (fip, type, objfile)
            SET_TYPE_FIELD_PROTECTED (type, nfields);
            break;
 
+         case VISIBILITY_IGNORE:
+           SET_TYPE_FIELD_IGNORE (type, nfields);
+
          case VISIBILITY_PUBLIC:
            break;