This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH]: Update thread list
- To: Michael Snyder <msnyder at cygnus dot com>
- Subject: Re: [PATCH]: Update thread list
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Wed, 26 Jul 2000 14:45:20 +1000
- CC: gdb-patches at sourceware dot cygnus dot com
- References: <3978E783.37F9@cygnus.com>
Michael Snyder wrote:
>
> 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).
Should this (and the other) call be wrapped in something that stops GDB
updating the thread list more than once? Doing a
target_find_new_threads() can get expensive and, assuming the target has
stopped, shouldn't change between each call.
But you're the thread maintainer.
Andrew
> 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))
> {