This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA]: Fix for pending breakpoints in manually loaded/unloadedshlibs


Eli Zaretskii wrote:

Date: Tue, 10 Aug 2004 15:09:37 -0400
From: Jeff Johnston <jjohnstn@redhat.com>

To fix this, I have added an observer for a new event: solib_unloaded. When update_solib_list discovers a shared library has been unloaded, it notifies all observers (initially this is just breakpoint.c). Breakpoint.c sets up an observer to find all breakpoints in the removed shlib and mark them as non-inserted and bp_shlib_disabled. This solves the problem.



Could you please explain why this complicated mechanism is needed to fix this problem? Why cannot GDB directly mark the breakpoints when the library is unloaded, instead of going the observer path?


Kind of damned if I do, damned if I don't :) I had talked over the problem with Andrew and he suggested the observer path as this is an event that other parts of gdb would be interested in knowing about. IMHO, the mechanism is rather elegant, extensible, and simple to use.

Right. In addition to the breakpoints, the MI needs to know about these identical events (so that it can notify the gui of an shlib unload).


Andrew



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]