From 6ec1d75e05a646eb602de4034366ec5fec7545ce Mon Sep 17 00:00:00 2001 From: Philippe Waroquiers Date: Sun, 15 Dec 2019 17:58:16 +0100 Subject: 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 * 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 * gdb.base/style.exp: Test that warnings are styled. --- gdb/testsuite/ChangeLog | 4 ++++ gdb/testsuite/gdb.base/style.exp | 6 ++++++ 2 files changed, 10 insertions(+) (limited to 'gdb/testsuite') diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index f7835f3..78f9700 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2020-01-03 Philippe Waroquiers + + * gdb.base/style.exp: Test that warnings are styled. + 2019-12-29 Bernd Edlinger * gdb.base/line65535.exp: New file. diff --git a/gdb/testsuite/gdb.base/style.exp b/gdb/testsuite/gdb.base/style.exp index 17b9538..0457c3d 100644 --- a/gdb/testsuite/gdb.base/style.exp +++ b/gdb/testsuite/gdb.base/style.exp @@ -139,4 +139,10 @@ save_vars { env(TERM) } { gdb_test "show logging file" \ "The current logfile is \"[style .*? file]\"\\..*" + + # Check warnings are styled by setting a rubbish data directory. + gdb_test "set data-directory Makefile" \ + "warning: [style .*? file] is not a directory\\..*" + gdb_test "show data-directory" \ + "GDB's data directory is \"[style .*? file]\"\\..*" } -- cgit v1.1