[binutils-gdb] [gdb] Add missing i18n support to error strings (part 2)

Tom de Vries via Gdb-cvs <[email protected]> Tue, 9 Jun 2026 20:14:22 +0000 (GMT)
Newsgroups gmane.comp.gdb.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=5a6fa4bf84e2dc5f02bbac3f2412a1a270b56036

commit 5a6fa4bf84e2dc5f02bbac3f2412a1a270b56036
Author: Tom de Vries <[email protected]>
Date:   Tue Jun 9 22:14:07 2026 +0200

    [gdb] Add missing i18n support to error strings (part 2)
    
    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),/;:l'
    ...
    
    Approved-By: Tom Tromey <[email protected]>

Diff:
---
 gdb/procfs.c            | 2 +-
 gdbserver/thread-db.cc  | 4 ++--
 gdbserver/tracepoint.cc | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gdb/procfs.c b/gdb/procfs.c
index 7472c10616e..fd5d1a76bd6 100644
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -599,7 +599,7 @@ static void
 proc_error (procinfo *pi, const char *func, int line)
 {
   int saved_errno = errno;
-  error ("procfs: %s line %d, %s: %s",
+  error (_("procfs: %s line %d, %s: %s"),
 	 func, line, pi->pathname, safe_strerror (saved_errno));
 }
 
diff --git a/gdbserver/thread-db.cc b/gdbserver/thread-db.cc
index 0bdcda2ced8..fd78ee8a208 100644
--- a/gdbserver/thread-db.cc
+++ b/gdbserver/thread-db.cc
@@ -178,13 +178,13 @@ find_one_thread (ptid_t ptid)
   td_err_e err = thread_db->td_ta_map_lwp2thr_p (thread_db->thread_agent, lwpid,
 						 &th);
   if (err != TD_OK)
-    error ("Cannot get thread handle for LWP %d: %s",
+    error (_("Cannot get thread handle for LWP %d: %s"),
 	   lwpid, thread_db_err_str (err));
 
   td_thrinfo_t ti;
   err = thread_db->td_thr_get_info_p (&th, &ti);
   if (err != TD_OK)
-    error ("Cannot get thread info for LWP %d: %s",
+    error (_("Cannot get thread info for LWP %d: %s"),
 	   lwpid, thread_db_err_str (err));
 
   threads_debug_printf ("Found thread %ld (LWP %d)",
diff --git a/gdbserver/tracepoint.cc b/gdbserver/tracepoint.cc
index 60c8926bb8b..3d3f0776fc0 100644
--- a/gdbserver/tracepoint.cc
+++ b/gdbserver/tracepoint.cc
@@ -6047,7 +6047,7 @@ upload_fast_traceframes (void)
 	      if (read_inferior_memory (tf
 					+ offsetof (struct traceframe, data),
 					block, ipa_tframe.data_size))
-		error ("Uploading: Couldn't read traceframe data at %s\n",
+		error (_("Uploading: Couldn't read traceframe data at %s\n"),
 		       paddress (tf + offsetof (struct traceframe, data)));
 	    }