This is the mail archive of the gdb@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Problem with LD_LIBRARY_PATH and gdb 4.18


Matt,

This is very odd.  I am presently debugging a problem in gdb (on a Red
Hat 6.0 machine) which is shared library related and am having no
trouble with LD_LIBRARY_PATH.  I am using gdb-4.18.1 (the head of the
Cygnus development tree), but have also tried it with gdb-4.17.0.11
which ships with Red Hat 6.0 after reading your report below.

What does ldd show you?  Does naming the library somewhat differently
make any difference?  (I.e, what happens if you name it libgcj.so or
create a symlink to libgcj.so.0?)

Another thing you might try is the command

	show env LD_LIBRARY_PATH

from within gdb to make sure that gdb knows about this environment
variable.

Regards,

Kevin

On Sep 1,  8:52pm, Matt Welsh wrote:
> Subject: Problem with LD_LIBRARY_PATH and gdb 4.18
> 
> I'm using gdb 4.18 (although 4.16 exhibits the same problem) on a Linux x86
> machine with glibc 2.1.1 (Red Hat 6.0). gdb fails to run any binaries which
> require shared libraries not on the usual search path for ld.so, i.e. any
> libraries located by LD_LIBRARY_PATH.
> 
> Setting LD_LIBRARY_PATH or gdb 'set solib-search-path' has no effect. Here
> is what I see:
> 
> > enclave1:~/src/ninja/test/mdw% echo $LD_LIBRARY_PATH
> > /home/cs/mdw/lib:/usr/local/ninja/gcc-2.95.1/lib
> > enclave1:~/src/ninja/test/mdw% gdb TestT
> > GNU gdb 4.18
> > Copyright 1998 Free Software Foundation, Inc.
> > GDB is free software, covered by the GNU General Public License, and you are
> > welcome to change it and/or distribute copies of it under certain conditions.
> > Type "show copying" to see the conditions.
> > There is absolutely no warranty for GDB.  Type "show warranty" for details.
> > This GDB was configured as "i386-redhat-linux"...
> > (gdb) run   
> > Starting program: /disks/now/grad/mdw/src/ninja/test/mdw/TestT 
> > /disks/now/grad/mdw/src/ninja/test/mdw/TestT: error in loading shared libraries: libgcj.so.0: cannot open shared object file: No such file or directory
> >
> > Program exited with code 0177.
> 
> In this case, libgcj.so.0 is found in the LD_LIBRARY_PATH. I can run the
> program just fine directly from the shell, but not from within gdb.
> 
> I can 'attach' to the running process from gdb, however, in some cases I 
> wish to test the code as it's starting, so this is not good enough.
> 
> If I set LD_LIBRARY_PATH and run 'strace TestT' from within gdb, it's
> obvious that ld.so is not looking for the library in any directories on the
> LD_LIBRARY_PATH. Is it possible that gdb is not passing along the value of
> this environment variable?
> 
> Thanks much,
> Matt Welsh, mdw@cs.berkeley.edu
> 
>-- End of excerpt from Matt Welsh



-- 
Kevin Buettner
kev@primenet.com, kevinb@cygnus.com

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]