From 65fc9b77211c67d97824de129cfa0945be80ded0 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Fri, 11 Jul 2008 11:26:39 +0000 Subject: [PATCH] * thread.c (thread_apply_command): Move making the cleanup out of the loop. --- gdb/ChangeLog | 5 +++++ gdb/thread.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 4c5de4987f..7c9c3edec1 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2008-07-11 Pedro Alves + + * thread.c (thread_apply_command): Move making the cleanup out of + the loop. + 2008-07-11 Pedro Alves Exited threads. diff --git a/gdb/thread.c b/gdb/thread.c index c3a63fccd2..8a17147626 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