public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb: more filename styling
@ 2024-05-08 15:00 Andrew Burgess
  2024-05-08 16:19 ` Tom Tromey
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Burgess @ 2024-05-08 15:00 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

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.
---
 gdb/build-id.c | 10 ++++++----
 gdb/solib.c    | 16 ++++++++++------
 2 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/gdb/build-id.c b/gdb/build-id.c
index d1ebd8d37d7..659801b0865 100644
--- a/gdb/build-id.c
+++ b/gdb/build-id.c
@@ -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;
 
diff --git a/gdb/solib.c b/gdb/solib.c
index a656b623458..db2ff5ce9a3 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -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;

base-commit: 868883583e7520ff1bd99fcb224d2b33a990edff
-- 
2.25.4


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

* Re: [PATCH] gdb: more filename styling
  2024-05-08 15:00 [PATCH] gdb: more filename styling Andrew Burgess
@ 2024-05-08 16:19 ` Tom Tromey
  2024-05-08 16:50   ` Andrew Burgess
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Tromey @ 2024-05-08 16:19 UTC (permalink / raw)
  To: Andrew Burgess; +Cc: gdb-patches

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

Andrew> I spotted a few places in solib.c and build-id.c where we could apply
Andrew> file name styling.

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

Ok.  Thanks for doing this.
Approved-By: Tom Tromey <tom@tromey.com>

Andrew>  		    "Do you need \"set solib-search-path\" "
Andrew>  		    "or \"set sysroot\"?"),

Unrelated but I wonder if commands ought to be styled as well.

Tom

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

* Re: [PATCH] gdb: more filename styling
  2024-05-08 16:19 ` Tom Tromey
@ 2024-05-08 16:50   ` Andrew Burgess
  2024-05-08 17:05     ` Tom Tromey
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Burgess @ 2024-05-08 16:50 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 places in solib.c and build-id.c where we could apply
> Andrew> file name styling.
>
> Andrew> Other than the extra styling, there should be no user visible changes
> Andrew> after this commit.
>
> Ok.  Thanks for doing this.
> Approved-By: Tom Tromey <tom@tromey.com>
>
> Andrew>  		    "Do you need \"set solib-search-path\" "
> Andrew>  		    "or \"set sysroot\"?"),
>
> Unrelated but I wonder if commands ought to be styled as well.

That might be nice.  Do we have a style for commands?  I couldn't see
one, but maybe we use one of the existing styles?

Anyway, I pushed this patch.

Thanks,
Andrew


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

* Re: [PATCH] gdb: more filename styling
  2024-05-08 16:50   ` Andrew Burgess
@ 2024-05-08 17:05     ` Tom Tromey
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Tromey @ 2024-05-08 17:05 UTC (permalink / raw)
  To: Andrew Burgess; +Cc: Tom Tromey, gdb-patches

Andrew> "Do you need \"set solib-search-path\" "
Andrew> "or \"set sysroot\"?"),

>> Unrelated but I wonder if commands ought to be styled as well.

Andrew> That might be nice.  Do we have a style for commands?  I couldn't see
Andrew> one, but maybe we use one of the existing styles?

The "help" stuff uses either "highlight" or "title" style, I forget
which.  Kind of unfortunately named.

Tom

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

end of thread, other threads:[~2024-05-08 17:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-08 15:00 [PATCH] gdb: more filename styling Andrew Burgess
2024-05-08 16:19 ` Tom Tromey
2024-05-08 16:50   ` Andrew Burgess
2024-05-08 17:05     ` 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).