aboutsummaryrefslogtreecommitdiff
path: root/gdb/ui-file.c
diff options
context:
space:
mode:
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>2019-12-15 17:58:16 +0100
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>2020-01-03 21:13:21 +0100
commit6ec1d75e05a646eb602de4034366ec5fec7545ce (patch)
tree69c29a3159e27912cd1faa5d665543b37ff07c36 /gdb/ui-file.c
parent44f81a76542dbeada2541a05de191ae0ac0fbc2c (diff)
downloadgdb-6ec1d75e05a646eb602de4034366ec5fec7545ce.zip
gdb-6ec1d75e05a646eb602de4034366ec5fec7545ce.tar.gz
gdb-6ec1d75e05a646eb602de4034366ec5fec7545ce.tar.bz2
Ensure GDB warnings are styled.
While handling the comments of Tom related to [RFC] Have an option to tell GDB to detect and possibly handle mismatched exec-files. https://sourceware.org/ml/gdb-patches/2019-12/msg00621.html I saw that GDB warnings are produced ignoring the given styles. This patch: * ensures that style markups are properly handled by "warning". * changes 'set/show data-directory' so that file style is used in warnings and in 'show message' * changes all other messages in top.c to use file style when appropriate. * Uses the above data-directory changes in gdb.base/style.exp 2020-01-03 Philippe Waroquiers <philippe.waroquiers@skynet.be> * ui-file.c (stdio_file::can_emit_style_escape) (tee_file::can_emit_style_escape): Ensure style is used also on gdb_stderr when gdb_stderr is a tty supporting styling, similarly to gdb_stdout. * main.c (set_gdb_data_directory): Use file style to output the warning that the given pathname is not a directory. * top.c (show_history_filename, gdb_safe_append_history) (show_gdb_datadir): Use file style. 2020-01-03 Philippe Waroquiers <philippe.waroquiers@skynet.be> * gdb.base/style.exp: Test that warnings are styled.
Diffstat (limited to 'gdb/ui-file.c')
-rw-r--r--gdb/ui-file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/ui-file.c b/gdb/ui-file.c
index 10192a9..af128b0 100644
--- a/gdb/ui-file.c
+++ b/gdb/ui-file.c
@@ -302,7 +302,7 @@ stdio_file::isatty ()
bool
stdio_file::can_emit_style_escape ()
{
- return (this == gdb_stdout
+ return ((this == gdb_stdout || this == gdb_stderr)
&& this->isatty ()
&& term_cli_styling ());
}
@@ -391,7 +391,7 @@ tee_file::term_out ()
bool
tee_file::can_emit_style_escape ()
{
- return (this == gdb_stdout
+ return ((this == gdb_stdout || this == gdb_stderr)
&& m_one->term_out ()
&& term_cli_styling ());
}