Introduce complete_nested_command_line
[deliverable/binutils-gdb.git] / gdb / thread.c
index cde7c34df692741127da848b306be02edd43b142..a84dbf9fa1e87e85db93f8f4e518325564a79290 100644 (file)
@@ -540,12 +540,12 @@ find_thread_ptid (inferior *inf, ptid_t ptid)
 /* See gdbthread.h.  */
 
 struct thread_info *
-find_thread_by_handle (struct value *thread_handle, struct inferior *inf)
+find_thread_by_handle (gdb::array_view<const gdb_byte> handle,
+                      struct inferior *inf)
 {
-  return target_thread_handle_to_thread_info
-          (value_contents_all (thread_handle),
-           TYPE_LENGTH (value_type (thread_handle)),
-           inf);
+  return target_thread_handle_to_thread_info (handle.data (),
+                                             handle.size (),
+                                             inf);
 }
 
 /*
@@ -1191,7 +1191,8 @@ No selected thread.  See `help thread'.\n");
 /* See gdbthread.h.  */
 
 void
-print_thread_info (struct ui_out *uiout, char *requested_threads, int pid)
+print_thread_info (struct ui_out *uiout, const char *requested_threads,
+                  int pid)
 {
   print_thread_info_1 (uiout, requested_threads, 1, pid, 0);
 }
@@ -1461,7 +1462,8 @@ thr_try_catch_cmd (thread_info *thr, const char *cmd, int from_tty,
   switch_to_thread (thr);
   try
     {
-      std::string cmd_result = execute_command_to_string (cmd, from_tty);
+      std::string cmd_result = execute_command_to_string
+       (cmd, from_tty, gdb_stdout->term_out ());
       if (!flags.silent || cmd_result.length () > 0)
        {
          if (!flags.quiet)
@@ -1471,7 +1473,7 @@ thr_try_catch_cmd (thread_info *thr, const char *cmd, int from_tty,
          printf_filtered ("%s", cmd_result.c_str ());
        }
     }
-  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const gdb_exception_error &ex)
     {
       if (!flags.silent)
        {
@@ -1482,7 +1484,7 @@ thr_try_catch_cmd (thread_info *thr, const char *cmd, int from_tty,
          if (flags.cont)
            printf_filtered ("%s\n", ex.what ());
          else
-           throw_exception (ex);
+           throw;
        }
     }
 }
@@ -1558,7 +1560,6 @@ thread_apply_command (const char *tidlist, int from_tty)
 {
   qcs_flags flags;
   const char *cmd = NULL;
-  const char *cmd_or_flags;
   tid_range_parser parser;
 
   if (tidlist == NULL || *tidlist == '\000')
@@ -1570,17 +1571,15 @@ thread_apply_command (const char *tidlist, int from_tty)
       int inf_num, thr_start, thr_end;
 
       if (!parser.get_tid_range (&inf_num, &thr_start, &thr_end))
-       {
-         cmd = parser.cur_tok ();
-         break;
-       }
+       break;
     }
 
-  cmd_or_flags = cmd;
-  while (cmd != NULL && parse_flags_qcs ("thread apply", &cmd, &flags))
+  cmd = parser.cur_tok ();
+
+  while (parse_flags_qcs ("thread apply", &cmd, &flags))
     ;
 
-  if (cmd == NULL)
+  if (*cmd == '\0')
     error (_("Please specify a command following the thread ID list"));
 
   if (tidlist == cmd || !isalpha (cmd[0]))
@@ -1589,7 +1588,7 @@ thread_apply_command (const char *tidlist, int from_tty)
   scoped_restore_current_thread restore_thread;
 
   parser.init (tidlist, current_inferior ()->num);
-  while (!parser.finished () && parser.cur_tok () < cmd_or_flags)
+  while (!parser.finished ())
     {
       struct thread_info *tp = NULL;
       struct inferior *inf;
This page took 0.026901 seconds and 4 git commands to generate.