aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2008-07-11 11:26:39 +0000
committerPedro Alves <palves@redhat.com>2008-07-11 11:26:39 +0000
commit65fc9b77211c67d97824de129cfa0945be80ded0 (patch)
treef31a0a89a95ab80619fd09afee051c2c75646466
parentc5e38e547e14e9f282c9d98a7c70272cecdcac10 (diff)
downloadgdb-65fc9b77211c67d97824de129cfa0945be80ded0.zip
gdb-65fc9b77211c67d97824de129cfa0945be80ded0.tar.gz
gdb-65fc9b77211c67d97824de129cfa0945be80ded0.tar.bz2
* thread.c (thread_apply_command): Move making the cleanup out of
the loop.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/thread.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 4c5de49..7c9c3ed 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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.
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