summaryrefslogtreecommitdiff
path: root/gdb/utils.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-01-31 04:10:51 +0000
committerAndrew Cagney <cagney@redhat.com>2002-01-31 04:10:51 +0000
commit7445d1e6a63730fa89978d81b08c86588a85cdbe (patch)
tree5f846bfc5b57f60502b379ca80e74ae61734a16f /gdb/utils.c
parent3bf69f878e973bdf9d347fa6399d2d5e8b3c4192 (diff)
downloadgdb-7445d1e6a63730fa89978d81b08c86588a85cdbe.tar.gz
* defs.h (vwarning): Declare.
(warning_begin): Delete declaration. * utils.c (vwarning): New function. (warning): Call vwarning. (warning_begin): Delete function. * rs6000-nat.c (vmap_ldinfo): Use the function warning to print the warning message. * d10v-tdep.c (d10v_address_to_pointer) [0]: Delete call to warning_begin.
Diffstat (limited to 'gdb/utils.c')
-rw-r--r--gdb/utils.c44
1 files changed, 21 insertions, 23 deletions
diff --git a/gdb/utils.c b/gdb/utils.c
index 16c1897a006..2459dead926 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -554,23 +554,28 @@ discard_all_intermediate_continuations (void)
-/* Print a warning message. Way to use this is to call warning_begin,
- output the warning message (use unfiltered output to gdb_stderr),
- ending in a newline. There is not currently a warning_end that you
- call afterwards, but such a thing might be added if it is useful
- for a GUI to separate warning messages from other output.
-
- FIXME: Why do warnings use unfiltered output and errors filtered?
- Is this anything other than a historical accident? */
+/* Print a warning message. The first argument STRING is the warning
+ message, used as an fprintf format string, the second is the
+ va_list of arguments for that string. A warning is unfiltered (not
+ paginated) so that the user does not need to page through each
+ screen full of warnings when there are lots of them. */
void
-warning_begin (void)
+vwarning (const char *string, va_list args)
{
- target_terminal_ours ();
- wrap_here (""); /* Force out any buffered output */
- gdb_flush (gdb_stdout);
- if (warning_pre_print)
- fprintf_unfiltered (gdb_stderr, warning_pre_print);
+ if (warning_hook)
+ (*warning_hook) (string, args);
+ else
+ {
+ target_terminal_ours ();
+ wrap_here (""); /* Force out any buffered output */
+ gdb_flush (gdb_stdout);
+ if (warning_pre_print)
+ fprintf_unfiltered (gdb_stderr, warning_pre_print);
+ vfprintf_unfiltered (gdb_stderr, string, args);
+ fprintf_unfiltered (gdb_stderr, "\n");
+ va_end (args);
+ }
}
/* Print a warning message.
@@ -584,15 +589,8 @@ warning (const char *string,...)
{
va_list args;
va_start (args, string);
- if (warning_hook)
- (*warning_hook) (string, args);
- else
- {
- warning_begin ();
- vfprintf_unfiltered (gdb_stderr, string, args);
- fprintf_unfiltered (gdb_stderr, "\n");
- va_end (args);
- }
+ vwarning (string, args);
+ va_end (args);
}
/* Start the printing of an error message. Way to use this is to call