From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20421 invoked by alias); 1 Nov 2005 13:45:50 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 20411 invoked by uid 22791); 1 Nov 2005 13:45:49 -0000 Received: from c-24-61-23-223.hsd1.ma.comcast.net (HELO cgf.cx) (24.61.23.223) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Tue, 01 Nov 2005 13:45:49 +0000 Received: by cgf.cx (Postfix, from userid 201) id 2FD6713C743; Tue, 1 Nov 2005 08:45:47 -0500 (EST) Date: Tue, 01 Nov 2005 13:45:00 -0000 From: Christopher Faylor To: gdb@sourceware.org Subject: Re: How does solib handline shared library unloads? Message-ID: <20051101134547.GA3098@trixie.casa.cgf.cx> Mail-Followup-To: gdb@sourceware.org References: <20051101053934.GA15899@trixie.casa.cgf.cx> <200511010658.jA16wZSo023764@elgar.sibelius.xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200511010658.jA16wZSo023764@elgar.sibelius.xs4all.nl> User-Agent: Mutt/1.5.8i X-SW-Source: 2005-11/txt/msg00006.txt.bz2 On Tue, Nov 01, 2005 at 07:58:35AM +0100, Mark Kettenis wrote: >> Date: Tue, 1 Nov 2005 00:39:34 -0500 >> From: Christopher Faylor >> >> Can anyone enlighten me as to how information about a library is >> relinquished when a library loaded via dlopen is unloaded via dlclose? >> Theoretically, the information about the library should be removed and >> the library should not be listed by "info sharedlibrary". >> >> I don't see any way for this to be handled in solib.c and inf*.c but I'm >> sure I'm just missing something obvious. I haven't written a test case >> yet to see how it is being handled but I was hoping someone could >> clarify this for me. > >It happens as part of solib_add(), which should be called for every >shared library events, not just dlopen()s. See the code in >update_solib_list() for the code that actually removes libraries from >GDB's internal list. Is this handled as part of the so breakpoint stuff? I was trying to avoid implementing that but I will if I have to. >That said, I think I have convinced myself in the past that there is a >big gaping memory leak. I was wondering about that. I thought there might be a big memory leak there since it doesn't look like objfile's are being freed. cgf