public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* gdb and LD_LIBRARY_PATH
@ 2003-07-10  6:57 Sriram B
  2003-07-10 12:29 ` Kris Warkentin
  0 siblings, 1 reply; 2+ messages in thread
From: Sriram B @ 2003-07-10  6:57 UTC (permalink / raw)
  To: gdb; +Cc: sriramkumar

Hi,

I apologize in advance if this question does not
belong here or has been answered before.

I am having trouble getting gdb to pick up libraries 
from locations specified in LD_LIBRARY_PATH (LLP). The

environment is: bash 2.05a, gdb 5.2.1, Linux PowerPC 
2.4.18, gcc 3.2.1.

In this case, the same library is available on the
system in two different locations - the one in /lib is
stripped, the one in /tmp/jeff is unstripped. I would
like to examine a core file using the unstripped
library in /tmp/jeff. I changed .profile, and then
/etc/profile to prefix /tmp/jeff to LD_LIBRARY_PATH
but to no avail. ld.so and ldd  point to the library
in /tmp/jeff; when gdb itself is exec'd, it looks for
libraries in /tmp/jeff before /lib (as shown by
strace). But when gdb loads the executable and core
file, it always picks up the library from /lib. I ran
ldconfig to put /tmp/jeff ahead of /lib, still no
effect. Logging in and out doesn't do it either.

I used to be able to change LLP in .profile and point
to the new locations, but I can't anymore. What am I
doing wrong? 

bash/gdb/Linux info pasted below.

bermuda:/tmp/jeff-3> gdb -v
GNU gdb 5.2.1
Copyright 2002 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 "powerpc-hardhat-linux".
bermuda:/tmp/jeff-4> uname -a
Linux S0C17 2.4.18 #1 SMP Thu Jun 26 22:33:47 CDT 2003
ppc unknown
bermuda:/tmp/jeff-5> bash -version
GNU bash, version 2.05a.0(1)-release
(powerpc-hardhat-linux-gnu)
Copyright 2001 Free Software Foundation, Inc.

Any pointers are greatly appreciated.

Thanks,
Sriram


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: gdb and LD_LIBRARY_PATH
  2003-07-10  6:57 gdb and LD_LIBRARY_PATH Sriram B
@ 2003-07-10 12:29 ` Kris Warkentin
  0 siblings, 0 replies; 2+ messages in thread
From: Kris Warkentin @ 2003-07-10 12:29 UTC (permalink / raw)
  To: Sriram B, gdb; +Cc: sriramkumar

Look at the gdb commands 'set solib-search-path' and 'set
solib-absolute-prefix' and consider putting them into your .gdbinit.  Wisdom
and enlightenment should arrive.  Hilarity should ensue.  More news at
eleven.

cheers,

Kris

ps. GDB's mechanism for using LD_LIBRARY_PATH is not entirely intuitive but
it's most likely just that it always finds your library first based on
information provided by ldd.  Don't rely on LD_LIBRARY_PATH for gdb.

> I apologize in advance if this question does not
> belong here or has been answered before.
>
> I am having trouble getting gdb to pick up libraries
> from locations specified in LD_LIBRARY_PATH (LLP). The
>
> environment is: bash 2.05a, gdb 5.2.1, Linux PowerPC
> 2.4.18, gcc 3.2.1.
>
> In this case, the same library is available on the
> system in two different locations - the one in /lib is
> stripped, the one in /tmp/jeff is unstripped. I would
> like to examine a core file using the unstripped
> library in /tmp/jeff. I changed .profile, and then
> /etc/profile to prefix /tmp/jeff to LD_LIBRARY_PATH
> but to no avail. ld.so and ldd  point to the library
> in /tmp/jeff; when gdb itself is exec'd, it looks for
> libraries in /tmp/jeff before /lib (as shown by
> strace). But when gdb loads the executable and core
> file, it always picks up the library from /lib. I ran
> ldconfig to put /tmp/jeff ahead of /lib, still no
> effect. Logging in and out doesn't do it either.
>
> I used to be able to change LLP in .profile and point
> to the new locations, but I can't anymore. What am I
> doing wrong?
>
> bash/gdb/Linux info pasted below.
>
> bermuda:/tmp/jeff-3> gdb -v
> GNU gdb 5.2.1
> Copyright 2002 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 "powerpc-hardhat-linux".
> bermuda:/tmp/jeff-4> uname -a
> Linux S0C17 2.4.18 #1 SMP Thu Jun 26 22:33:47 CDT 2003
> ppc unknown
> bermuda:/tmp/jeff-5> bash -version
> GNU bash, version 2.05a.0(1)-release
> (powerpc-hardhat-linux-gnu)
> Copyright 2001 Free Software Foundation, Inc.
>
> Any pointers are greatly appreciated.
>
> Thanks,
> Sriram
>
>
> __________________________________
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com
>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-07-10 12:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-10  6:57 gdb and LD_LIBRARY_PATH Sriram B
2003-07-10 12:29 ` Kris Warkentin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).