New global maintainer - Simon Marchi
[deliverable/binutils-gdb.git] / gdb / valprint.c
index b18ece371c5ea62446aa83782ffd78c316049823..6937dab7c63117ccaa2d130e23fa2eb4696c46fc 100644 (file)
@@ -1,6 +1,6 @@
 /* Print values for GDB, the GNU debugger.
 
-   Copyright (C) 1986-2016 Free Software Foundation, Inc.
+   Copyright (C) 1986-2017 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -281,7 +281,7 @@ int
 val_print_scalar_type_p (struct type *type)
 {
   type = check_typedef (type);
-  while (TYPE_CODE (type) == TYPE_CODE_REF)
+  while (TYPE_IS_REFERENCE (type))
     {
       type = TYPE_TARGET_TYPE (type);
       type = check_typedef (type);
@@ -536,7 +536,7 @@ get_value_addr_contents (struct value *deref_val)
     }
 }
 
-/* generic_val_print helper for TYPE_CODE_REF.  */
+/* generic_val_print helper for TYPE_CODE_{RVALUE_,}REF.  */
 
 static void
 generic_val_print_ref (struct type *type,
@@ -960,6 +960,7 @@ generic_val_print (struct type *type,
       break;
 
     case TYPE_CODE_REF:
+    case TYPE_CODE_RVALUE_REF:
       generic_val_print_ref (type, embedded_offset, stream, recurse,
                             original_value, options);
       break;
@@ -1098,9 +1099,7 @@ val_print (struct type *type, LONGEST embedded_offset,
 
   if (!options->raw)
     {
-      const gdb_byte *valaddr = value_contents_for_printing (val);
-
-      ret = apply_ext_lang_val_pretty_printer (type, valaddr, embedded_offset,
+      ret = apply_ext_lang_val_pretty_printer (type, embedded_offset,
                                               address, stream, recurse,
                                               val, options, language);
       if (ret)
@@ -1203,6 +1202,9 @@ common_val_print (struct value *val, struct ui_file *stream, int recurse,
        get a fixed representation of our value.  */
     val = ada_to_fixed_value (val);
 
+  if (value_lazy (val))
+    value_fetch_lazy (val);
+
   val_print (value_type (val),
             value_embedded_offset (val), value_address (val),
             stream, recurse,
@@ -1223,7 +1225,6 @@ value_print (struct value *val, struct ui_file *stream,
     {
       int r
        = apply_ext_lang_val_pretty_printer (value_type (val),
-                                            value_contents_for_printing (val),
                                             value_embedded_offset (val),
                                             value_address (val),
                                             stream, 0,
This page took 0.024688 seconds and 4 git commands to generate.