diff options
author | Jim Kingdon <jkingdon@engr.sgi.com> | 1994-04-28 21:38:15 +0000 |
---|---|---|
committer | Jim Kingdon <jkingdon@engr.sgi.com> | 1994-04-28 21:38:15 +0000 |
commit | a0cf46812cd57a8561ed6399b4aff14259374407 (patch) | |
tree | 1be91dbe776fc9c2716ef37479e92ccaf9e9edd2 /gdb/utils.c | |
parent | 21ad7c45a4061b7239c8729bf2a9e308a15301fc (diff) | |
download | gdb-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/utils.c')
-rw-r--r-- | gdb/utils.c | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/gdb/utils.c b/gdb/utils.c index d1a5e70..33501ba 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -250,6 +250,25 @@ warning (va_alist) va_end (args); } +/* Start the printing of an error message. Way to use this is to call + this, output the error message, and then call + return_to_top_level (RETURN_ERROR). error() provides a convenient way to + do this for the special case that the error message can be formatted with + a single printf call, but this is more general. */ +void +error_begin () +{ + target_terminal_ours (); + wrap_here (""); /* Force out any buffered output */ + gdb_flush (gdb_stdout); + + if (annotation_level > 1) + fprintf_filtered (gdb_stderr, "\n\032\032error-begin\n"); + + if (error_pre_print) + fprintf_filtered (gdb_stderr, error_pre_print); +} + /* Print an error message and return to command level. The first argument STRING is the error message, used as a fprintf string, and the remaining args are passed as arguments to it. */ @@ -262,12 +281,8 @@ error (va_alist) va_list args; char *string; + error_begin (); va_start (args); - target_terminal_ours (); - wrap_here(""); /* Force out any buffered output */ - gdb_flush (gdb_stdout); - if (error_pre_print) - fprintf_filtered (gdb_stderr, error_pre_print); string = va_arg (args, char *); vfprintf_filtered (gdb_stderr, string, args); fprintf_filtered (gdb_stderr, "\n"); @@ -438,6 +453,9 @@ quit () SERIAL_FLUSH_OUTPUT (gdb_stdout_serial); SERIAL_UN_FDOPEN (gdb_stdout_serial); + if (annotation_level > 1) + fprintf_filtered (gdb_stderr, "\n\032\032error-begin\n"); + /* Don't use *_filtered; we don't want to prompt the user to continue. */ if (error_pre_print) fprintf_unfiltered (gdb_stderr, error_pre_print); |