This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: What to do with threads?
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: gdb at sources dot redhat dot com
- Date: Mon, 3 Mar 2003 21:59:13 -0500
- Subject: Re: What to do with threads?
- References: <3E3D87B5.9080306@redhat.com> <3E63E7D8.2030401@redhat.com>
On Mon, Mar 03, 2003 at 06:40:08PM -0500, Andrew Cagney wrote:
> Since GDB's frames have a very short life time (flushed the moment there
> is even the faintest wiff of a changed target) it may be possible to
> instead use `struct thread_info':
>
> struct thread_info *get_frame_thread (frame)
>
> and
>
> get_thread_regcache (thread_info);
>
> For this to work, though, there would need to be a function that was
> guarenteed to always return a thread_info object. Such a
> get_selected_thread() or find_thread_by_tpid(?inferior_tpid?) would need
> to return a thread object when there were no threads ...
Definitely sounds like a change whose time has come. There's one
hiccup in that when we go from one-process to one-thread we need to
update the thread ID; you can see how I handled this (inelegantly) in
gdbserver. Gdbserver's always got a thread... more or less.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer