This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH] detaching and threaded linux apps
- From: Mark Kettenis <kettenis at chello dot nl>
- To: Liam Stewart <liams at redhat dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: 03 Jun 2002 23:53:03 +0200
- Subject: Re: [PATCH] detaching and threaded linux apps
- References: <20020603143634.A12472@redhat.com>
Liam Stewart <liams@redhat.com> writes:
> thread_db_detach and lin_lwp_detach don't remove their target operation
> structures from the target list when a detach on a threaded application
> is done. This leads to the failure of the num_lwps == 1 assertion if a
> gdb user (for some reason) detaches again before starting/attaching to a
> new inferior.
The fact that thread_db_detach and lin_lwp_detach don't unpush their
targect vector is intentional. The target vector is installed as a
result of loading the thread library, not (necessarily) as a result of
attaching to a threaded application. Therefore is should only be
uninstalled if the thread library is unloaded. The right wat of
fixing this would be to prevent the assertion being triggered if
num_lwps == 0. Explicitly checking for this condition and displaying
an error message in lin_lwp_detach() might be sufficient.
Mark