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 01/10] [gdb] Add missing i18n support to error strings (part 1)
Date: Sun,  7 Jun 2026 08:00:32 +0200	[thread overview]
Message-ID: <20260607060041.410491-2-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 \
    | egrep -v /testsuite/ \
    | xargs sed -i \
          's/\([ \t]\)error (\("[^"]*"\));/\1error (_(\2));/'
...
---
 gdb/break-cond-parse.c    | 12 ++++++------
 gdb/f-array-walker.h      |  4 ++--
 gdb/f-lang.c              |  2 +-
 gdb/f-valprint.c          |  2 +-
 gdb/mi/mi-parse.c         |  8 ++++----
 gdb/valarith.c            |  2 +-
 gdbserver/mem-break.cc    |  2 +-
 gdbserver/remote-utils.cc |  4 ++--
 gdbserver/server.cc       | 10 +++++-----
 gdbserver/tracepoint.cc   | 14 +++++++-------
 gdbserver/win32-low.cc    |  4 ++--
 11 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/gdb/break-cond-parse.c b/gdb/break-cond-parse.c
index 7cb70df378c..f552c171c05 100644
--- a/gdb/break-cond-parse.c
+++ b/gdb/break-cond-parse.c
@@ -485,9 +485,9 @@ create_breakpoint_parse_arg_string
 	case token::type::THREAD:
 	  {
 	    if (thread != -1)
-	      error ("You can specify only one thread.");
+	      error (_("You can specify only one thread."));
 	    if (task != -1 || inferior != -1)
-	      error ("You can specify only one of thread, inferior, or task.");
+	      error (_("You can specify only one of thread, inferior, or task."));
 	    const char *tmptok;
 	    thread_info *thr = parse_thread_id (tok_value.c_str (), &tmptok);
 	    gdb_assert (*tmptok == '\0');
@@ -497,9 +497,9 @@ create_breakpoint_parse_arg_string
 	case token::type::INFERIOR:
 	  {
 	    if (inferior != -1)
-	      error ("You can specify only one inferior.");
+	      error (_("You can specify only one inferior."));
 	    if (task != -1 || thread != -1)
-	      error ("You can specify only one of thread, inferior, or task.");
+	      error (_("You can specify only one of thread, inferior, or task."));
 	    char *tmptok;
 	    long inferior_id = strtol (tok_value.c_str (), &tmptok, 0);
 	    if (*tmptok != '\0')
@@ -515,9 +515,9 @@ create_breakpoint_parse_arg_string
 	case token::type::TASK:
 	  {
 	    if (task != -1)
-	      error ("You can specify only one task.");
+	      error (_("You can specify only one task."));
 	    if (inferior != -1 || thread != -1)
-	      error ("You can specify only one of thread, inferior, or task.");
+	      error (_("You can specify only one of thread, inferior, or task."));
 	    char *tmptok;
 	    long task_id = strtol (tok_value.c_str (), &tmptok, 0);
 	    if (*tmptok != '\0')
diff --git a/gdb/f-array-walker.h b/gdb/f-array-walker.h
index c743d59c47a..bb8cb0ca599 100644
--- a/gdb/f-array-walker.h
+++ b/gdb/f-array-walker.h
@@ -42,7 +42,7 @@ class fortran_array_offset_calculator
     /* Get the range, and extract the bounds.  */
     struct type *range_type = type->index_type ();
     if (!get_discrete_bounds (range_type, &m_lowerbound, &m_upperbound))
-      error ("unable to read array bounds");
+      error (_("unable to read array bounds"));
 
     /* Figure out the stride for this array.  */
     struct type *elt_type = check_typedef (type->target_type ());
@@ -221,7 +221,7 @@ class fortran_array_walker
     struct type *range_type = check_typedef (type)->index_type ();
     LONGEST lowerbound, upperbound;
     if (!get_discrete_bounds (range_type, &lowerbound, &upperbound))
-      error ("failed to get range bounds");
+      error (_("failed to get range bounds"));
 
     /* CALC is used to calculate the offsets for each element in this
        dimension.  */
diff --git a/gdb/f-lang.c b/gdb/f-lang.c
index e2a34b22ba3..90062734b0e 100644
--- a/gdb/f-lang.c
+++ b/gdb/f-lang.c
@@ -1981,7 +1981,7 @@ fortran_adjust_dynamic_array_base_address_hack (struct type *type,
       struct type *range_type = tmp_type->index_type ();
       LONGEST lowerbound, upperbound, stride;
       if (!get_discrete_bounds (range_type, &lowerbound, &upperbound))
-	error ("failed to get range bounds");
+	error (_("failed to get range bounds"));
 
       /* Figure out the stride for this dimension.  */
       struct type *elt_type = check_typedef (tmp_type->target_type ());
diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
index 13921c03a48..8a383281a6c 100644
--- a/gdb/f-valprint.c
+++ b/gdb/f-valprint.c
@@ -356,7 +356,7 @@ class fortran_array_printer_impl : public fortran_array_walker_base_impl
 	struct type *range_type = check_typedef (type)->index_type ();
 	LONGEST lowerbound, upperbound;
 	if (!get_discrete_bounds (range_type, &lowerbound, &upperbound))
-	  error ("failed to get range bounds");
+	  error (_("failed to get range bounds"));
 
 	/* CALC is used to calculate the offsets for each element.  */
 	fortran_array_offset_calculator calc (type);
diff --git a/gdb/mi/mi-parse.c b/gdb/mi/mi-parse.c
index 68c56c9b57f..e0763ebf46f 100644
--- a/gdb/mi/mi-parse.c
+++ b/gdb/mi/mi-parse.c
@@ -437,28 +437,28 @@ mi_parse::mi_parse (gdb::unique_xmalloc_ptr<char> command,
 	{
 	  ++i;
 	  if (i == args.size ())
-	    error ("No argument to '--thread-group'");
+	    error (_("No argument to '--thread-group'"));
 	  this->set_thread_group (args[i].get (), nullptr);
 	}
       else if (streq (chp, "--thread"))
 	{
 	  ++i;
 	  if (i == args.size ())
-	    error ("No argument to '--thread'");
+	    error (_("No argument to '--thread'"));
 	  this->set_thread (args[i].get (), nullptr);
 	}
       else if (streq (chp, "--frame"))
 	{
 	  ++i;
 	  if (i == args.size ())
-	    error ("No argument to '--frame'");
+	    error (_("No argument to '--frame'"));
 	  this->set_frame (args[i].get (), nullptr);
 	}
       else if (streq (chp, "--language"))
 	{
 	  ++i;
 	  if (i == args.size ())
-	    error ("No argument to '--language'");
+	    error (_("No argument to '--language'"));
 	  this->set_language (args[i].get (), nullptr);
 	}
       else
diff --git a/gdb/valarith.c b/gdb/valarith.c
index ed5b5d8adf9..62a35841f1f 100644
--- a/gdb/valarith.c
+++ b/gdb/valarith.c
@@ -690,7 +690,7 @@ value_concat (struct value *arg1, struct value *arg2)
   struct type *type2 = check_typedef (arg2->type ());
 
   if (type1->code () != TYPE_CODE_ARRAY && type2->code () != TYPE_CODE_ARRAY)
-    error ("no array provided to concatenation");
+    error (_("no array provided to concatenation"));
 
   LONGEST low1, high1;
   struct type *elttype1 = type1;
diff --git a/gdbserver/mem-break.cc b/gdbserver/mem-break.cc
index 6f797ccce69..134a856a3db 100644
--- a/gdbserver/mem-break.cc
+++ b/gdbserver/mem-break.cc
@@ -751,7 +751,7 @@ reinsert_fast_tracepoint_jumps_at (CORE_ADDR where)
     }
 
   if (jp->inserted)
-    error ("Jump already inserted at reinsert time.");
+    error (_("Jump already inserted at reinsert time."));
 
   jp->inserted = 1;
 
diff --git a/gdbserver/remote-utils.cc b/gdbserver/remote-utils.cc
index d7049baf083..65452fbcdfa 100644
--- a/gdbserver/remote-utils.cc
+++ b/gdbserver/remote-utils.cc
@@ -319,7 +319,7 @@ remote_open (const char *name)
   port_str = strchr (name, ':');
 #ifdef USE_WIN32API
   if (port_str == NULL)
-    error ("Only HOST:PORT is supported on this platform.");
+    error (_("Only HOST:PORT is supported on this platform."));
 #endif
 
   if (streq (name, STDIO_CONNECTION_NAME))
@@ -1351,7 +1351,7 @@ prepare_resume_reply (char *buf, ptid_t ptid, const target_waitstatus &status)
       sprintf (buf, "N");
       break;
     default:
-      error ("unhandled waitkind");
+      error (_("unhandled waitkind"));
       break;
     }
 }
diff --git a/gdbserver/server.cc b/gdbserver/server.cc
index 37859f26b7e..b6d785a0c64 100644
--- a/gdbserver/server.cc
+++ b/gdbserver/server.cc
@@ -1252,7 +1252,7 @@ handle_search_memory (char *own_buf, int packet_len)
 
   pattern = (gdb_byte *) malloc (packet_len);
   if (pattern == NULL)
-    error ("Unable to allocate memory to perform the search");
+    error (_("Unable to allocate memory to perform the search"));
 
   if (decode_search_memory_packet (own_buf + cmd_name_len,
 				   packet_len - cmd_name_len,
@@ -1260,7 +1260,7 @@ handle_search_memory (char *own_buf, int packet_len)
 				   pattern, &pattern_len) < 0)
     {
       free (pattern);
-      error ("Error in parsing qSearch:memory packet");
+      error (_("Error in parsing qSearch:memory packet"));
     }
 
   auto read_memory = [] (CORE_ADDR addr, gdb_byte *result, size_t len)
@@ -1561,7 +1561,7 @@ parse_debug_options (const char *options)
       std::string opt (options, end - options);
 
       if (opt.size () == 0)
-	error ("invalid empty debug option");
+	error (_("invalid empty debug option"));
 
       bool is_opt_all = opt == "all";
 
@@ -4588,7 +4588,7 @@ captured_main (int argc, char *argv[])
   else if (pid != 0)
     {
       if (attach_inferior (pid) == -1)
-	error ("Attaching not supported on this target");
+	error (_("Attaching not supported on this target"));
 
       /* Otherwise succeeded.  */
     }
@@ -4614,7 +4614,7 @@ captured_main (int argc, char *argv[])
     was_running = true;
 
   if (!was_running && !multi_mode)
-    error ("No program to debug");
+    error (_("No program to debug"));
 
   while (1)
     {
diff --git a/gdbserver/tracepoint.cc b/gdbserver/tracepoint.cc
index 25a3e8ceadf..60c8926bb8b 100644
--- a/gdbserver/tracepoint.cc
+++ b/gdbserver/tracepoint.cc
@@ -2910,7 +2910,7 @@ install_fast_tracepoint (struct tracepoint *tpoint, char *errbuf)
   if (read_inferior_data_pointer (ipa_sym_addrs.addr_gdb_collect_ptr,
 				  &collect))
     {
-      error ("error extracting gdb_collect_ptr");
+      error (_("error extracting gdb_collect_ptr"));
       return 1;
     }
 
@@ -3026,7 +3026,7 @@ cmd_qtstart (char *packet)
       /* Tell IPA about the correct tdesc.  */
       if (write_inferior_integer (ipa_sym_addrs.addr_ipa_tdesc_idx,
 				  target_get_ipa_tdesc_idx ()))
-	error ("Error setting ipa_tdesc_idx variable in lib");
+	error (_("Error setting ipa_tdesc_idx variable in lib"));
     }
 
   /* Start out empty.  */
@@ -3152,13 +3152,13 @@ cmd_qtstart (char *packet)
       stop_tracing_bkpt = set_breakpoint_at (ipa_sym_addrs.addr_stop_tracing,
 					     stop_tracing_handler);
       if (stop_tracing_bkpt == NULL)
-	error ("Error setting stop_tracing breakpoint");
+	error (_("Error setting stop_tracing breakpoint"));
 
       flush_trace_buffer_bkpt
 	= set_breakpoint_at (ipa_sym_addrs.addr_flush_trace_buffer,
 			     flush_trace_buffer_handler);
       if (flush_trace_buffer_bkpt == NULL)
-	error ("Error setting flush_trace_buffer breakpoint");
+	error (_("Error setting flush_trace_buffer breakpoint"));
     }
 
   target_unpause_all (true);
@@ -5444,7 +5444,7 @@ get_raw_reg_func_addr (void)
   CORE_ADDR res;
   if (read_inferior_data_pointer (ipa_sym_addrs.addr_get_raw_reg_ptr, &res))
     {
-      error ("error extracting get_raw_reg_ptr");
+      error (_("error extracting get_raw_reg_ptr"));
       return 0;
     }
   return res;
@@ -5457,7 +5457,7 @@ get_get_tsv_func_addr (void)
   if (read_inferior_data_pointer (
 	ipa_sym_addrs.addr_get_trace_state_variable_value_ptr, &res))
     {
-      error ("error extracting get_trace_state_variable_value_ptr");
+      error (_("error extracting get_trace_state_variable_value_ptr"));
       return 0;
     }
   return res;
@@ -5470,7 +5470,7 @@ get_set_tsv_func_addr (void)
   if (read_inferior_data_pointer (
 	ipa_sym_addrs.addr_set_trace_state_variable_value_ptr, &res))
     {
-      error ("error extracting set_trace_state_variable_value_ptr");
+      error (_("error extracting set_trace_state_variable_value_ptr"));
       return 0;
     }
   return res;
diff --git a/gdbserver/win32-low.cc b/gdbserver/win32-low.cc
index 6f1cf5ed025..5ffab38e6ee 100644
--- a/gdbserver/win32-low.cc
+++ b/gdbserver/win32-low.cc
@@ -310,7 +310,7 @@ do_initial_child_stuff (HANDLE proch, DWORD pid, int attached)
   if (windows_process.wow64_process
       && (Wow64GetThreadContext == nullptr
 	  || Wow64SetThreadContext == nullptr))
-    error ("WOW64 debugging is not supported on this system.\n");
+    error (_("WOW64 debugging is not supported on this system.\n"));
 
   windows_process.ignore_first_breakpoint
     = !attached && windows_process.wow64_process;
@@ -517,7 +517,7 @@ win32_process_target::create_inferior (const char *program,
   windows_process.attaching = 0;
 
   if (!program)
-    error ("No executable specified, specify executable to debug.\n");
+    error (_("No executable specified, specify executable to debug.\n"));
 
   flags = DEBUG_PROCESS | DEBUG_ONLY_THIS_PROCESS;
 
-- 
2.51.0


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