* lib/mi-support.exp (mi_gdb_load): Fix typo.
[deliverable/binutils-gdb.git] / gdb / thread.c
index 8a749011ac1c904fe26ff773d28d42200f93f87d..1f88acbfe5325ad25967a6506533274f97c3e2b9 100644 (file)
@@ -282,10 +282,10 @@ do_captured_list_thread_ids (struct ui_out *uiout, void *arg)
 /* Official gdblib interface function to get a list of thread ids and
    the total number. */
 enum gdb_rc
-gdb_list_thread_ids (struct ui_out *uiout)
+gdb_list_thread_ids (struct ui_out *uiout, char **error_message)
 {
-  return catch_exceptions (uiout, do_captured_list_thread_ids, NULL,
-                          NULL, RETURN_MASK_ALL);
+  return catch_exceptions_with_msg (uiout, do_captured_list_thread_ids, NULL,
+                                   error_message, RETURN_MASK_ALL);
 }
 
 /* Load infrun state for the thread PID.  */
@@ -442,7 +442,7 @@ info_threads_command (char *arg, int from_tty)
   if (cur_frame == NULL)
     {
       /* Ooops, can't restore, tell user where we are.  */
-      warning ("Couldn't restore frame in current thread, at frame 0");
+      warning (_("Couldn't restore frame in current thread, at frame 0"));
       print_stack_frame (get_selected_frame (NULL), 0, LOCATION);
     }
   else
@@ -518,7 +518,7 @@ thread_apply_all_command (char *cmd, int from_tty)
   char *saved_cmd;
 
   if (cmd == NULL || *cmd == '\000')
-    error ("Please specify a command following the thread ID list");
+    error (_("Please specify a command following the thread ID list"));
 
   old_chain = make_cleanup_restore_current_thread (inferior_ptid);
 
@@ -534,7 +534,7 @@ thread_apply_all_command (char *cmd, int from_tty)
     if (thread_alive (tp))
       {
        switch_to_thread (tp->ptid);
-       printf_filtered ("\nThread %d (%s):\n",
+       printf_filtered (_("\nThread %d (%s):\n"),
                         tp->num, target_tid_to_str (inferior_ptid));
        execute_command (cmd, from_tty);
        strcpy (cmd, saved_cmd);        /* Restore exact command used previously */
@@ -554,12 +554,12 @@ thread_apply_command (char *tidlist, int from_tty)
   char *saved_cmd;
 
   if (tidlist == NULL || *tidlist == '\000')
-    error ("Please specify a thread ID list");
+    error (_("Please specify a thread ID list"));
 
   for (cmd = tidlist; *cmd != '\000' && !isalpha (*cmd); cmd++);
 
   if (*cmd == '\000')
-    error ("Please specify a command following the thread ID list");
+    error (_("Please specify a command following the thread ID list"));
 
   old_chain = make_cleanup_restore_current_thread (inferior_ptid);
 
@@ -574,7 +574,7 @@ thread_apply_command (char *tidlist, int from_tty)
 
       start = strtol (tidlist, &p, 10);
       if (p == tidlist)
-       error ("Error parsing %s", tidlist);
+       error (_("Error parsing %s"), tidlist);
       tidlist = p;
 
       while (*tidlist == ' ' || *tidlist == '\t')
@@ -585,7 +585,7 @@ thread_apply_command (char *tidlist, int from_tty)
          tidlist++;            /* Skip the - */
          end = strtol (tidlist, &p, 10);
          if (p == tidlist)
-           error ("Error parsing %s", tidlist);
+           error (_("Error parsing %s"), tidlist);
          tidlist = p;
 
          while (*tidlist == ' ' || *tidlist == '\t')
@@ -599,13 +599,13 @@ thread_apply_command (char *tidlist, int from_tty)
          tp = find_thread_id (start);
 
          if (!tp)
-           warning ("Unknown thread %d.", start);
+           warning (_("Unknown thread %d."), start);
          else if (!thread_alive (tp))
-           warning ("Thread %d has terminated.", start);
+           warning (_("Thread %d has terminated."), start);
          else
            {
              switch_to_thread (tp->ptid);
-             printf_filtered ("\nThread %d (%s):\n", tp->num,
+             printf_filtered (_("\nThread %d (%s):\n"), tp->num,
                               target_tid_to_str (inferior_ptid));
              execute_command (cmd, from_tty);
              strcpy (cmd, saved_cmd);  /* Restore exact command used previously */
@@ -627,15 +627,15 @@ thread_command (char *tidstr, int from_tty)
     {
       /* Don't generate an error, just say which thread is current. */
       if (target_has_stack)
-       printf_filtered ("[Current thread is %d (%s)]\n",
+       printf_filtered (_("[Current thread is %d (%s)]\n"),
                         pid_to_thread_id (inferior_ptid),
                         target_tid_to_str (inferior_ptid));
       else
-       error ("No stack.");
+       error (_("No stack."));
       return;
     }
 
-  gdb_thread_select (uiout, tidstr);
+  gdb_thread_select (uiout, tidstr, NULL);
 }
 
 static int
@@ -649,10 +649,10 @@ do_captured_thread_select (struct ui_out *uiout, void *tidstr)
   tp = find_thread_id (num);
 
   if (!tp)
-    error ("Thread ID %d not known.", num);
+    error (_("Thread ID %d not known."), num);
 
   if (!thread_alive (tp))
-    error ("Thread ID %d has terminated.\n", num);
+    error (_("Thread ID %d has terminated."), num);
 
   switch_to_thread (tp->ptid);
 
@@ -667,10 +667,10 @@ do_captured_thread_select (struct ui_out *uiout, void *tidstr)
 }
 
 enum gdb_rc
-gdb_thread_select (struct ui_out *uiout, char *tidstr)
+gdb_thread_select (struct ui_out *uiout, char *tidstr, char **error_message)
 {
-  return catch_exceptions (uiout, do_captured_thread_select, tidstr,
-                          NULL, RETURN_MASK_ALL);
+  return catch_exceptions_with_msg (uiout, do_captured_thread_select, tidstr,
+                                   error_message, RETURN_MASK_ALL);
 }
 
 /* Commands with a prefix of `thread'.  */
@@ -682,18 +682,19 @@ _initialize_thread (void)
   static struct cmd_list_element *thread_apply_list = NULL;
 
   add_info ("threads", info_threads_command,
-           "IDs of currently known threads.");
+           _("IDs of currently known threads."));
 
-  add_prefix_cmd ("thread", class_run, thread_command,
-                 "Use this command to switch between threads.\n\
-The new thread ID must be currently known.", &thread_cmd_list, "thread ", 1, &cmdlist);
+  add_prefix_cmd ("thread", class_run, thread_command, _("\
+Use this command to switch between threads.\n\
+The new thread ID must be currently known."),
+                 &thread_cmd_list, "thread ", 1, &cmdlist);
 
   add_prefix_cmd ("apply", class_run, thread_apply_command,
-                 "Apply a command to a list of threads.",
+                 _("Apply a command to a list of threads."),
                  &thread_apply_list, "apply ", 1, &thread_cmd_list);
 
   add_cmd ("all", class_run, thread_apply_all_command,
-          "Apply a command to all threads.", &thread_apply_list);
+          _("Apply a command to all threads."), &thread_apply_list);
 
   if (!xdb_commands)
     add_com_alias ("t", "thread", class_run, 1);
This page took 0.035304 seconds and 4 git commands to generate.