From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13037 invoked by alias); 19 Feb 2003 19:58:52 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 13022 invoked from network); 19 Feb 2003 19:58:51 -0000 Received: from unknown (HELO hub.ott.qnx.com) (209.226.137.76) by 172.16.49.205 with SMTP; 19 Feb 2003 19:58:51 -0000 Received: from smtp.ott.qnx.com (smtp.ott.qnx.com [10.0.2.158]) by hub.ott.qnx.com (8.9.3/8.9.3) with ESMTP id OAA25117; Wed, 19 Feb 2003 14:47:11 -0500 Received: from catdog ([10.4.2.2]) by smtp.ott.qnx.com (8.8.8/8.6.12) with SMTP id OAA06288; Wed, 19 Feb 2003 14:58:50 -0500 Message-ID: <0a6101c2d851$4fb04d60$0202040a@catdog> From: "Kris Warkentin" To: "Kevin Buettner" , References: <0a0b01c2d849$b1bcfc40$0202040a@catdog> <1030219194420.ZM9267@localhost.localdomain> Subject: Re: solib-search-path not honoured after program start Date: Wed, 19 Feb 2003 19:58:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-SW-Source: 2003-02/txt/msg00373.txt.bz2 > I think this so. > > At first glance, the problem seems to be that update_solib_list() only > considers mapping newly found shared libraries and not ones that were > previously known, but which could not be found. > > It might not be too hard to change things so that it attempts to map > previously unmappable libraries, but I wonder what should happen to > already mapped and/or loaded shared libraries when solib-search-path > is changed. If changing the search path (or the absolute prefix) > would cause different libraries to be found (than were found > previously), should the old ones be unmapped/discarded? (I suspect > the answer is yes.) > > If so, maybe the right way to fix this problem is to have the > "set solib-search-path" and "set solib-absolute-prefix" commands > simply unload all known shared libraries and then invoke solib_add(). What do you think of this? $ cvs diff -c solib.c Index: solib.c =================================================================== RCS file: /cvs/src/src/gdb/solib.c,v retrieving revision 1.53 diff -c -r1.53 solib.c *** solib.c 18 Jan 2003 15:55:52 -0000 1.53 --- solib.c 19 Feb 2003 19:57:38 -0000 *************** *** 431,436 **** --- 431,445 ---- struct so_list *i = inferior; struct so_list **i_link = &inferior; + /* if this lib hasn't been read, remove it from gdb's list so + that we can try again */ + if (!gdb->abfd && !gdb->objfile){ + *gdb_link = gdb->next; + free_so (gdb); + gdb = *gdb_link; + continue; + } + /* Check to see whether the shared object *gdb also appears in the inferior's current list. */ while (i)