aboutsummaryrefslogtreecommitdiff
path: root/gdb/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/thread.c')
-rw-r--r--gdb/thread.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/thread.c b/gdb/thread.c
index c3a63fc..8a17147 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -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