From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31456 invoked by alias); 9 Jan 2005 22:37:39 -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 31441 invoked from network); 9 Jan 2005 22:37:34 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sourceware.org with SMTP; 9 Jan 2005 22:37:34 -0000 Received: from drow by nevyn.them.org with local (Exim 4.34 #1 (Debian)) id 1Cnlgj-0000zK-Gx; Sun, 09 Jan 2005 17:37:33 -0500 Date: Sun, 09 Jan 2005 22:37:00 -0000 From: Daniel Jacobowitz To: Mark Kettenis Cc: gdb-patches@sources.redhat.com, kevinb@redhat.com, eliz@gnu.org Subject: Re: [RFA] Introduce solib_loaded observer Message-ID: <20050109223732.GA3587@nevyn.them.org> Mail-Followup-To: Mark Kettenis , gdb-patches@sources.redhat.com, kevinb@redhat.com, eliz@gnu.org References: <200501082314.j08NE6a1080151@elgar.sibelius.xs4all.nl> <20050109000104.GA1853@nevyn.them.org> <200501091305.j09D5FfO000568@elgar.sibelius.xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200501091305.j09D5FfO000568@elgar.sibelius.xs4all.nl> User-Agent: Mutt/1.5.5.1+cvs20040105i X-SW-Source: 2005-01/txt/msg00055.txt.bz2 On Sun, Jan 09, 2005 at 02:05:15PM +0100, Mark Kettenis wrote: > > The patch below doesn't only implement the new observer. The reason > > for that is that when the solib_loaded observer is called, the symbols > > for the new library haven't been loaded yet. So I've split out the > > code to read in those symbols out from solib_add() into a seperate > > function, and made that public. > > Could you explain why this is necessary, instead of calling the > observer after loading symbols? I don't see notification at that point > as particularly useful. Certainly the first thing the GNU/Linux code > would want to do would be to load the symbols. > > 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). 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? -- Daniel Jacobowitz