This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] Introduce solib_loaded observer
Date: Sun, 9 Jan 2005 17:37:33 -0500
From: Daniel Jacobowitz <drow@false.org>
On Sun, Jan 09, 2005 at 02:05:15PM +0100, Mark Kettenis wrote:
>
> Calling the observer after loading the symbols isn't possible. You
> can set "auto-solib-add" to 0, and then the symbols will never be
> loaded at all. So you'll always have to force loading the symbols
> from within your observer anyway (but you only have to do so for the
> threads library). From a code perspective the point where the
> notification is called is the most logical. And that way it's less
> likely that we see "auto-solib-add" related bugs ;-).
At the same time, I worry that it's going to be confusingly
inconsistent - for instance, I would have expected turning off
auto-solib-add to prevent loading symbols for libpthread! Or at least,
loading of full symbols (all libthread_db on GNU/Linux really needs are
a couple of minsyms).
We should try to be as consistent as possible. The current situation
is very inconsistent too: if you turn off auto-solib-add, you won't
get thread debugging support. It's true that for debugging support
you usually only need a few minimal symbols. I considered rolling my
own BFD-based lookup function, but I suspect that would result in a
serious performance hit because I'd lose the benefit of caching.
I don't think "isn't possible" is accurate; there are only two callers
of update_solib_list, and one of them wants to read the symbols. That
could be pushed down into an argument to update_solib_list. Would that
be better?
Because of the auto-solib-add issue I don't think it is, but given the
right arguments I think you can make me think differently. What to
the others think of this?
Mark