From 47fd17cdc14a0d295a2cbdc02eff144e3fb4e900 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Thu, 6 Sep 2018 14:49:39 -0600 Subject: Style the "Reading symbols" message The "Reading symbols" message does not use ui-out (perhaps it should?), so this styles it using the low-level API. gdb/ChangeLog 2018-12-28 Tom Tromey * symfile.c (symbol_file_add_with_addrs): Style file name. gdb/testsuite/ChangeLog 2018-12-28 Tom Tromey * gdb.base/style.exp: Add test for styling of "Reading symbols" message. --- gdb/ChangeLog | 4 ++++ gdb/symfile.c | 7 ++++++- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/gdb.base/style.exp | 4 ++++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index dd19b80..1067973 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,9 @@ 2018-12-28 Tom Tromey + * symfile.c (symbol_file_add_with_addrs): Style file name. + +2018-12-28 Tom Tromey + * top.c (print_gdb_version): Style gdb version number. 2018-12-28 Tom Tromey diff --git a/gdb/symfile.c b/gdb/symfile.c index 991b71f..ce1cc9e 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -58,6 +58,7 @@ #include "cli/cli-utils.h" #include "common/byte-vector.h" #include "selftest.h" +#include "cli/cli-style.h" #include #include @@ -1110,7 +1111,11 @@ symbol_file_add_with_addrs (bfd *abfd, const char *name, if (deprecated_pre_add_symbol_hook) deprecated_pre_add_symbol_hook (name); else - printf_filtered (_("Reading symbols from %s...\n"), name); + { + puts_filtered (_("Reading symbols from ")); + fputs_styled (name, file_name_style.style (), gdb_stdout); + puts_filtered ("...\n"); + } } syms_from_objfile (objfile, addrs, add_flags); diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 3d262d3..ceef606 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2018-12-28 Tom Tromey + * gdb.base/style.exp: Add test for styling of "Reading symbols" + message. + +2018-12-28 Tom Tromey + * gdb.base/style.exp: Add test for version number styling. 2018-12-28 Tom Tromey diff --git a/gdb/testsuite/gdb.base/style.exp b/gdb/testsuite/gdb.base/style.exp index b72c2ab..8bababc 100644 --- a/gdb/testsuite/gdb.base/style.exp +++ b/gdb/testsuite/gdb.base/style.exp @@ -50,4 +50,8 @@ save_vars { env(TERM) } { gdb_test "" "\033\\\[35;1mGNU gdb.*\033\\\[m.*" \ "version is styled" + + set quoted [string_to_regexp $binfile] + gdb_test "file $binfile" \ + "Reading symbols from \033\\\[32m${quoted}\033\\\[m..." \ } -- cgit v1.1