Print C++ constructor methods without bogus "return type."

This commit is contained in:
Per Bothner 1992-01-27 03:08:01 +00:00
parent cdb90e99e7
commit 24b2fbdc54
2 changed files with 18 additions and 9 deletions

View File

@ -1,3 +1,8 @@
Sun Jan 26 19:05:40 1992 Per Bothner (bothner at cygnus.com)
* valprint.c (type_print_base, type_print_method_args):
Print C++ constructor methods without bogus "return type."
Sat Jan 25 15:57:59 1992 Fred Fish (fnf at cygnus.com)
* infptrace.c (child_xfer_memory): Parameter "target" should

View File

@ -1319,7 +1319,6 @@ type_print_method_args (args, prefix, varstring, staticp, stream)
{
int i;
fputs_filtered (" ", stream);
fputs_demangled (prefix, stream, 1);
fputs_demangled (varstring, stream, 1);
fputs_filtered (" (", stream);
@ -1698,7 +1697,8 @@ type_print_base (type, stream, show, level)
{
struct fn_field *f = TYPE_FN_FIELDLIST1 (type, i);
int j, len2 = TYPE_FN_FIELDLIST_LENGTH (type, i);
char *method_name = TYPE_FN_FIELDLIST_NAME (type, i);
int is_constructor = strcmp(method_name, TYPE_NAME (type)) == 0;
for (j = 0; j < len2; j++)
{
QUIT;
@ -1714,20 +1714,24 @@ type_print_base (type, stream, show, level)
TYPE_FN_FIELD_PHYSNAME (f, j));
break;
}
else
type_print (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)), "", stream, 0);
if (TYPE_FLAGS (TYPE_FN_FIELD_TYPE (f, j)) & TYPE_FLAG_STUB)
else if (!is_constructor)
{
type_print (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)),
"", stream, 0);
fputs_filtered (" ", stream);
}
if (TYPE_FN_FIELD_STUB (f, j))
{
/* Build something we can demangle. */
char *strchr (), *gdb_mangle_name (), *cplus_demangle ();
char *mangled_name = gdb_mangle_name (type, i, j);
char *demangled_name = cplus_demangle (mangled_name, 1);
if (demangled_name == 0)
fprintf_filtered (stream, " <badly mangled name %s>",
fprintf_filtered (stream, "<badly mangled name %s>",
mangled_name);
else
{
fprintf_filtered (stream, " %s",
fprintf_filtered (stream, "%s",
strchr (demangled_name, ':') + 2);
free (demangled_name);
}
@ -1737,11 +1741,11 @@ type_print_base (type, stream, show, level)
&& TYPE_FN_FIELD_PHYSNAME (f, j)[1] == CPLUS_MARKER)
type_print_method_args
(TYPE_FN_FIELD_ARGS (f, j) + 1, "~",
TYPE_FN_FIELDLIST_NAME (type, i), 0, stream);
method_name, 0, stream);
else
type_print_method_args
(TYPE_FN_FIELD_ARGS (f, j), "",
TYPE_FN_FIELDLIST_NAME (type, i),
method_name,
TYPE_FN_FIELD_STATIC_P (f, j), stream);
fprintf_filtered (stream, ";\n");