This is the mail archive of the gdb-patches@sources.redhat.com 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: [PATCH] detaching and threaded linux apps


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


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