* value.h (value_print): Return void.
[deliverable/binutils-gdb.git] / gdb / c-valprint.c
index 82551e9dc93173bf20da0ea4091b31b664fe8b61..98901ce5a8eb1a5f3b237d1898872542ca60c941 100644 (file)
 #include "target.h"
 \f
 
-/* Print function pointer with inferior address ADDRESS onto stdio
-   stream STREAM.  */
-
-static void
-print_function_pointer_address (struct gdbarch *gdbarch,
-                               CORE_ADDR address,
-                               struct ui_file *stream,
-                               int addressprint)
-{
-  CORE_ADDR func_addr
-    = gdbarch_convert_from_func_ptr_addr (gdbarch, address,
-                                         &current_target);
-
-  /* If the function pointer is represented by a description, print
-     the address of the description.  */
-  if (addressprint && func_addr != address)
-    {
-      fputs_filtered ("@", stream);
-      fputs_filtered (paddress (gdbarch, address), stream);
-      fputs_filtered (": ", stream);
-    }
-  print_address_demangle (gdbarch, func_addr, stream, demangle);
-}
-
-
 /* A helper for c_textual_element_type.  This checks the name of the
    typedef.  This is bogus but it isn't apparent that the compiler
    provides us the help we may need.  */
@@ -669,7 +644,7 @@ c_val_print (struct type *type, const gdb_byte *valaddr,
   return (0);
 }
 \f
-int
+void
 c_value_print (struct value *val, struct ui_file *stream, 
               const struct value_print_options *options)
 {
@@ -728,22 +703,13 @@ c_value_print (struct value *val, struct ui_file *stream,
 
          if (value_entirely_available (val))
            {
-             real_type = value_rtti_target_type (val, &full, &top, &using_enc);
+             real_type = value_rtti_indirect_type (val, &full, &top,
+                                                   &using_enc);
              if (real_type)
                {
                  /* RTTI entry found.  */
-                 if (TYPE_CODE (type) == TYPE_CODE_PTR)
-                   {
-                     /* Create a pointer type pointing to the real
-                        type.  */
-                     type = lookup_pointer_type (real_type);
-                   }
-                 else
-                   {
-                     /* Create a reference type referencing the real
-                        type.  */
-                     type = lookup_reference_type (real_type);
-                   }
+                 type = real_type;
+
                  /* Need to adjust pointer value.  */
                  val = value_from_pointer (type, value_as_address (val) - top);
 
@@ -782,10 +748,11 @@ c_value_print (struct value *val, struct ui_file *stream,
                            full ? "" : _(" [incomplete object]"));
          /* Print out object: enclosing type is same as real_type if
             full.  */
-         return val_print (value_enclosing_type (val),
-                           value_contents_for_printing (val), 0,
-                           value_address (val), stream, 0,
-                           val, &opts, current_language);
+         val_print (value_enclosing_type (val),
+                    value_contents_for_printing (val), 0,
+                    value_address (val), stream, 0,
+                    val, &opts, current_language);
+         return;
           /* Note: When we look up RTTI entries, we don't get any
              information on const or volatile attributes.  */
        }
@@ -794,17 +761,18 @@ c_value_print (struct value *val, struct ui_file *stream,
          /* No RTTI information, so let's do our best.  */
          fprintf_filtered (stream, "(%s ?) ",
                            TYPE_NAME (value_enclosing_type (val)));
-         return val_print (value_enclosing_type (val),
-                           value_contents_for_printing (val), 0,
-                           value_address (val), stream, 0,
-                           val, &opts, current_language);
+         val_print (value_enclosing_type (val),
+                    value_contents_for_printing (val), 0,
+                    value_address (val), stream, 0,
+                    val, &opts, current_language);
+         return;
        }
       /* Otherwise, we end up at the return outside this "if".  */
     }
 
-  return val_print (val_type, value_contents_for_printing (val),
-                   value_embedded_offset (val),
-                   value_address (val),
-                   stream, 0,
-                   val, &opts, current_language);
+  val_print (val_type, value_contents_for_printing (val),
+            value_embedded_offset (val),
+            value_address (val),
+            stream, 0,
+            val, &opts, current_language);
 }
This page took 0.028853 seconds and 4 git commands to generate.