From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5393 invoked by alias); 19 Feb 2003 21:11:57 -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 5380 invoked from network); 19 Feb 2003 21:11:57 -0000 Received: from unknown (HELO mx1.redhat.com) (172.16.49.200) by 172.16.49.205 with SMTP; 19 Feb 2003 21:11:57 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h1JLBvK03538 for ; Wed, 19 Feb 2003 16:11:57 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h1JLBva02575; Wed, 19 Feb 2003 16:11:57 -0500 Received: from localhost.localdomain (vpn50-1.rdu.redhat.com [172.16.50.1]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h1JLBuO13052; Wed, 19 Feb 2003 16:11:56 -0500 Received: (from kev@localhost) by localhost.localdomain (8.11.6/8.11.6) id h1JLBp032508; Wed, 19 Feb 2003 14:11:51 -0700 Date: Wed, 19 Feb 2003 21:11:00 -0000 From: Kevin Buettner Message-Id: <1030219211150.ZM32507@localhost.localdomain> In-Reply-To: "Kris Warkentin" "Re: solib-search-path not honoured after program start" (Feb 19, 2:58pm) References: <0a0b01c2d849$b1bcfc40$0202040a@catdog> <1030219194420.ZM9267@localhost.localdomain> <0a6101c2d851$4fb04d60$0202040a@catdog> To: "Kris Warkentin" , Subject: Re: solib-search-path not honoured after program start MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-02/txt/msg00375.txt.bz2 On Feb 19, 2:58pm, Kris Warkentin wrote: > > 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? [patch elided] Your patch corresponds to my "at first glance" comment above. While it might provide some short term relief for the problem that you're seeing, it doesn't address the problem of libraries needing to be reloaded when the search path or absolute prefix is changed. Would you mind trying the following patch instead? * solib.c (reload_shared_libraries): New function. (_initialize_solib): Add command callbacks for ``set solib-search-path'' and ``set solib-absolute-prefix''. Index: solib.c =================================================================== RCS file: /cvs/src/src/gdb/solib.c,v retrieving revision 1.53 diff -u -p -r1.53 solib.c --- solib.c 18 Jan 2003 15:55:52 -0000 1.53 +++ solib.c 19 Feb 2003 21:08:42 -0000 @@ -844,6 +844,13 @@ no_shared_libraries (char *ignored, int do_clear_solib (NULL); } +static void +reload_shared_libraries (char *ignored, int from_tty) +{ + no_shared_libraries (NULL, from_tty); + solib_add (NULL, from_tty, NULL, auto_solib_add); +} + void _initialize_solib (void) { @@ -873,6 +880,7 @@ inferior. Otherwise, symbols must be lo For other (relative) files, you can add values using `set solib-search-path'.", &setlist); add_show_from_set (c, &showlist); + set_cmd_cfunc (c, reload_shared_libraries); set_cmd_completer (c, filename_completer); /* Set the default value of "solib-absolute-prefix" from the sysroot, if @@ -885,5 +893,6 @@ For other (relative) files, you can add This takes precedence over the environment variables PATH and LD_LIBRARY_PATH.", &setlist); add_show_from_set (c, &showlist); + set_cmd_cfunc (c, reload_shared_libraries); set_cmd_completer (c, filename_completer); }