diff options
author | Tom Tromey <tromey@adacore.com> | 2024-12-20 14:00:39 -0700 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2025-05-02 12:52:09 -0600 |
commit | a048980c4eb93f8a965b4addc7134e8a527874a2 (patch) | |
tree | 8779f44d6de2dd1c8b6107a747e608e363c50061 /gdb/exceptions.c | |
parent | 5c87b330e910f8be1443c881fd16a70e685f1f2f (diff) | |
download | binutils-a048980c4eb93f8a965b4addc7134e8a527874a2.zip binutils-a048980c4eb93f8a965b4addc7134e8a527874a2.tar.gz binutils-a048980c4eb93f8a965b4addc7134e8a527874a2.tar.bz2 |
Use emoji to indicate errors and warnings
This patch adds, at long last, some emoji output to gdb. In
particular, warnings are indicated with the U+26A0 (WARNING SIGN), and
errors with U+274C (CROSS MARK).
There is a new setting to control whether emoji output can be used.
It defaults to "auto", which means emoji will be used if the host
charset is UTF-8. Note that disabling styling will also disable
emoji, handy for traditionalists.
I've refactored mingw console output a little, so that emoji will not
be printed to the console. Note the previous code here was a bit
strange in that it assumed that the first use of gdb_console_fputs
would be to stdout.
This version lets the user control the prefixes directly, so different
emoji can be chosen if desired.
Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Reviewed-By: Keith Seitz <keiths@redhat.com>
Reviewed-By: Guinevere Larsen <guinevere@redhat.com>
Diffstat (limited to 'gdb/exceptions.c')
-rw-r--r-- | gdb/exceptions.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gdb/exceptions.c b/gdb/exceptions.c index 6af3a7e..35400f3 100644 --- a/gdb/exceptions.c +++ b/gdb/exceptions.c @@ -25,6 +25,7 @@ #include "serial.h" #include "ui.h" #include <optional> +#include "cli/cli-style.h" static void print_flush (void) @@ -105,6 +106,7 @@ exception_print (struct ui_file *file, const struct gdb_exception &e) if (e.reason < 0 && e.message != NULL) { print_flush (); + print_error_prefix (file); print_exception (file, e); } } @@ -118,6 +120,7 @@ exception_fprintf (struct ui_file *file, const struct gdb_exception &e, va_list args; print_flush (); + print_error_prefix (file); /* Print the prefix. */ va_start (args, prefix); |