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 04/10] [gdb] Add missing i18n support to error strings (part 4)
Date: Sun,  7 Jun 2026 08:00:35 +0200	[thread overview]
Message-ID: <20260607060041.410491-5-tdevries@suse.de> (raw)
In-Reply-To: <20260607060041.410491-1-tdevries@suse.de>

Add missing i18n support to some error 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]\)error (\("[^"]*"\)\(.*\));/\1error (_(\2)\3);/;:l'
...
---
 gdbserver/linux-low.cc         | 4 ++--
 gdbserver/server.cc            | 2 +-
 gdbserver/thread-db.cc         | 4 ++--
 gdbserver/tracepoint.cc        | 2 +-
 gdbserver/win32-aarch64-low.cc | 2 +-
 gdbserver/win32-i386-low.cc    | 2 +-
 6 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/gdbserver/linux-low.cc b/gdbserver/linux-low.cc
index 117b67afda2..d3a8a7c1f85 100644
--- a/gdbserver/linux-low.cc
+++ b/gdbserver/linux-low.cc
@@ -1173,7 +1173,7 @@ linux_process_target::attach (unsigned long pid)
       this->remove_linux_process (proc);
 
       std::string reason = linux_ptrace_attach_fail_reason_string (ptid, err);
-      error ("Cannot attach to process %ld: %s", pid, reason.c_str ());
+      error (_("Cannot attach to process %ld: %s"), pid, reason.c_str ());
     }
 
   open_proc_mem_file (proc);
@@ -5280,7 +5280,7 @@ linux_process_target::store_register (const usrregs_info *usrregs,
 
 
 	  if (!low_cannot_store_register (regno))
-	    error ("writing register %d: %s", regno, safe_strerror (errno));
+	    error (_("writing register %d: %s"), regno, safe_strerror (errno));
 	}
       regaddr += sizeof (PTRACE_XFER_TYPE);
     }
diff --git a/gdbserver/server.cc b/gdbserver/server.cc
index f732616bba8..baccdf00172 100644
--- a/gdbserver/server.cc
+++ b/gdbserver/server.cc
@@ -1576,7 +1576,7 @@ parse_debug_options (const char *options)
 	  }
 
       if (!found)
-	error ("unknown debug option '%s'", opt.c_str ());
+	error (_("unknown debug option '%s'"), opt.c_str ());
 
       options = (*end == ',') ? end + 1 : end;
     }
diff --git a/gdbserver/thread-db.cc b/gdbserver/thread-db.cc
index fd78ee8a208..24b7c84d907 100644
--- a/gdbserver/thread-db.cc
+++ b/gdbserver/thread-db.cc
@@ -274,7 +274,7 @@ find_new_threads_callback (const td_thrhandle_t *th_p, void *data)
 
   err = thread_db->td_thr_get_info_p (th_p, &ti);
   if (err != TD_OK)
-    error ("Cannot get thread info: %s", thread_db_err_str (err));
+    error (_("Cannot get thread info: %s"), thread_db_err_str (err));
 
   if (ti.ti_lid == -1)
     {
@@ -343,7 +343,7 @@ thread_db_find_new_threads (void)
 	}
     }
   if (err != TD_OK)
-    error ("Cannot find new threads: %s", thread_db_err_str (err));
+    error (_("Cannot find new threads: %s"), thread_db_err_str (err));
 }
 
 /* Cache all future symbols that thread_db might request.  We can not
diff --git a/gdbserver/tracepoint.cc b/gdbserver/tracepoint.cc
index f5f29300949..9ffab6c24e4 100644
--- a/gdbserver/tracepoint.cc
+++ b/gdbserver/tracepoint.cc
@@ -6016,7 +6016,7 @@ upload_fast_traceframes (void)
 
       if (read_inferior_memory (tf, (unsigned char *) &ipa_tframe,
 				offsetof (struct traceframe, data)))
-	error ("Uploading: couldn't read traceframe at %s\n", paddress (tf));
+	error (_("Uploading: couldn't read traceframe at %s\n"), paddress (tf));
 
       if (ipa_tframe.tpnum == 0)
 	{
diff --git a/gdbserver/win32-aarch64-low.cc b/gdbserver/win32-aarch64-low.cc
index ac8c117d6e7..17f64906df4 100644
--- a/gdbserver/win32-aarch64-low.cc
+++ b/gdbserver/win32-aarch64-low.cc
@@ -175,7 +175,7 @@ aarch64_get_thread_context (windows_thread_info *th)
   if (!ret)
     {
       DWORD e = GetLastError ();
-      error ("GetThreadContext failure %ld\n", (long) e);
+      error (_("GetThreadContext failure %ld\n"), (long) e);
     }
 }
 
diff --git a/gdbserver/win32-i386-low.cc b/gdbserver/win32-i386-low.cc
index 15addd9175d..1aacd302074 100644
--- a/gdbserver/win32-i386-low.cc
+++ b/gdbserver/win32-i386-low.cc
@@ -265,7 +265,7 @@ i386_get_thread_context (windows_thread_info *th)
 	      goto again;
 	    }
 
-	  error ("GetThreadContext failure %ld\n", (long) e);
+	  error (_("GetThreadContext failure %ld\n"), (long) e);
 	}
     });
 }
-- 
2.51.0


  parent reply	other threads:[~2026-06-07  6:04 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 ` Tom de Vries [this message]
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 ` [PATCH 08/10] [gdb] Add missing i18n support to warning strings (part 3) Tom de Vries
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-5-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