2008-07-11 Pedro Alves * thread.c (thread_apply_command): Move making the cleanup out of the loop. --- gdb/thread.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Index: src/gdb/thread.c =================================================================== --- src.orig/gdb/thread.c 2008-07-11 12:16:32.000000000 +0100 +++ src/gdb/thread.c 2008-07-11 12:23:43.000000000 +0100 @@ -1102,6 +1102,8 @@ thread_apply_command (char *tidlist, int 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 warning (_("Thread %d has terminated."), start); else { - make_cleanup_restore_current_thread (); - if (non_stop) context_switch_to (tp->ptid); else