#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,
- ¤t_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. */
return (0);
}
\f
-int
+void
c_value_print (struct value *val, struct ui_file *stream,
const struct value_print_options *options)
{
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);
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. */
}
/* 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);
}