aboutsummaryrefslogtreecommitdiff
path: root/gdb/exceptions.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2014-07-14 19:55:30 +0100
committerPedro Alves <palves@redhat.com>2014-07-14 20:29:30 +0100
commitfeefc97b5942325a8b7793e7ae089d87ecdee11c (patch)
treed8ffc88fd361b34864c73938e2f0ac5198315be4 /gdb/exceptions.c
parentc933f875f4416a2a06c14fb9e483dd888a948eb2 (diff)
downloadgdb-feefc97b5942325a8b7793e7ae089d87ecdee11c.zip
gdb-feefc97b5942325a8b7793e7ae089d87ecdee11c.tar.gz
gdb-feefc97b5942325a8b7793e7ae089d87ecdee11c.tar.bz2
Eliminate exceptions.c:print_any_exception.
exception_print and exception_fprintf call print_flush, which does all the same flushing and annotation things that print_any_exception does, and more. gdb/ 2014-07-14 Pedro Alves <palves@redhat.com> * exceptions.c (print_any_exception): Delete. (catch_exceptions_with_msg): Use exception_print instead of print_any_exception. (catch_errors): Use exception_fprintf instead of print_any_exception. (catch_command_errors, catch_command_errors_const): Use exception_print instead of print_any_exception.
Diffstat (limited to 'gdb/exceptions.c')
-rw-r--r--gdb/exceptions.c26
1 files changed, 4 insertions, 22 deletions
diff --git a/gdb/exceptions.c b/gdb/exceptions.c
index ca80893..8ee428d 100644
--- a/gdb/exceptions.c
+++ b/gdb/exceptions.c
@@ -331,24 +331,6 @@ exception_fprintf (struct ui_file *file, struct gdb_exception e,
}
}
-static void
-print_any_exception (struct ui_file *file, const char *prefix,
- struct gdb_exception e)
-{
- if (e.reason < 0 && e.message != NULL)
- {
- target_terminal_ours ();
- wrap_here (""); /* Force out any buffered output. */
- gdb_flush (gdb_stdout);
- annotate_error_begin ();
-
- /* Print the prefix. */
- if (prefix != NULL && prefix[0] != '\0')
- fputs_filtered (prefix, file);
- print_exception (file, e);
- }
-}
-
/* A stack of exception messages.
This is needed to handle nested calls to throw_it: we don't want to
xfree space for a message before it's used.
@@ -486,7 +468,7 @@ catch_exceptions_with_msg (struct ui_out *func_uiout,
throw_exception (exception);
}
- print_any_exception (gdb_stderr, NULL, exception);
+ exception_print (gdb_stderr, exception);
gdb_assert (val >= 0);
gdb_assert (exception.reason <= 0);
if (exception.reason < 0)
@@ -534,7 +516,7 @@ catch_errors (catch_errors_ftype *func, void *func_args, char *errstring,
throw_exception (exception);
}
- print_any_exception (gdb_stderr, errstring, exception);
+ exception_fprintf (gdb_stderr, exception, "%s", errstring);
if (exception.reason != 0)
return 0;
return val;
@@ -550,7 +532,7 @@ catch_command_errors (catch_command_errors_ftype *command,
{
command (arg, from_tty);
}
- print_any_exception (gdb_stderr, NULL, e);
+ exception_print (gdb_stderr, e);
if (e.reason < 0)
return 0;
return 1;
@@ -566,7 +548,7 @@ catch_command_errors_const (catch_command_errors_const_ftype *command,
{
command (arg, from_tty);
}
- print_any_exception (gdb_stderr, NULL, e);
+ exception_print (gdb_stderr, e);
if (e.reason < 0)
return 0;
return 1;