This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Don't reset watchpoint block on solib load.
On Thursday 29 November 2007 21:39:22 you wrote:
>
> Vladimir Prus <vladimir at codesourcery.com> 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