From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2708 invoked by alias); 29 Nov 2007 18:40:05 -0000 Received: (qmail 2695 invoked by uid 22791); 29 Nov 2007 18:40:04 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 29 Nov 2007 18:39:58 +0000 Received: (qmail 1609 invoked from network); 29 Nov 2007 18:39:56 -0000 Received: from unknown (HELO localhost) (jimb@127.0.0.2) by mail.codesourcery.com with ESMTPA; 29 Nov 2007 18:39:56 -0000 To: Vladimir Prus Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] Don't reset watchpoint block on solib load. References: <200711202013.47537.vladimir@codesourcery.com> <200711290955.46751.vladimir@codesourcery.com> From: Jim Blandy Date: Thu, 29 Nov 2007 18:40:00 -0000 In-Reply-To: <200711290955.46751.vladimir@codesourcery.com> (Vladimir Prus's message of "Thu, 29 Nov 2007 09:55:46 +0300") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-11/txt/msg00548.txt.bz2 Vladimir Prus writes: > On Wednesday 28 November 2007 02:00:15 Jim Blandy wrote: > >> We also call breakpoint_re_set_one when we've unloaded a shared >> library. > > Can you point me at a codepath that would cause breakpoint_re_set_one > to be called when a shared library is *unloaded*? I've poked at > this for a while, and can't see it. I beg your pardon. It does not. This is a pretty serious bug. A dlclose will call free_objfile: handle_inferior_event -> solib_add -> update_solib_list -> free_objfile but it takes no steps to clear references to the freed shared library's symbols. I had assumed that it must be calling clear_symtab_users. We need to call clear_symtab_users whenever any objfile is freed. Now, where to do this...