From: Tom de Vries Date: Tue, 9 Jun 2026 20:14:07 +0000 (+0200) Subject: [gdb] Add missing i18n support to warning strings (part 3) X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3d094ec4c56db0b34c7e9a90084df8f89f2ca879;p=thirdparty%2Fbinutils-gdb.git [gdb] Add missing i18n support to warning strings (part 3) 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' ... Approved-By: Tom Tromey --- 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;