Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [PATCH 08/10] [gdb] Add missing i18n support to warning strings (part 3)
Date: Sun,  7 Jun 2026 08:00:39 +0200	[thread overview]
Message-ID: <20260607060041.410491-9-tdevries@suse.de> (raw)
In-Reply-To: <20260607060041.410491-1-tdevries@suse.de>

Add missing i18n support to some warning strings.

Result of:
...
$ find gdb* -type f -name "*.[ch]" -o -name "*.cc"
    | egrep -v /testsuite/ \
    | xargs sed -i \
        '/"[ \t]*%s[ \t]*"/b l;s/\([ \t]\)warning (\("[^"]*"\),$/\1warning (_(\2),/;:l'
...
---
 gdb/procfs.c              |  2 +-
 gdb/symtab.c              |  4 ++--
 gdb/windows-nat.c         |  4 ++--
 gdbserver/linux-low.cc    | 12 ++++++------
 gdbserver/netbsd-low.cc   |  4 ++--
 gdbserver/regcache.cc     |  2 +-
 gdbserver/remote-utils.cc |  4 ++--
 gdbserver/thread-db.cc    |  4 ++--
 gdbserver/tracepoint.cc   |  4 ++--
 9 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/gdb/procfs.c b/gdb/procfs.c
index fd5d1a76bd6..25319464bc8 100644
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -589,7 +589,7 @@ static void
 proc_warn (procinfo *pi, const char *func, int line)
 {
   int saved_errno = errno;
-  warning ("procfs: %s line %d, %ps: %s",
+  warning (_("procfs: %s line %d, %ps: %s"),
 	   func, line, styled_string (file_name_style.style (),
 				      pi->pathname),
 	   safe_strerror (saved_errno));
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 3c10e1fd750..9fde2e6e6c9 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -2976,7 +2976,7 @@ find_sal_for_pc_sect (CORE_ADDR pc, struct obj_section *section, int notcurrent)
 	   * so of course we can't find the real func/line info,
 	   * but the "break" still works, and the warning is annoying.
 	   * So I commented out the warning.  RT */
-	  /* warning ("In stub for %s; unable to find real function/line info",
+	  /* warning (_("In stub for %s; unable to find real function/line info"),
 	     msymbol->linkage_name ()); */
 	  ;
 	/* fall through */
@@ -2984,7 +2984,7 @@ find_sal_for_pc_sect (CORE_ADDR pc, struct obj_section *section, int notcurrent)
 		 == msymbol.value_address ())
 	  /* Avoid infinite recursion */
 	  /* See above comment about why warning is commented out.  */
-	  /* warning ("In stub for %s; unable to find real function/line info",
+	  /* warning (_("In stub for %s; unable to find real function/line info"),
 	     msymbol->linkage_name ()); */
 	  ;
 	/* fall through */
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index d9e924f16c6..89d65ff3e7e 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -379,11 +379,11 @@ wait_for_single (HANDLE handle, DWORD howlong)
       if (r == WAIT_FAILED)
 	{
 	  unsigned err = (unsigned) GetLastError ();
-	  warning ("WaitForSingleObject failed (code %u): %s",
+	  warning (_("WaitForSingleObject failed (code %u): %s"),
 		   err, strwinerror (err));
 	}
       else
-	warning ("unexpected result from WaitForSingleObject: %u",
+	warning (_("unexpected result from WaitForSingleObject: %u"),
 		 (unsigned) r);
     }
 }
diff --git a/gdbserver/linux-low.cc b/gdbserver/linux-low.cc
index 8a467ce508e..05dbed239c8 100644
--- a/gdbserver/linux-low.cc
+++ b/gdbserver/linux-low.cc
@@ -4079,7 +4079,7 @@ linux_process_target::resume_one_lwp_throw (lwp_info *lwp, int step,
 	      if (step == 0)
 		warning (_("BAD - reinserting but not stepping."));
 	      if (lwp->suspended)
-		warning ("BAD - reinserting and suspended(%d).",
+		warning (_("BAD - reinserting and suspended(%d)."),
 				 lwp->suspended);
 	    }
 	}
@@ -6606,7 +6606,7 @@ read_link_map (std::string &document, CORE_ADDR lmid, CORE_ADDR lm_addr,
 
       if (lm_prev != l_prev)
 	{
-	  warning ("Corrupted shared library list: 0x%s != 0x%s",
+	  warning (_("Corrupted shared library list: 0x%s != 0x%s"),
 		   paddress (lm_prev), paddress (l_prev));
 	  break;
 	}
@@ -6738,7 +6738,7 @@ linux_process_target::qxfer_libraries_svr4 (const char *annex,
 				 (unsigned char *) &r_version,
 				 sizeof (r_version)) != 0)
 	    {
-	      warning ("unable to read r_version from 0x%s",
+	      warning (_("unable to read r_version from 0x%s"),
 		       paddress (r_debug + lmo->r_version_offset));
 	      break;
 	    }
@@ -6752,7 +6752,7 @@ linux_process_target::qxfer_libraries_svr4 (const char *annex,
 	  if (read_one_ptr (r_debug + lmo->r_map_offset, &lm_addr,
 			    ptr_size) != 0)
 	    {
-	      warning ("unable to read r_map from 0x%s",
+	      warning (_("unable to read r_map from 0x%s"),
 		       paddress (r_debug + lmo->r_map_offset));
 	      break;
 	    }
@@ -6776,7 +6776,7 @@ linux_process_target::qxfer_libraries_svr4 (const char *annex,
 	      if (read_one_ptr (lm_addr + lmo->l_next_offset,
 				&lm_addr, ptr_size) != 0)
 		{
-		  warning ("unable to read l_next from 0x%s",
+		  warning (_("unable to read l_next from 0x%s"),
 			   paddress (lm_addr + lmo->l_next_offset));
 		  break;
 		}
@@ -6790,7 +6790,7 @@ linux_process_target::qxfer_libraries_svr4 (const char *annex,
 	  if (read_one_ptr (r_debug + lmo->r_next_offset, &r_debug,
 			    ptr_size) != 0)
 	    {
-	      warning ("unable to read r_next from 0x%s",
+	      warning (_("unable to read r_next from 0x%s"),
 		       paddress (r_debug + lmo->r_next_offset));
 	      break;
 	    }
diff --git a/gdbserver/netbsd-low.cc b/gdbserver/netbsd-low.cc
index 8462c5d3180..6cd98911c5f 100644
--- a/gdbserver/netbsd-low.cc
+++ b/gdbserver/netbsd-low.cc
@@ -1029,7 +1029,7 @@ netbsd_qxfer_libraries_svr4 (const pid_t pid, const char *annex,
 	{
 	  CORE_ADDR map_offset = r_debug + lmo->r_map_offset;
 	  if (read_one_ptr (pid, map_offset, &lm_addr, ptr_size) != 0)
-	    warning ("unable to read r_map from %s",
+	    warning (_("unable to read r_map from %s"),
 		     core_addr_to_string (map_offset));
 	}
     }
@@ -1050,7 +1050,7 @@ netbsd_qxfer_libraries_svr4 (const pid_t pid, const char *annex,
     {
       if (lm_prev != l_prev)
 	{
-	  warning ("Corrupted shared library list: 0x%lx != 0x%lx",
+	  warning (_("Corrupted shared library list: 0x%lx != 0x%lx"),
 		   (long) lm_prev, (long) l_prev);
 	  break;
 	}
diff --git a/gdbserver/regcache.cc b/gdbserver/regcache.cc
index 4ace68869e5..7e1fd9a82e0 100644
--- a/gdbserver/regcache.cc
+++ b/gdbserver/regcache.cc
@@ -206,7 +206,7 @@ registers_from_string (struct regcache *regcache, char *buf)
 
   if (len != tdesc->registers_size * 2)
     {
-      warning ("Wrong sized register packet (expected %d bytes, got %d)",
+      warning (_("Wrong sized register packet (expected %d bytes, got %d)"),
 	       2 * tdesc->registers_size, len);
       if (len > tdesc->registers_size * 2)
 	len = tdesc->registers_size * 2;
diff --git a/gdbserver/remote-utils.cc b/gdbserver/remote-utils.cc
index b7ab200392e..4a35e5c41b6 100644
--- a/gdbserver/remote-utils.cc
+++ b/gdbserver/remote-utils.cc
@@ -1751,14 +1751,14 @@ relocate_instruction (CORE_ADDR *to, CORE_ADDR oldloc)
 
   if (cs.own_buf[0] == 'E')
     {
-      warning ("An error occurred while relocating an instruction: %s",
+      warning (_("An error occurred while relocating an instruction: %s"),
 	       cs.own_buf);
       return -1;
     }
 
   if (!startswith (cs.own_buf, "qRelocInsn:"))
     {
-      warning ("Malformed response to qRelocInsn, ignoring: %s",
+      warning (_("Malformed response to qRelocInsn, ignoring: %s"),
 	       cs.own_buf);
       return -1;
     }
diff --git a/gdbserver/thread-db.cc b/gdbserver/thread-db.cc
index 96ad2ae28d0..af39a58154e 100644
--- a/gdbserver/thread-db.cc
+++ b/gdbserver/thread-db.cc
@@ -192,7 +192,7 @@ find_one_thread (ptid_t ptid)
 
   if (lwpid != ti.ti_lid)
     {
-      warning ("PID mismatch!  Expected %ld, got %ld",
+      warning (_("PID mismatch!  Expected %ld, got %ld"),
 	       (long) lwpid, (long) ti.ti_lid);
       return 0;
     }
@@ -227,7 +227,7 @@ attach_thread (const td_thrhandle_t *th_p, td_thrinfo_t *ti_p)
     {
       std::string reason = linux_ptrace_attach_fail_reason_string (ptid, err);
 
-      warning ("Could not attach to thread %ld (LWP %d): %s",
+      warning (_("Could not attach to thread %ld (LWP %d): %s"),
 	       (unsigned long) ti_p->ti_tid, ti_p->ti_lid, reason.c_str ());
 
       return 0;
diff --git a/gdbserver/tracepoint.cc b/gdbserver/tracepoint.cc
index de661a7ceb1..570208c82d4 100644
--- a/gdbserver/tracepoint.cc
+++ b/gdbserver/tracepoint.cc
@@ -6303,7 +6303,7 @@ gdb_agent_helper_thread (void *arg)
 
 	  if (fd < 0)
 	    {
-	      warning ("Accept returned %d, error: %s",
+	      warning (_("Accept returned %d, error: %s"),
 		       fd, safe_strerror (errno));
 	      break;
 	    }
@@ -6315,7 +6315,7 @@ gdb_agent_helper_thread (void *arg)
 
 	  if (ret == -1)
 	    {
-	      warning ("reading socket (fd=%d) failed with %s",
+	      warning (_("reading socket (fd=%d) failed with %s"),
 		       fd, safe_strerror (errno));
 	      close (fd);
 	      break;
-- 
2.51.0


  parent reply	other threads:[~2026-06-07  6:05 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-07  6:00 [PATCH 00/10] [gdb] Add some missing i18n support Tom de Vries
2026-06-07  6:00 ` [PATCH 01/10] [gdb] Add missing i18n support to error strings (part 1) Tom de Vries
2026-06-07  6:00 ` [PATCH 02/10] [gdb] Add missing i18n support to error strings (part 2) Tom de Vries
2026-06-09 16:56   ` Tom Tromey
2026-06-10  6:10     ` Tom de Vries
2026-06-07  6:00 ` [PATCH 03/10] [gdb] Add missing i18n support to error strings (part 3) Tom de Vries
2026-06-07  6:00 ` [PATCH 04/10] [gdb] Add missing i18n support to error strings (part 4) Tom de Vries
2026-06-07  6:00 ` [PATCH 05/10] [gdb] Add missing i18n support to errors strings (part 5) Tom de Vries
2026-06-07  6:00 ` [PATCH 06/10] [gdb] Add missing i18n support to warning strings (part 1) Tom de Vries
2026-06-07  6:00 ` [PATCH 07/10] [gdb] Add missing i18n support to warning strings (part 2) Tom de Vries
2026-06-07  6:00 ` Tom de Vries [this message]
2026-06-07  6:00 ` [PATCH 09/10] [gdb] Add missing i18n support to warning strings (part 4) Tom de Vries
2026-06-09 17:00   ` Tom Tromey
2026-06-07  6:00 ` [PATCH 10/10] [gdb] Add missing i18n support to warning strings (part 5) Tom de Vries
2026-06-09 17:01 ` [PATCH 00/10] [gdb] Add some missing i18n support Tom Tromey
2026-06-10  7:03   ` Tom de Vries
2026-06-10 13:21     ` 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=20260607060041.410491-9-tdevries@suse.de \
    --to=tdevries@suse.de \
    --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