This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: How to set the path of shared library in Linux
- From: Daniel Jacobowitz <drow at false dot org>
- To: Robert Bu <robert dot bu at gmail dot com>
- Cc: gdb at sourceware dot org
- Date: Tue, 26 Feb 2008 21:29:22 -0500
- Subject: Re: How to set the path of shared library in Linux
- References: <a0319f700802261822p5b04e6f6w548ee64dc9c537e9@mail.gmail.com>
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