]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb] Add missing i18n support to warning strings (part 3)
authorTom de Vries <tdevries@suse.de>
Tue, 9 Jun 2026 20:14:07 +0000 (22:14 +0200)
committerTom de Vries <tdevries@suse.de>
Tue, 9 Jun 2026 20:14:07 +0000 (22:14 +0200)
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 <tom@tromey.com>
gdb/procfs.c
gdb/symtab.c
gdb/windows-nat.c
gdbserver/linux-low.cc
gdbserver/netbsd-low.cc
gdbserver/regcache.cc
gdbserver/remote-utils.cc
gdbserver/thread-db.cc
gdbserver/tracepoint.cc

index fd5d1a76bd6d51b457634dd1d8839fbf2b5fdbd7..25319464bc8a255be9e7e2a2bded3d6c20f21c3d 100644 (file)
@@ -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));
index 3c10e1fd750652dfb19a50e3b8bca2280ac3b506..9fde2e6e6c97bbf18b4b79287f45ef990139e1e7 100644 (file)
@@ -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 */
index d9e924f16c6e5d362281623191a2ece046e5c71a..89d65ff3e7ec1369c1b81a3d1d740ac8a979ec8a 100644 (file)
@@ -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);
     }
 }
index 8a467ce508e9e79611683f7f2c0cc7f55b64c12a..05dbed239c8f2cebcf90efe480810856bc01dd9c 100644 (file)
@@ -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;
            }
index 8462c5d31801593e704a31ecc3e271c77e214bd7..6cd98911c5fd8bbb9d4ebf7e497dff894d5ed747 100644 (file)
@@ -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;
        }
index 4ace68869e50168652870b6ca37eb079f7e79c37..7e1fd9a82e0b19c368ad6c6206ecffef7089776c 100644 (file)
@@ -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;
index b7ab200392eb6fd95be9b063a5cea779f69ed37e..4a35e5c41b6f1872d99d9237a5066b4a4f505d95 100644 (file)
@@ -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;
     }
index 96ad2ae28d01001614c7df0ff042a72e3cf56d94..af39a58154e73a62b747d7e7e0374b01034a0bb6 100644 (file)
@@ -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;
index de661a7ceb1f883080125372f97312557be8dbb6..570208c82d4c59d17e9b88a67bca4300a1953c23 100644 (file)
@@ -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;