public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Use styled_string for "show logging filename"
@ 2019-10-01 21:26 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2019-10-01 21:26 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d770d56f42e77f4ee1008ae223dacd3658305297

commit d770d56f42e77f4ee1008ae223dacd3658305297
Author: Tom Tromey <tom@tromey.com>
Date:   Thu Sep 19 07:31:28 2019 -0600

    Use styled_string for "show logging filename"
    
    This changes "show logging filename" to style its output.
    
    gdb/ChangeLog
    2019-10-01  Tom Tromey  <tom@tromey.com>
    
    	* cli/cli-logging.c (show_logging_filename): Use styled_string.
    
    gdb/testsuite/ChangeLog
    2019-10-01  Tom Tromey  <tom@tromey.com>
    
    	* gdb.base/style.exp: Test "show logging filename".

Diff:
---
 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(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 652ba77..be51e38 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
 2019-10-01  Tom Tromey  <tom@tromey.com>
 
+	* cli/cli-logging.c (show_logging_filename): Use styled_string.
+
+2019-10-01  Tom Tromey  <tom@tromey.com>
+
 	* stack.c (print_frame, info_frame_command_core): Use
 	styled_string.
 	* linux-thread-db.c (try_thread_db_load_1)
diff --git a/gdb/cli/cli-logging.c b/gdb/cli/cli-logging.c
index 22b540b..e20ebd5 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 784daf2..123d3b0 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,9 @@
 2019-10-01  Tom Tromey  <tom@tromey.com>
 
+	* gdb.base/style.exp: Test "show logging filename".
+
+2019-10-01  Tom Tromey  <tom@tromey.com>
+
 	* lib/gdb-utils.exp (style): Handle "metadata" argument.
 	* gdb.base/style.exp: Add metadata style test.
 
diff --git a/gdb/testsuite/gdb.base/style.exp b/gdb/testsuite/gdb.base/style.exp
index 0f812f7..72b5f4e 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 {<repeats.*8.*times>} metadata]\\}"
+
+    gdb_test "show logging file" \
+	"The current logfile is \"[style .*? file]\"\\..*"
 }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-10-01 21:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-01 21:26 [binutils-gdb] Use styled_string for "show logging filename" Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).