Sync config.sub,config.guess with upstream.
[deliverable/binutils-gdb.git] / gdb / f-valprint.c
index 71bd2c3e2cca6a70f683ee0fe0037305b8086289..e1a677e9dd5e70e46ae102c7cc1c0de1b2d7a49c 100644 (file)
@@ -203,6 +203,8 @@ static const struct generic_val_print_decorations f_decorations =
   ".TRUE.",
   ".FALSE.",
   "VOID",
+  "{",
+  "}"
 };
 
 /* See val_print for a description of the various parameters of this
@@ -216,7 +218,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
 {
   struct gdbarch *gdbarch = get_type_arch (type);
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
-  unsigned int i = 0;  /* Number of characters printed.  */
+  int printed_field = 0; /* Number of fields printed.  */
   struct type *elttype;
   CORE_ADDR addr;
   int index;
@@ -290,8 +292,8 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
            {
              if (want_space)
                fputs_filtered (" ", stream);
-             i = val_print_string (TYPE_TARGET_TYPE (type), NULL, addr, -1,
-                                   stream, options);
+             val_print_string (TYPE_TARGET_TYPE (type), NULL, addr, -1,
+                               stream, options);
            }
          return;
        }
@@ -335,15 +337,32 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
          struct value *field = value_field
            ((struct value *)original_value, index);
 
-          val_print (value_type (field),
-                    value_contents_for_printing (field),
-                    value_embedded_offset (field),
-                    value_address (field), stream, recurse + 1,
-                    field, options, current_language);
+         struct type *field_type = check_typedef (TYPE_FIELD_TYPE (type, index));
 
-          if (index != TYPE_NFIELDS (type) - 1)
-            fputs_filtered (", ", stream);
-        }
+
+         if (TYPE_CODE (field_type) != TYPE_CODE_FUNC)
+           {
+             const char *field_name;
+
+             if (printed_field > 0)
+               fputs_filtered (", ", stream);
+
+             field_name = TYPE_FIELD_NAME (type, index);
+             if (field_name != NULL)
+               {
+                 fputs_filtered (field_name, stream);
+                 fputs_filtered (" = ", stream);
+               }
+
+             val_print (value_type (field),
+                        value_contents_for_printing (field),
+                        value_embedded_offset (field),
+                        value_address (field), stream, recurse + 1,
+                        field, options, current_language);
+
+             ++printed_field;
+           }
+        }
       fprintf_filtered (stream, " )");
       break;     
 
This page took 0.024141 seconds and 4 git commands to generate.