From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30049 invoked by alias); 16 Dec 2010 13:23:05 -0000 Received: (qmail 30039 invoked by uid 22791); 16 Dec 2010 13:23:04 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY X-Spam-Check-By: sourceware.org Received: from rcsinet10.oracle.com (HELO rcsinet10.oracle.com) (148.87.113.121) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 16 Dec 2010 13:22:59 +0000 Received: from rcsinet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id oBGDMs7v006062 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 16 Dec 2010 13:22:55 GMT Received: from acsmt354.oracle.com (acsmt354.oracle.com [141.146.40.154]) by rcsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id oBGDMqNh009391; Thu, 16 Dec 2010 13:22:53 GMT Received: from abhmt018.oracle.com by acsmt354.oracle.com with ESMTP id 880607471292505755; Thu, 16 Dec 2010 05:22:35 -0800 Received: from yoshi-no-macbook-pro.local (/211.126.201.105) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 16 Dec 2010 05:22:34 -0800 Message-ID: <4D0A128D.40201@oracle.com> Date: Thu, 16 Dec 2010 13:23:00 -0000 From: Yoshinori Toshima User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; ja-JP-mac; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6 MIME-Version: 1.0 To: Pierre Muller CC: gdb-patches@sourceware.org Subject: Re: Please add code to pick up SOLIB_SEARCH_PATH env var. References: <4D09DB33.902@oracle.com> <20101216112614.fa2rmsu5eso0o0ok@webmail.u-strasbg.fr> In-Reply-To: <20101216112614.fa2rmsu5eso0o0ok@webmail.u-strasbg.fr> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-12/txt/msg00335.txt.bz2 Hello Pierre, Thank you for your comment. Currently, single path element works. It is rare to have same libraries with same name in different directories. To support multiple path elements, we need to check solib_search_path variable use in solib.c again. If it can have comma separated path elements, then we can check each environment variable and join valid elements with colon and set it to solib_search_path. > Did you try 'gdb -ex "set solib-search-patch ..."' ? No I haven't. I'll check it. Regards, Yoshinori (10/12/16 19:26), Pierre Muller wrote: > I was wondering if your patch > would work if the environment variable had > several entries, like; > SOLIB_SEARCH_PATH=/myprefix/lib:/myprefix/lib64 > > Does access return 0 if you > give it the whole evironment variable, or should > you test the coponents one by one? > > Pierre Muller > >> Yoshinori Toshima a écrit : >> >> Hello, >> >> I have a small enhancement request for GDB to make it easier to >> use when debugging core file from other systems which have >> different libraries. >> >> Description: >> When debugging a core file from released product, it is convenient >> to have gdb use shared libraries in a directory which contains the >> libraries and executable taken from the system which caused the >> crash. It is possible to perform this by gdb command "set >> solib-search-path ". This means some commands are required >> after starting gdb. If we can set solib-search-path at gdb startup, >> it is easier to use. This is useful when we use GDB programmatically. >> >> HP-UX port of GDB has this feature via env var GDB_SHLIB_PATH. >> GDB does not have the feature yet, though it mentions SOLIB_SEARCH_PATH >> in solib.c. >> >> I changed solib.c to pick up SOLIB_SEARCH_PATH at startup and set >> it to solib_search_path in solib.c initialization. It worked as >> expected. >> >> Attached solib-patch.diff is based on solib.c in gdb 7.2. >> >> ChangeLog entry: >> 2010-12-16 Yoshinori Toshima >> >> * solib.c: Pick up SOLIB_SEARCH_PATH env var to set solib-search-path at >> startup. >> >> Regards, >> Yoshinori Toshima >> > > > >