From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5644 invoked by alias); 29 Nov 2007 18:45:30 -0000 Received: (qmail 5634 invoked by uid 22791); 29 Nov 2007 18:45:29 -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:45:23 +0000 Received: (qmail 1823 invoked from network); 29 Nov 2007 18:45:21 -0000 Received: from unknown (HELO 172.16.unknown.plus.ru) (vladimir@127.0.0.2) by mail.codesourcery.com with ESMTPA; 29 Nov 2007 18:45:21 -0000 From: Vladimir Prus To: Jim Blandy Subject: Re: [RFA] Don't reset watchpoint block on solib load. Date: Thu, 29 Nov 2007 18:45:00 -0000 User-Agent: KMail/1.9.6 References: <200711202013.47537.vladimir@codesourcery.com> <200711290955.46751.vladimir@codesourcery.com> In-Reply-To: Cc: gdb-patches@sources.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200711292145.17396.vladimir@codesourcery.com> 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/msg00549.txt.bz2 On Thursday 29 November 2007 21:39:22 you wrote: > > 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. Excellent, at least I did not miss anything. > 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... The precedent now is varobj_invalidate, called from clear_symbtab_users. The other precedent is preserve_values, called from free_objfile. I actually have a patch in works, that would make free_objfile call a function in breakpoints.c that will handle breakpoint referring to the unloaded solib. But I'd rather not mix this thing into an already big and scary patch ;-) - Volodya