int vtblprint; /* Controls printing of vtbl's */
int objectprint; /* Controls looking up an object's derived type
using what we find in its vtables. */
-static int static_field_print; /* Controls printing of static fields. */
+int static_field_print; /* Controls printing of static fields. */
static struct obstack dont_print_vb_obstack;
static struct obstack dont_print_statmem_obstack;
QUIT;
if (TYPE_FN_FIELD_VOFFSET (f, j) == offset)
{
+ if (TYPE_FN_FIELD_STUB (f, j))
+ check_stub_method (domain, i, j);
kind = "virtual ";
goto common;
}
common:
if (i < len)
{
+ char *demangled_name;
+
fprintf_filtered (stream, "&");
- c_type_print_varspec_prefix (TYPE_FN_FIELD_TYPE (f, j), stream, 0, 0);
- fprintf_unfiltered (stream, kind);
- if (TYPE_FN_FIELD_PHYSNAME (f, j)[0] == '_'
- && is_cplus_marker (TYPE_FN_FIELD_PHYSNAME (f, j)[1]))
- {
- cp_type_print_method_args (TYPE_FN_FIELD_ARGS (f, j) + 1, "~",
- TYPE_FN_FIELDLIST_NAME (domain, i),
- 0, stream);
- }
+ fprintf_filtered (stream, kind);
+ demangled_name = cplus_demangle (TYPE_FN_FIELD_PHYSNAME (f, j),
+ DMGL_ANSI | DMGL_PARAMS);
+ if (demangled_name == NULL)
+ fprintf_filtered (stream, "<badly mangled name %s>",
+ TYPE_FN_FIELD_PHYSNAME (f, j));
else
{
- cp_type_print_method_args (TYPE_FN_FIELD_ARGS (f, j), "",
- TYPE_FN_FIELDLIST_NAME (domain, i),
- 0, stream);
+ fputs_filtered (demangled_name, stream);
+ free (demangled_name);
}
}
else
}
else if (TYPE_FIELD_STATIC (type, i))
{
- value_ptr v;
- char *phys_name = TYPE_FIELD_STATIC_PHYSNAME (type, i);
- struct symbol *sym =
- lookup_symbol (phys_name, 0, VAR_NAMESPACE, 0, NULL);
- if (sym == NULL)
+ value_ptr v = value_static_field (type, i);
+ if (v == NULL)
fputs_filtered ("<optimized out>", stream);
else
- {
- v = value_at (TYPE_FIELD_TYPE (type, i),
- SYMBOL_VALUE_ADDRESS (sym));
- cp_print_static_field (TYPE_FIELD_TYPE (type, i), v,
- stream, format, recurse + 1,
- pretty);
- }
+ cp_print_static_field (TYPE_FIELD_TYPE (type, i), v,
+ stream, format, recurse + 1,
+ pretty);
}
else
{