* linespec.c (symtab_from_filename): Also throw NOT_FOUND_ERROR if
	there are no symbols loaded, instead of throwing a generic error.
	(decode_variable): Likewise.

	gdb/testsuite/
	* gdb.base/pending.exp: Test pending breakpoints without symbols
	loaded.
This commit is contained in:
Pedro Alves
2008-08-20 11:47:57 +00:00
parent f1f6aadf8c
commit b96e292732
4 changed files with 46 additions and 6 deletions

View File

@@ -1556,10 +1556,11 @@ symtab_from_filename (char **argptr, char *p, int is_quote_enclosed,
file_symtab = lookup_symtab (copy);
if (file_symtab == 0)
{
if (!have_full_symbols () && !have_partial_symbols ())
error (_("No symbol table is loaded. Use the \"file\" command."));
if (not_found_ptr)
*not_found_ptr = 1;
if (!have_full_symbols () && !have_partial_symbols ())
throw_error (NOT_FOUND_ERROR,
_("No symbol table is loaded. Use the \"file\" command."));
throw_error (NOT_FOUND_ERROR, _("No source file named %s."), copy);
}
@@ -1760,12 +1761,14 @@ decode_variable (char *copy, int funfirstline, char ***canonical,
if (msymbol != NULL)
return minsym_found (funfirstline, msymbol);
if (!have_full_symbols () &&
!have_partial_symbols () && !have_minimal_symbols ())
error (_("No symbol table is loaded. Use the \"file\" command."));
if (not_found_ptr)
*not_found_ptr = 1;
if (!have_full_symbols ()
&& !have_partial_symbols ()
&& !have_minimal_symbols ())
throw_error (NOT_FOUND_ERROR,
_("No symbol table is loaded. Use the \"file\" command."));
throw_error (NOT_FOUND_ERROR, _("Function \"%s\" not defined."), copy);
}