From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2675 invoked by alias); 13 Nov 2002 22:44:12 -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 2666 invoked from network); 13 Nov 2002 22:44:11 -0000 Received: from unknown (HELO hub.ott.qnx.com) (209.226.137.76) by sources.redhat.com with SMTP; 13 Nov 2002 22:44:11 -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 RAA07106 for ; Wed, 13 Nov 2002 17:40:47 -0500 Received: from node128.ott.qnx.com (node128 [10.0.0.128]) by smtp.ott.qnx.com (8.8.8/8.6.12) with ESMTP id RAA12710 for ; Wed, 13 Nov 2002 17:34:13 -0500 Date: Wed, 13 Nov 2002 14:44:00 -0000 From: Graeme Peterson X-Sender: gp@node128.ott.qnx.com To: gdb@sources.redhat.com Subject: Re: set env affects host? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2002-11/txt/msg00155.txt.bz2 Well, I think I have answered my own question by checking in the source. I found a comment in solib.c for solib_open that says that solib symbols are found in the inferior's LD_LIBRARY_PATH, and never in the host's. So I guess that is that. :-) Search order: * If path is absolute, look in SOLIB_ABSOLUTE_PREFIX. * If path is absolute or relative, look for it literally (unmodified). * Look in SOLIB_SEARCH_PATH. * Look in inferior's $PATH. * Look in inferior's $LD_LIBRARY_PATH. Anyone care to comment on the rationale behind the behavior? Clearly it seemed reasonable to me to find the solibs for symbols in the host's LD_LIBRARY_PATH, but that is wrong. Thanks. GP On Wed, 13 Nov 2002, Graeme Peterson wrote: > > Hi, all. > > In gdb, according to the help, typing "set env LD_LIBRARY_PATH=" > should set the env var LD_LIBRARY_PATH for the inferior. > > In gdb-5.2.1 (on QNX6), it seems that it also affects the host, in that > symbol information for shared objects is now searched for in that new > LD_LIBRARY_PATH. > > So, on my host I have the libs in "//lib/test/". On my target > they live in "/lib/test". > > In order for GDB to both load the symbols and allow the inferior to run, I > have to have both "/lib/test" and "//lib/test" in the set env > LD_LIBRARY_PATH command. > > I do not have the ability to check this with "target remote" on a non-QNX > setup. > > Can anyone verify if this is expected behavior? It seems to me that the > new LD_LIBRARY_PATH should be passed to the inferior only, and that GDB's > environment (if solib-search-path is not set) should be used for loading > shared object symbols. > > Thanks in advance. > GP > >