This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [3/7] Adjust the bsd-uthread target


On Fri, Aug 08, 2008 at 11:41:23PM +0100, Pedro Alves wrote:
> The "exited" state is what you get *after* you delete_thread the current
> thread (inferior_ptid).  We don't delete the thread from the thread list
> in that case, but instead tag it as "exited".  It means the thread list
> is still holding reference to a thread that has already exited.
> If you're seeing an event with a ptid equal to an "exited" thread,
> this is the OS reusing the ptid, but, it's a new thread, which
> should get a new gdb thread id, so things like thread
> specific breakpoints don't think this was the same thread, both the
> CLI user or MI see a "new thread event", etc. add_thread handles
> that case internally.  This means it is now safe to delete_thread 
> (inferior_ptid), regarding context-switching, and infrun state.  It
> wasn't a couple of weeks ago.

How many of the call sites for in_thread_list want to see exited
threads?  Maybe there should be another predicate (I'd suggest
thread_alive except target_thread_alive would confuse things...)

-- 
Daniel Jacobowitz
CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]