]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: more filename styling
authorAndrew Burgess <aburgess@redhat.com>
Tue, 30 Apr 2024 14:47:41 +0000 (15:47 +0100)
committerAndrew Burgess <aburgess@redhat.com>
Wed, 8 May 2024 16:49:04 +0000 (17:49 +0100)
I spotted a few places in solib.c and build-id.c where we could apply
file name styling.

Other than the extra styling, there should be no user visible changes
after this commit.

Approved-By: Tom Tromey <tom@tromey.com>
gdb/build-id.c
gdb/solib.c

index d1ebd8d37d773e722c963e3df04dd3074dd84273..659801b0865d61311d1efa52997bc96d521c288f 100644 (file)
@@ -60,12 +60,14 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check)
   found = build_id_bfd_get (abfd);
 
   if (found == NULL)
-    warning (_("File \"%s\" has no build-id, file skipped"),
-            bfd_get_filename (abfd));
+    warning (_("File \"%ps\" has no build-id, file skipped"),
+            styled_string (file_name_style.style (),
+                           bfd_get_filename (abfd)));
   else if (found->size != check_len
           || memcmp (found->data, check, found->size) != 0)
-    warning (_("File \"%s\" has a different build-id, file skipped"),
-            bfd_get_filename (abfd));
+    warning (_("File \"%ps\" has a different build-id, file skipped"),
+            styled_string (file_name_style.style (),
+                           bfd_get_filename (abfd)));
   else
     retval = 1;
 
index a656b623458bc6494d2be7c55a49014202b4f6d3..db2ff5ce9a37fd3a641e63880e0e27d72a0fb85a 100644 (file)
@@ -903,16 +903,19 @@ update_solib_list (int from_tty)
         stand out well.  */
 
       if (not_found == 1)
-       warning (_ ("Could not load shared library symbols for %s.\n"
+       warning (_ ("Could not load shared library symbols for %ps.\n"
                    "Do you need \"set solib-search-path\" "
                    "or \"set sysroot\"?"),
-                not_found_filename);
+                styled_string (file_name_style.style (),
+                               not_found_filename));
       else if (not_found > 1)
        warning (_ ("\
-Could not load shared library symbols for %d libraries, e.g. %s.\n\
+Could not load shared library symbols for %d libraries, e.g. %ps.\n\
 Use the \"info sharedlibrary\" command to see the complete listing.\n\
 Do you need \"set solib-search-path\" or \"set sysroot\"?"),
-                not_found, not_found_filename);
+                not_found,
+                styled_string (file_name_style.style (),
+                               not_found_filename));
     }
 }
 
@@ -1005,8 +1008,9 @@ solib_add (const char *pattern, int from_tty, int readsyms)
                  /* If no pattern was given, be quiet for shared
                     libraries we have already loaded.  */
                  if (pattern && (from_tty || info_verbose))
-                   gdb_printf (_ ("Symbols already loaded for %s\n"),
-                               gdb.so_name.c_str ());
+                   gdb_printf (_ ("Symbols already loaded for %ps\n"),
+                               styled_string (file_name_style.style (),
+                                              gdb.so_name.c_str ()));
                }
              else if (solib_read_symbols (gdb, add_flags))
                loaded_any_symbols = true;