Remove redundant test in BFD_ASSERT
[deliverable/binutils-gdb.git] / gdb / thread.c
index c77585e3fc0029b571f8af8fa22278f060ff45c5..2593c701edd1029d385a938e7e6bf410f42c00fd 100644 (file)
@@ -30,6 +30,7 @@
 #include "value.h"
 #include "target.h"
 #include "gdbthread.h"
+#include "exceptions.h"
 #include "command.h"
 #include "gdbcmd.h"
 #include "regcache.h"
@@ -281,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.  */
@@ -441,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
@@ -517,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);
 
@@ -553,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);
 
@@ -573,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')
@@ -584,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')
@@ -598,9 +599,9 @@ 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);
@@ -630,11 +631,11 @@ thread_command (char *tidstr, int from_tty)
                         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
@@ -648,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);
 
@@ -666,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'.  */
This page took 0.02591 seconds and 4 git commands to generate.