[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 <tom@tromey.com>
This commit is contained in:
Tom de Vries 2026-06-09 22:14:07 +02:00
parent 6c22e5b94a
commit 3d094ec4c5
9 changed files with 20 additions and 20 deletions

View 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));

View 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 */

View 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);
}
}

View 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;
}

View 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;
}

View 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;

View 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;
}

View 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;

View 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;