Remove cmd_cfunc_ftype
[deliverable/binutils-gdb.git] / gdb / thread.c
index 7309302b6b6be107b11e18a7611f30f7db98949d..1e81a614341ff92a9d9a90c78acb2b4e4a6fc0f5 100644 (file)
@@ -60,7 +60,6 @@ static int highest_thread_num;
    spawned new threads we haven't heard of yet.  */
 static int threads_executing;
 
-static void thread_apply_all_command (char *, int);
 static int thread_alive (struct thread_info *);
 
 /* RAII type used to increase / decrease the refcount of each thread
@@ -1652,7 +1651,7 @@ tp_array_compar (const thread_info *a, const thread_info *b)
    thread apply all p x/i $pc   Apply x/i $pc cmd to all threads.  */
 
 static void
-thread_apply_all_command (char *cmd, int from_tty)
+thread_apply_all_command (const char *cmd, int from_tty)
 {
   tp_array_compar_ascending = false;
   if (cmd != NULL
@@ -1667,10 +1666,6 @@ thread_apply_all_command (char *cmd, int from_tty)
 
   update_thread_list ();
 
-  /* Save a copy of the command in case it is clobbered by
-     execute_command.  */
-  std::string saved_cmd = cmd;
-
   int tc = live_threads_count ();
   if (tc != 0)
     {
@@ -1708,10 +1703,11 @@ thread_apply_all_command (char *cmd, int from_tty)
            printf_filtered (_("\nThread %s (%s):\n"),
                             print_thread_id (thr),
                             target_pid_to_str (inferior_ptid));
-           execute_command (cmd, from_tty);
 
-           /* Restore exact command used previously.  */
-           strcpy (cmd, saved_cmd.c_str ());
+           /* Use a copy of the command in case it is clobbered by
+              execute_command.  */
+           std::string copy = cmd;
+           execute_command (&copy[0], from_tty);
          }
     }
 }
This page took 0.026226 seconds and 4 git commands to generate.