OSDN Git Service

* thread.c (thread_apply_command): Move making the cleanup out of
authorPedro Alves <pedro@codesourcery.com>
Fri, 11 Jul 2008 11:26:39 +0000 (11:26 +0000)
committerPedro Alves <pedro@codesourcery.com>
Fri, 11 Jul 2008 11:26:39 +0000 (11:26 +0000)
the loop.

gdb/ChangeLog
gdb/thread.c

index 4c5de49..7c9c3ed 100644 (file)
@@ -1,5 +1,10 @@
 2008-07-11  Pedro Alves  <pedro@codesourcery.com>
 
+       * thread.c (thread_apply_command): Move making the cleanup out of
+       the loop.
+
+2008-07-11  Pedro Alves  <pedro@codesourcery.com>
+
        Exited threads.
 
        * thread.c (enum thread_state): New.
index c3a63fc..8a17147 100644 (file)
@@ -1102,6 +1102,8 @@ thread_apply_command (char *tidlist, int from_tty)
       else
        end = start;
 
+      make_cleanup_restore_current_thread ();
+
       for (; start <= end; start++)
        {
          tp = find_thread_id (start);
@@ -1112,8 +1114,6 @@ thread_apply_command (char *tidlist, int from_tty)
            warning (_("Thread %d has terminated."), start);
          else
            {
-             make_cleanup_restore_current_thread ();
-
              if (non_stop)
                context_switch_to (tp->ptid);
              else