[5/5] Fix styling in a few messages

Message ID 20260822-no-backquotes-in-strings-v1-5-0b035ad036a3@tromey.com
State New
Headers
Series Remove `...' and related forms of quoting from gdb |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 fail Test failed
linaro-tcwg-bot/tcwg_gdb_check--master-arm fail Test failed

Commit Message

Tom Tromey Aug. 22, 2026, 8:30 p.m. UTC
  While working on fixing the `...' quoting, I stumbled across a few
spots that should use CLI styling but currently do not.  This patch
fixes the ones I found.
---
 gdb/ada-lang.c    | 3 ++-
 gdb/windows-nat.c | 3 ++-
 gdb/xml-syscall.c | 8 ++++++--
 3 files changed, 10 insertions(+), 4 deletions(-)
  

Patch

diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index a0781d2d6dd..9e7dee54908 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -7888,7 +7888,8 @@  ada_template_to_fixed_record_type_1 (struct type *type,
 	warning (_("Invalid type size for \"%s\" detected: %s."),
 		 rtype->name (), pulongest (type->length ()));
       else
-	warning (_("Invalid type size for <unnamed> detected: %s."),
+	warning (_("Invalid type size for %ps detected: %s."),
+		 styled_string (metadata_style.style (), "<unnamed>"),
 		 pulongest (type->length ()));
     }
   else
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 8d50457b55c..380b30f541f 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -2867,7 +2867,8 @@  windows_nat_target::create_inferior (const char *exec_file,
   ensure_only_one_process ();
 
   if (!exec_file)
-    error (_("No executable specified, use \"target exec\"."));
+    error (_("No executable specified, use \"%ps\"."),
+	   styled_string (command_style.style (), "target exec"));
 
   const char *inferior_cwd = current_inferior ()->cwd ().c_str ();
   std::string expanded_infcwd;
diff --git a/gdb/xml-syscall.c b/gdb/xml-syscall.c
index 1fe50acc191..d8a66a6413f 100644
--- a/gdb/xml-syscall.c
+++ b/gdb/xml-syscall.c
@@ -22,6 +22,7 @@ 
 #include "xml-support.h"
 #include "xml-syscall.h"
 #include "gdbarch.h"
+#include "cli/cli-style.h"
 
 /* For the struct syscall definition.  */
 #include "target.h"
@@ -363,8 +364,11 @@  init_syscalls_info (struct gdbarch *gdbarch)
   if (syscalls_info->syscalls.empty ())
     {
       if (xml_syscall_file != NULL)
-	warning (_("Could not load the syscall XML file \"%s/%s\"."),
-		 gdb_datadir.c_str (), xml_syscall_file);
+	warning (_("Could not load the syscall XML file \"%p[%s/%s%p]\"."),
+		 file_name_style.style ().ptr (),
+		 gdb_datadir.c_str (),
+		 xml_syscall_file,
+		 nullptr);
       else
 	warning (_("There is no XML file to open."));