This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH]: Update thread list
- To: gdb-patches at sourceware dot cygnus dot com
- Subject: [PATCH]: Update thread list
- From: Michael Snyder <msnyder at cygnus dot com>
- Date: Fri, 21 Jul 2000 17:14:59 -0700
- Newsgroups: cygnus.patches.gdb
- Organization: Cygnus Solutions
I can think of two times when it is both safe and useful
for GDB to go query the target to find out if there are
any new threads.
1) "info threads" and
2) "thread apply all xxx"
This change adds the second (the first is already in place).
2000-07-21 Michael Snyder <msnyder@cleaver.cygnus.com>
* thread.c (thread_apply_all_command): Update thread list first.
diff -p -r1.4 thread.c
*** thread.c 2000/07/19 21:03:06 1.4
--- thread.c 2000/07/22 00:14:42
*************** thread_apply_all_command (cmd, from_tty)
*** 567,572 ****
--- 567,576 ----
old_chain = make_cleanup_restore_current_thread (inferior_pid);
+ /* It is safe to update the thread list now, before
+ traversing it for "thread apply all". MVS */
+ target_find_new_threads ();
+
for (tp = thread_list; tp; tp = tp->next)
if (thread_alive (tp))
{