aboutsummaryrefslogtreecommitdiff
path: root/gdb/linespec.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2008-08-20 11:47:57 +0000
committerPedro Alves <palves@redhat.com>2008-08-20 11:47:57 +0000
commitb96e292732664fd8c63970ca11c3a9ac92f60ff9 (patch)
treefd77c1bc06b3746813e801d7beed7e6158fa6277 /gdb/linespec.c
parentf1f6aadf8c572a21149a59d65adc49f2df5feeb6 (diff)
downloadfsf-binutils-gdb-b96e292732664fd8c63970ca11c3a9ac92f60ff9.zip
fsf-binutils-gdb-b96e292732664fd8c63970ca11c3a9ac92f60ff9.tar.gz
fsf-binutils-gdb-b96e292732664fd8c63970ca11c3a9ac92f60ff9.tar.bz2
gdb/
* 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.
Diffstat (limited to 'gdb/linespec.c')
-rw-r--r--gdb/linespec.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 953e726..f83936c 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -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);
}