aboutsummaryrefslogtreecommitdiff
path: root/gdb/symtab.c
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1994-04-28 21:38:15 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1994-04-28 21:38:15 +0000
commita0cf46812cd57a8561ed6399b4aff14259374407 (patch)
tree1be91dbe776fc9c2716ef37479e92ccaf9e9edd2 /gdb/symtab.c
parent21ad7c45a4061b7239c8729bf2a9e308a15301fc (diff)
downloadgdb-a0cf46812cd57a8561ed6399b4aff14259374407.zip
gdb-a0cf46812cd57a8561ed6399b4aff14259374407.tar.gz
gdb-a0cf46812cd57a8561ed6399b4aff14259374407.tar.bz2
* utils.c, defs.h (error_begin): New function.
(quit): Print annotation before printing the error message. * main.c (return_to_top_level): Print annotation before doing the longjmp. * symtab.c (decode_line_1): Call error not warning and then return_to_top_level. Call error_begin and printf_unfiltered rather calling warning (before calls to return_to_top_level). * core.c (memory_error): Use error_begin, printf_unfiltered, print_address_numeric and return_to_top_level instead of error. Cleans up a FIXME-32x64. * language.c (type_error, range_error): Call error_begin not just target_terminal_ours.
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r--gdb/symtab.c36
1 files changed, 22 insertions, 14 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c
index f9eaf86..dfe5ac8 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -1038,8 +1038,14 @@ find_pc_symtab (pc)
return (s);
}
+#if 0
+
/* Find the closest symbol value (of any sort -- function or variable)
- for a given address value. Slow but complete. */
+ for a given address value. Slow but complete. (currently unused,
+ mainly because it is too slow. We could fix it if each symtab and
+ psymtab had contained in it the addresses ranges of each of its
+ sections, which also would be required to make things like "info
+ line *0x2345" cause psymtabs to be converted to symtabs). */
struct symbol *
find_addr_symbol (addr, symtabp, symaddrp)
@@ -1110,7 +1116,7 @@ find_addr_symbol (addr, symtabp, symaddrp)
*symaddrp = best_sym_addr;
return best_sym;
}
-
+#endif /* 0 */
/* Find the source file and line number for a given PC value.
Return a structure containing a symtab pointer, a line number,
@@ -1863,10 +1869,7 @@ decode_line_1 (argptr, funfirstline, default_symtab, default_line, canonical)
while(!++p && *p != '>');
if (!p)
{
- /* FIXME: Why warning() and then return_to_top_level?
- What's wrong with error()? */
- warning("non-matching '<' and '>' in command");
- return_to_top_level (RETURN_ERROR);
+ error ("non-matching '<' and '>' in command");
}
}
if (p[0] == ':' || p[0] == ' ' || p[0] == '\t')
@@ -1923,7 +1926,8 @@ decode_line_1 (argptr, funfirstline, default_symtab, default_line, canonical)
opname = cplus_mangle_opname (tmp, DMGL_ANSI);
if (opname == NULL)
{
- warning ("no mangling for \"%s\"", tmp);
+ error_begin ();
+ printf_unfiltered ("no mangling for \"%s\"\n", tmp);
cplusplus_hint (saved_arg);
return_to_top_level (RETURN_ERROR);
}
@@ -2015,21 +2019,25 @@ decode_line_1 (argptr, funfirstline, default_symtab, default_line, canonical)
}
else
tmp = copy;
+ error_begin ();
if (tmp[0] == '~')
- warning ("the class `%s' does not have destructor defined",
- SYMBOL_SOURCE_NAME(sym_class));
+ printf_unfiltered
+ ("the class `%s' does not have destructor defined\n",
+ SYMBOL_SOURCE_NAME(sym_class));
else
- warning ("the class %s does not have any method named %s",
- SYMBOL_SOURCE_NAME(sym_class), tmp);
+ printf_unfiltered
+ ("the class %s does not have any method named %s\n",
+ SYMBOL_SOURCE_NAME(sym_class), tmp);
cplusplus_hint (saved_arg);
return_to_top_level (RETURN_ERROR);
}
}
else
{
+ error_begin ();
/* The quotes are important if copy is empty. */
- warning ("can't find class, struct, or union named \"%s\"",
- copy);
+ printf_unfiltered
+ ("can't find class, struct, or union named \"%s\"\n", copy);
cplusplus_hint (saved_arg);
return_to_top_level (RETURN_ERROR);
}
@@ -2338,7 +2346,7 @@ decode_line_2 (sym_arr, nelts, funfirstline, canonical)
printf_unfiltered("%s ",prompt);
gdb_flush(gdb_stdout);
- args = command_line_input ((char *) NULL, 0);
+ args = command_line_input ((char *) NULL, 0, "overload-choice");
if (args == 0 || *args == 0)
error_no_arg ("one or more choice numbers");