[8/8] Use styled_string for "show logging filename"
Commit Message
This changes "show logging filename" to style its output.
gdb/ChangeLog
2019-09-27 Tom Tromey <tom@tromey.com>
* cli/cli-logging.c (show_logging_filename): Use styled_string.
gdb/testsuite/ChangeLog
2019-09-27 Tom Tromey <tom@tromey.com>
* gdb.base/style.exp: Test "show logging filename".
---
gdb/ChangeLog | 4 ++++
gdb/cli/cli-logging.c | 5 +++--
gdb/testsuite/ChangeLog | 4 ++++
gdb/testsuite/gdb.base/style.exp | 3 +++
4 files changed, 14 insertions(+), 2 deletions(-)
@@ -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;
@@ -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 {<repeats.*8.*times>} metadata]\\}"
+
+ gdb_test "show logging file" \
+ "The current logfile is \"[style .*? file]\"\\..*"
}