From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16070 invoked by alias); 3 Jun 2002 21:53:11 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 16040 invoked from network); 3 Jun 2002 21:53:06 -0000 Received: from unknown (HELO walton.kettenis.dyndns.org) (213.93.114.42) by sources.redhat.com with SMTP; 3 Jun 2002 21:53:06 -0000 Received: from elgar.kettenis.dyndns.org (elgar.kettenis.dyndns.org [192.168.0.2]) by walton.kettenis.dyndns.org (8.11.6/8.11.6) with ESMTP id g53Lr5O00327; Mon, 3 Jun 2002 23:53:05 +0200 (CEST) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: (from kettenis@localhost) by elgar.kettenis.dyndns.org (8.11.6/8.11.6) id g53Lr4H00648; Mon, 3 Jun 2002 23:53:04 +0200 (CEST) (envelope-from kettenis) To: Liam Stewart Cc: gdb-patches@sources.redhat.com Subject: Re: [PATCH] detaching and threaded linux apps References: <20020603143634.A12472@redhat.com> From: Mark Kettenis Date: Mon, 03 Jun 2002 14:53:00 -0000 In-Reply-To: Liam Stewart's message of "Mon, 3 Jun 2002 14:36:35 -0400" Message-ID: <86ptz89ghs.fsf@elgar.kettenis.dyndns.org> X-SW-Source: 2002-06/txt/msg00050.txt.bz2 Liam Stewart 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