From: Tom Tromey Date: Thu, 19 Sep 2019 13:31:28 +0000 (-0600) Subject: Use styled_string for "show logging filename" X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d770d56f42e77f4ee1008ae223dacd3658305297;p=binutils-gdb.git Use styled_string for "show logging filename" This changes "show logging filename" to style its output. gdb/ChangeLog 2019-10-01 Tom Tromey * cli/cli-logging.c (show_logging_filename): Use styled_string. gdb/testsuite/ChangeLog 2019-10-01 Tom Tromey * gdb.base/style.exp: Test "show logging filename". --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 652ba77d834..be51e38a500 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2019-10-01 Tom Tromey + + * cli/cli-logging.c (show_logging_filename): Use styled_string. + 2019-10-01 Tom Tromey * stack.c (print_frame, info_frame_command_core): Use diff --git a/gdb/cli/cli-logging.c b/gdb/cli/cli-logging.c index 22b540b4812..e20ebd5dc82 100644 --- a/gdb/cli/cli-logging.c +++ b/gdb/cli/cli-logging.c @@ -21,6 +21,7 @@ #include "gdbcmd.h" #include "ui-out.h" #include "interps.h" +#include "cli/cli-style.h" static char *saved_filename; @@ -29,8 +30,8 @@ static void show_logging_filename (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) { - fprintf_filtered (file, _("The current logfile is \"%s\".\n"), - value); + fprintf_filtered (file, _("The current logfile is \"%ps\".\n"), + styled_string (file_name_style.style (), value)); } static bool logging_overwrite; diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 784daf2e530..123d3b076df 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2019-10-01 Tom Tromey + + * gdb.base/style.exp: Test "show logging filename". + 2019-10-01 Tom Tromey * lib/gdb-utils.exp (style): Handle "metadata" argument. diff --git a/gdb/testsuite/gdb.base/style.exp b/gdb/testsuite/gdb.base/style.exp index 0f812f7f1bc..72b5f4efb21 100644 --- a/gdb/testsuite/gdb.base/style.exp +++ b/gdb/testsuite/gdb.base/style.exp @@ -137,4 +137,7 @@ save_vars { env(TERM) } { gdb_test_no_output "set print repeat 3" gdb_test "print {0,0,0,0,0,0,0,0}" \ " = \\{0 [style {} metadata]\\}" + + gdb_test "show logging file" \ + "The current logfile is \"[style .*? file]\"\\..*" }