From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6353 invoked by alias); 11 Jan 2005 21:57:49 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 6331 invoked from network); 11 Jan 2005 21:57:42 -0000 Received: from unknown (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org with SMTP; 11 Jan 2005 21:57:42 -0000 Received: from elgar.sibelius.xs4all.nl (elgar.sibelius.xs4all.nl [192.168.0.2]) by sibelius.xs4all.nl (8.13.0/8.13.0) with ESMTP id j0BLvHG5013806; Tue, 11 Jan 2005 22:57:17 +0100 (CET) Received: from elgar.sibelius.xs4all.nl (localhost [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.12.6p3/8.12.6) with ESMTP id j0BLvH8Z000933; Tue, 11 Jan 2005 22:57:17 +0100 (CET) (envelope-from kettenis@elgar.sibelius.xs4all.nl) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.12.6p3/8.12.6/Submit) id j0BLvDp9000926; Tue, 11 Jan 2005 22:57:13 +0100 (CET) Date: Tue, 11 Jan 2005 21:57:00 -0000 Message-Id: <200501112157.j0BLvDp9000926@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: drow@false.org CC: gdb-patches@sources.redhat.com In-reply-to: <20050109230629.GA4612@nevyn.them.org> (message from Daniel Jacobowitz on Sun, 9 Jan 2005 18:06:29 -0500) Subject: Re: [RFA] Introduce solib_loaded observer References: <200501082314.j08NE6a1080151@elgar.sibelius.xs4all.nl> <20050109000104.GA1853@nevyn.them.org> <200501091305.j09D5FfO000568@elgar.sibelius.xs4all.nl> <20050109223732.GA3587@nevyn.them.org> <200501092258.j09MwImN012219@elgar.sibelius.xs4all.nl> <20050109230629.GA4612@nevyn.them.org> X-SW-Source: 2005-01/txt/msg00074.txt.bz2 Date: Sun, 9 Jan 2005 18:06:29 -0500 From: Daniel Jacobowitz On Sun, Jan 09, 2005 at 11:58:18PM +0100, Mark Kettenis wrote: > Date: Sun, 9 Jan 2005 17:37:33 -0500 > From: Daniel Jacobowitz > > 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 Note that there's no other way to deliberately turn off thread debugging at present. Then we should add a command to do that. > 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 doubt it would be that serious. It'd be a bit tricky, of course, so adding extra code for it seems like a shame. Perhaps we could read in just the minsyms... ...perhaps another threads implementation needs full symbols. The bottom line is that the code probably needs to fiddle with symbols, whether or not we call the observer before or after GDB would normally load the symbols for a shared library. > 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? I wonder if we can envision any other potential consumers for this hook? What would they want to do? The observer could be used to re-set breakpoints in shared libraries, to implement bp_catch/bp_unload in a somewhat more generic fashion. Some of these might need symbols some of them don't. I'm still in favour of calling the observer *before*. That way, people using the observer are forced to ask the question whether they want symbols to be loaded or not. Mark