]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: more filename styling in remote.c and target.c
authorAndrew Burgess <aburgess@redhat.com>
Tue, 21 May 2024 15:20:43 +0000 (16:20 +0100)
committerAndrew Burgess <aburgess@redhat.com>
Wed, 5 Jun 2024 09:18:03 +0000 (10:18 +0100)
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.

Approved-By: Tom Tromey <tom@tromey.com>
gdb/remote.c
gdb/target.c

index d4886c9650ea43818f14f791352b0916ad19d29e..349bc8cf005e48acd50e6c29bc85fd9ef2f8f115 100644 (file)
@@ -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
index ddf10c28e1c7de310942232e9647f3b1006cbc43..276e215945ef48d9d06e1eed11fdaf347f71d0b4 100644 (file)
@@ -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",