This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] infrun: don't resume the inferior when we notice a new thread (new_thread_event).
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 28 May 2012 23:19:37 +0200
- Subject: Re: [PATCH] infrun: don't resume the inferior when we notice a new thread (new_thread_event).
- References: <20120528204623.25996.69879.stgit@brno.lan>
On Mon, 28 May 2012 22:46:23 +0200, Pedro Alves wrote:
> If anyone as any idea why things are done in the current way, please
> speak up.
Not much, just that linux-nat.c linux_handle_extended_wait has this code by
you:
if (non_stop)
{
/* Add the new thread to GDB's lists as soon as possible
so that:
if (!thread_db_attach_lwp (new_lp->ptid))
{
/* We're not using thread_db. Add it to GDB's
list. */
target_post_attach (GET_LWP (new_lp->ptid));
add_thread (new_lp->ptid);
}
And for !non_stop mode add_thread gets delayed till handle_inferior_event;
which should not hurt. If this add would be done unconditionally in
linux-nat.c then this handle_inferior_event would never be reached.
But I do not see why to make that change, handle_inferior_event works.
Thanks,
Jan