public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb: more filename styling in remote.c and target.c
@ 2024-06-04 12:22 Andrew Burgess
  2024-06-04 13:46 ` Tom Tromey
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Burgess @ 2024-06-04 12:22 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

I spotted a few more places where we could apply filename styling in
remote.c and target.c.  Other than the styling, there should be no
user visible changes after this commit.
---
 gdb/remote.c | 14 +++++++++-----
 gdb/target.c | 12 ++++++++----
 2 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/gdb/remote.c b/gdb/remote.c
index d4886c9650e..349bc8cf005 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -79,6 +79,7 @@
 #include <unordered_map>
 #include "async-event.h"
 #include "gdbsupport/selftest.h"
+#include "cli/cli-style.h"
 
 /* The remote target.  */
 
@@ -12751,8 +12752,8 @@ remote_target::remote_hostio_open (inferior *inf, const char *filename,
     {
       static int warning_issued = 0;
 
-      gdb_printf (_("Reading %s from remote target...\n"),
-		  filename);
+      gdb_printf (_("Reading %ps from remote target...\n"),
+		  styled_string (file_name_style.style (), filename));
 
       if (!warning_issued)
 	{
@@ -13291,7 +13292,8 @@ remote_target::remote_file_put (const char *local_file, const char *remote_file,
     remote_hostio_error (remote_errno);
 
   if (from_tty)
-    gdb_printf (_("Successfully sent file \"%s\".\n"), local_file);
+    gdb_printf (_("Successfully sent file \"%ps\".\n"),
+		styled_string (file_name_style.style (), local_file));
 }
 
 void
@@ -13351,7 +13353,8 @@ remote_target::remote_file_get (const char *remote_file, const char *local_file,
     remote_hostio_error (remote_errno);
 
   if (from_tty)
-    gdb_printf (_("Successfully fetched file \"%s\".\n"), remote_file);
+    gdb_printf (_("Successfully fetched file \"%ps\".\n"),
+		styled_string (file_name_style.style (), remote_file));
 }
 
 void
@@ -13376,7 +13379,8 @@ remote_target::remote_file_delete (const char *remote_file, int from_tty)
     remote_hostio_error (remote_errno);
 
   if (from_tty)
-    gdb_printf (_("Successfully deleted file \"%s\".\n"), remote_file);
+    gdb_printf (_("Successfully deleted file \"%ps\".\n"),
+		styled_string (file_name_style.style (), remote_file));
 }
 
 static void
diff --git a/gdb/target.c b/gdb/target.c
index ddf10c28e1c..276e215945e 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -54,6 +54,7 @@
 #include "target-connection.h"
 #include "valprint.h"
 #include "cli/cli-decode.h"
+#include "cli/cli-style.h"
 
 static void generic_tls_error (void) ATTRIBUTE_NORETURN;
 
@@ -2397,8 +2398,9 @@ info_target_command (const char *args, int from_tty)
   if (current_program_space->symfile_object_file != NULL)
     {
       objfile *objf = current_program_space->symfile_object_file;
-      gdb_printf (_("Symbols from \"%s\".\n"),
-		  objfile_name (objf));
+      gdb_printf (_("Symbols from \"%ps\".\n"),
+		  styled_string (file_name_style.style (),
+				 objfile_name (objf)));
     }
 
   for (target_ops *t = current_inferior ()->top_target ();
@@ -3577,7 +3579,8 @@ target_announce_detach (int from_tty)
     gdb_printf ("Detaching from pid %s\n",
 		target_pid_to_str (ptid_t (pid)).c_str ());
   else
-    gdb_printf (_("Detaching from program: %s, %s\n"), exec_file,
+    gdb_printf (_("Detaching from program: %ps, %s\n"),
+		styled_string (file_name_style.style (), exec_file),
 		target_pid_to_str (ptid_t (pid)).c_str ());
 }
 
@@ -3592,7 +3595,8 @@ target_announce_attach (int from_tty, int pid)
   const char *exec_file = get_exec_file (0);
 
   if (exec_file != nullptr)
-    gdb_printf ("Attaching to program: %s, %s\n", exec_file,
+    gdb_printf ("Attaching to program: %ps, %s\n",
+		styled_string (file_name_style.style (), exec_file),
 		target_pid_to_str (ptid_t (pid)).c_str ());
   else
     gdb_printf ("Attaching to %s\n",

base-commit: 7c493aa7e73e6718790f6b4a01a39ff4146cba4a
-- 
2.25.4


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gdb: more filename styling in remote.c and target.c
  2024-06-04 12:22 [PATCH] gdb: more filename styling in remote.c and target.c Andrew Burgess
@ 2024-06-04 13:46 ` Tom Tromey
  2024-06-05  9:18   ` Andrew Burgess
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2024-06-04 13:46 UTC (permalink / raw)
  To: Andrew Burgess; +Cc: gdb-patches

>>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> writes:

Andrew> I spotted a few more places where we could apply filename styling in
Andrew> remote.c and target.c.  Other than the styling, there should be no
Andrew> user visible changes after this commit.

Makes sense to me.
Approved-By: Tom Tromey <tom@tromey.com>

Tom

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gdb: more filename styling in remote.c and target.c
  2024-06-04 13:46 ` Tom Tromey
@ 2024-06-05  9:18   ` Andrew Burgess
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Burgess @ 2024-06-05  9:18 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

Tom Tromey <tom@tromey.com> writes:

>>>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> writes:
>
> Andrew> I spotted a few more places where we could apply filename styling in
> Andrew> remote.c and target.c.  Other than the styling, there should be no
> Andrew> user visible changes after this commit.
>
> Makes sense to me.
> Approved-By: Tom Tromey <tom@tromey.com>

Pushed.

Thanks,
Andrew


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-06-05  9:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-04 12:22 [PATCH] gdb: more filename styling in remote.c and target.c Andrew Burgess
2024-06-04 13:46 ` Tom Tromey
2024-06-05  9:18   ` Andrew Burgess

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).