Re: About handle_inferior_event new_thread_event

Pedro Alves
2009-06-29T18:13:21Z

On Monday 29 June 2009 19:03:54, Michael Snyder wrote:
> There's been a lot of evolution as far as thread list
> accounting since that code was put in place.  In the
> very early days, this was the only way we had of discovering
> threads.  If a thread didn't get a stop event, gdb would
> not know that thread existed.

That's understandable, and still true on many targets (remote.c included,
but new threads found discovered by stop events are handled by
remote.c:remote_wait itself), but, you don't need to resume the
target immediately for that. You just need to add the thread
to the list, and continue handling the event. It's the resume-once
bit that I find surprising, and which makes me believe that
someone was using this in place of a ficticious
TARGET_WAITKIND_NEW_THREAD_EVENT (add new thread to list,
otherwise treat as TARGET_WAIKIND_SPURIOUS).

--
Pedro Alves