Fix the gdb build with GCC 7
[deliverable/binutils-gdb.git] / gdb / p-valprint.c
index a3738a9252d11104777802f42436be50f8c857be..198d6b6c3e4a3e5c858c6d936b437104b3f3d67e 100644 (file)
@@ -39,6 +39,7 @@
 #include "cp-support.h"
 #include "objfiles.h"
 #include "gdbsupport/byte-vector.h"
+#include "cli/cli-style.h"
 \f
 
 /* Decorations for Pascal.  */
@@ -66,7 +67,7 @@ pascal_val_print (struct type *type,
                  const struct value_print_options *options)
 {
   struct gdbarch *gdbarch = get_type_arch (type);
-  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+  enum bfd_endian byte_order = type_byte_order (type);
   unsigned int i = 0;  /* Number of characters printed */
   unsigned len;
   struct type *elttype;
@@ -239,7 +240,7 @@ pascal_val_print (struct type *type,
              if (want_space)
                fputs_filtered (" ", stream);
              fputs_filtered ("<", stream);
-             fputs_filtered (MSYMBOL_PRINT_NAME (msymbol.minsym), stream);
+             fputs_filtered (msymbol.minsym->print_name (), stream);
              fputs_filtered (">", stream);
              want_space = 1;
            }
@@ -254,8 +255,7 @@ pascal_val_print (struct type *type,
 
              if (msymbol.minsym != NULL)
                {
-                 const char *search_name
-                   = MSYMBOL_SEARCH_NAME (msymbol.minsym);
+                 const char *search_name = msymbol.minsym->search_name ();
                  wsym = lookup_symbol_search_name (search_name, NULL,
                                                    VAR_DOMAIN).symbol;
                }
@@ -347,7 +347,7 @@ pascal_val_print (struct type *type,
       elttype = check_typedef (elttype);
       if (TYPE_STUB (elttype))
        {
-         fprintf_filtered (stream, "<incomplete type>");
+         fprintf_styled (stream, metadata_style.style (), "<incomplete type>");
          break;
        }
       else
@@ -370,7 +370,7 @@ pascal_val_print (struct type *type,
        maybe_bad_bstring:
          if (bound_info < 0)
            {
-             fputs_filtered ("<error value>", stream);
+             fputs_styled ("<error value>", metadata_style.style (), stream);
              goto done;
            }
 
@@ -557,7 +557,7 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr,
                               options, dont_print_vb);
 
   if (!len && n_baseclasses == 1)
-    fprintf_filtered (stream, "<No data fields>");
+    fprintf_styled (stream, metadata_style.style (), "<No data fields>");
   else
     {
       struct obstack tmp_obstack = dont_print_statmem_obstack;
@@ -622,7 +622,8 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr,
                 order problems.  */
              if (TYPE_FIELD_IGNORE (type, i))
                {
-                 fputs_filtered ("<optimized out or zero length>", stream);
+                 fputs_styled ("<optimized out or zero length>",
+                               metadata_style.style (), stream);
                }
              else if (value_bits_synthetic_pointer (val,
                                                     TYPE_FIELD_BITPOS (type,
@@ -630,7 +631,8 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr,
                                                     TYPE_FIELD_BITSIZE (type,
                                                                         i)))
                {
-                 fputs_filtered (_("<synthetic pointer>"), stream);
+                 fputs_styled (_("<synthetic pointer>"),
+                               metadata_style.style (), stream);
                }
              else
                {
@@ -647,7 +649,8 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr,
            {
              if (TYPE_FIELD_IGNORE (type, i))
                {
-                 fputs_filtered ("<optimized out or zero length>", stream);
+                 fputs_styled ("<optimized out or zero length>",
+                               metadata_style.style (), stream);
                }
              else if (field_is_static (&TYPE_FIELD (type, i)))
                {
@@ -862,9 +865,9 @@ pascal_object_print_static_field (struct value *val,
        {
          if (value_address (val) == first_dont_print[i])
            {
-             fputs_filtered ("\
-<same as static member of an already seen type>",
-                             stream);
+             fputs_styled (_("\
+<same as static member of an already seen type>"),
+                           metadata_style.style (), stream);
              return;
            }
        }
This page took 0.027852 seconds and 4 git commands to generate.