Fixes related to handling of C++ methods (handle destructors

and parameters that are functions).
This commit is contained in:
Per Bothner
1991-11-12 22:20:02 +00:00
parent 5f12485297
commit 0e2a896cf5
5 changed files with 56 additions and 29 deletions

View File

@ -1270,6 +1270,18 @@ lookup_partial_symbol (pst, name, global, namespace)
return (struct partial_symbol *) 0;
}
/* Find the psymtab containing main(). */
struct partial_symtab *
find_main_psymtab ()
{
register struct partial_symtab *pst;
for (pst = partial_symtab_list; pst; pst = pst->next)
if (lookup_partial_symbol (pst, "main", 1, VAR_NAMESPACE))
return pst;
return NULL;
}
/* Look for a symbol in block BLOCK. */
struct symbol *
@ -1930,7 +1942,6 @@ decode_line_1 (argptr, funfirstline, default_symtab, default_line)
}
while (p[0] == ' ' || p[0] == '\t') p++;
q = operator_chars (*argptr, &q1);
if (p[0] == ':')
{
@ -2043,7 +2054,12 @@ decode_line_1 (argptr, funfirstline, default_symtab, default_line)
}
else
tmp = copy;
error ("that class does not have any method named %s", tmp);
if (tmp[0] == '~')
error ("The class `%s' does not have destructor defined",
sym_class->name);
else
error ("The class %s does not have any method named %s",
sym_class->name, tmp);
}
}
else