This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: catch load/unload not implemented on any target (remove?)
> I think it should be even higher level than that. The core solib
> machinery knows how to stop on load/unload (set stop-on-solib-events).
> And it knows how to update the list of loaded libraries based on
> current_sos. All that's missing is a 'diff' operation: report which
> libraries have been added or removed, so that the common code can
> report them sensibly to the user. I'd love if I could replace "set
> stop-on-solib-events 1" with "catch load" and have GDB say "Stopped at
> load of libfoo.so.1" or "Stopped at load of 6 libraries". The latter
> is not as important, since (on svr4 targets) it happens only during
> program startup, when the dynamic loader initializes.
>
> IOW I don't think we need any new breakpoint that we don't already
> have.
I thought about that too. This would work very well with targets
that receive an event (either a breakpoint or a specific notification
like on Windows) immediately when a shared library is loaded or unloaded.
But I wonder if we might have some targets where this is not the case.
It it were the case, the notications would arrive late for these targets.
I looked at all the solib-* files, and the only target where that might
be the case is Tru64 - init_inferior_hook isn't turning on any event or
inserting any shlib breakpoint, and procfs doesn't seem to provide
handling for shlib notifications. Perhaps what we could do is error-out
if the user tries to insert a catchpoint on load/unload events, then.
In any case, looks like there a general agreement to remove the current
code... I will do that after I have submitted the changes I made to
get rid of bp_catch_exec.
--
Joel