From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16302 invoked by alias); 27 Feb 2008 02:29:46 -0000 Received: (qmail 16293 invoked by uid 22791); 27 Feb 2008 02:29:46 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 27 Feb 2008 02:29:26 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id DE0BF9811F; Wed, 27 Feb 2008 02:29:23 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id BB60198118; Wed, 27 Feb 2008 02:29:23 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1JUC2s-0003wa-LE; Tue, 26 Feb 2008 21:29:22 -0500 Date: Wed, 27 Feb 2008 03:16:00 -0000 From: Daniel Jacobowitz To: Robert Bu Cc: gdb@sourceware.org Subject: Re: How to set the path of shared library in Linux Message-ID: <20080227022922.GA10538@caradoc.them.org> Mail-Followup-To: Robert Bu , gdb@sourceware.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-12-11) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-02/txt/msg00226.txt.bz2 On Wed, Feb 27, 2008 at 10:22:13AM +0800, Robert Bu wrote: > Hello, > > How can I set the search path of the shared libraries in Linux for GDB? > I tried "set solib-search-path path_to_my_shared_lib", but GDB still > tries the $LD_LIBRARY_PATH first. I have two versions of the same shared > library, one is in $LD_LIBRARY_PATH, the other is in > path_to_my_shared_libray ( not in $LD_LIBRARY_PATH). GDB just always > uses the one in $LD_LIBRARY_PATH. I'm assuming you are doing local, native debugging (that is, "run"). GDB should load symbols for whichever one your program is actually using. A common problem is that GDB uses a shell to start your program; check that it isn't changing the search paths. If GDB is not loading the same one the program is using, please show us a complete transcript of the debug session. -- Daniel Jacobowitz CodeSourcery