public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: gdb-patches@sourceware.org
Cc: Andrew Burgess <aburgess@redhat.com>
Subject: [PATCH] gdb: add some missing filename styling
Date: Thu, 14 Sep 2023 16:46:33 +0100	[thread overview]
Message-ID: <f33c2e15a694986ac0b8e52eb5398e7e55676820.1694706156.git.aburgess@redhat.com> (raw)

Spotted a few places where we can add filename styling.
---
 gdb/symfile-debug.c | 11 +++++++----
 gdb/symfile.c       | 13 +++++++------
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/gdb/symfile-debug.c b/gdb/symfile-debug.c
index 233cf3390e5..850da4147a3 100644
--- a/gdb/symfile-debug.c
+++ b/gdb/symfile-debug.c
@@ -34,6 +34,7 @@
 #include "symfile.h"
 #include "block.h"
 #include "filenames.h"
+#include "cli/cli-style.h"
 
 /* We need to save a pointer to the real symbol functions.
    Plus, the debug versions are malloc'd because we have to NULL out the
@@ -542,16 +543,18 @@ objfile::require_partial_symbols (bool verbose)
 	    {
 	      if (verbose && !printed)
 		{
-		  gdb_printf (_("Reading symbols from %s...\n"),
-			      objfile_name (this));
+		  gdb_printf (_("Reading symbols from %ps...\n"),
+			      styled_string (file_name_style.style (),
+					     objfile_name (this)));
 		  printed = true;
 		}
 	      iter->read_partial_symbols (this);
 	    }
 	}
       if (printed && !objfile_has_symbols (this))
-	gdb_printf (_("(No debugging symbols found in %s)\n"),
-		    objfile_name (this));
+	gdb_printf (_("(No debugging symbols found in %ps)\n"),
+		    styled_string (file_name_style.style (),
+				   objfile_name (this)));
     }
 }
 
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 1b46ec45f2e..70ade9e119e 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -2322,8 +2322,8 @@ add_symbol_file_command (const char *args, int from_tty)
      statements because hex_string returns a local static
      string.  */
 
-  gdb_printf (_("add symbol table from file \"%s\""),
-	      filename.get ());
+  gdb_printf (_("add symbol table from file \"%ps\""),
+	      styled_string (file_name_style.style (), filename.get ()));
   section_addr_info section_addrs;
   std::vector<sect_opt>::const_iterator it = sect_opts.begin ();
   if (!seen_addr)
@@ -2369,8 +2369,8 @@ add_symbol_file_command (const char *args, int from_tty)
   objf = symbol_file_add (filename.get (), add_flags, &section_addrs,
 			  flags);
   if (!objfile_has_symbols (objf) && objf->per_bfd->minimal_symbol_count <= 0)
-    warning (_("newly-added symbol file \"%s\" does not provide any symbols"),
-	     filename.get ());
+    warning (_("newly-added symbol file \"%ps\" does not provide any symbols"),
+	     styled_string (file_name_style.style (), filename.get ()));
 
   if (seen_offset)
     set_objfile_default_section_offset (objf, section_addrs, offset);
@@ -2494,8 +2494,9 @@ reread_symbols (int from_tty)
       new_modtime = new_statbuf.st_mtime;
       if (new_modtime != objfile->mtime)
 	{
-	  gdb_printf (_("`%s' has changed; re-reading symbols.\n"),
-		      objfile_name (objfile));
+	  gdb_printf (_("`%ps' has changed; re-reading symbols.\n"),
+		      styled_string (file_name_style.style (),
+				     objfile_name (objfile)));
 
 	  /* There are various functions like symbol_file_add,
 	     symfile_bfd_open, syms_from_objfile, etc., which might

base-commit: d7680f13df105aa8fa0edbdf8efae31a5411f579
-- 
2.25.4


             reply	other threads:[~2023-09-14 15:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-14 15:46 Andrew Burgess [this message]
2023-09-14 16:18 ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f33c2e15a694986ac0b8e52eb5398e7e55676820.1694706156.git.aburgess@redhat.com \
    --to=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).