Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* environment variables in CLI
@ 2005-05-19 16:23 Bob Rossi
  2005-05-19 16:25 ` Daniel Jacobowitz
  0 siblings, 1 reply; 7+ messages in thread
From: Bob Rossi @ 2005-05-19 16:23 UTC (permalink / raw)
  To: GDB

Hi,

I'm trying to figure out how to set the LD_LIBRARY_PATH in GDB once I
start it up. The command 'set environment 
LD_LIBRARY_PATH=/home/foo/lib' works. However, I want to do something
like 'set environment LD_LIBRARY_PATH=$SOME_PATH/lib:$LD_LIBRARY_PATH'.
Is this possible from the CLI?

Actually, I couldn't figure out how to tell GDB where to look for shared
objects, that's why I ended up using the LD_LIBRARY_PATH.

Thanks,
Bob Rossi


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

* Re: environment variables in CLI
  2005-05-19 16:23 environment variables in CLI Bob Rossi
@ 2005-05-19 16:25 ` Daniel Jacobowitz
  2005-05-19 16:43   ` Bob Rossi
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Jacobowitz @ 2005-05-19 16:25 UTC (permalink / raw)
  To: GDB

On Thu, May 19, 2005 at 12:23:10PM -0400, Bob Rossi wrote:
> Hi,
> 
> I'm trying to figure out how to set the LD_LIBRARY_PATH in GDB once I
> start it up. The command 'set environment 
> LD_LIBRARY_PATH=/home/foo/lib' works. However, I want to do something
> like 'set environment LD_LIBRARY_PATH=$SOME_PATH/lib:$LD_LIBRARY_PATH'.
> Is this possible from the CLI?

Nope.

> Actually, I couldn't figure out how to tell GDB where to look for shared
> objects, that's why I ended up using the LD_LIBRARY_PATH.

set solib-search-path?  set solib-absolute-prefix?  What are you trying
to do?

-- 
Daniel Jacobowitz
CodeSourcery, LLC


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

* Re: environment variables in CLI
  2005-05-19 16:25 ` Daniel Jacobowitz
@ 2005-05-19 16:43   ` Bob Rossi
  2005-05-19 16:50     ` Bob Rossi
  2005-05-19 17:08     ` Daniel Jacobowitz
  0 siblings, 2 replies; 7+ messages in thread
From: Bob Rossi @ 2005-05-19 16:43 UTC (permalink / raw)
  To: GDB

On Thu, May 19, 2005 at 12:25:43PM -0400, Daniel Jacobowitz wrote:
> On Thu, May 19, 2005 at 12:23:10PM -0400, Bob Rossi wrote:
> > Hi,
> > 
> > I'm trying to figure out how to set the LD_LIBRARY_PATH in GDB once I
> > start it up. The command 'set environment 
> > LD_LIBRARY_PATH=/home/foo/lib' works. However, I want to do something
> > like 'set environment LD_LIBRARY_PATH=$SOME_PATH/lib:$LD_LIBRARY_PATH'.
> > Is this possible from the CLI?
> 
> Nope.

OK, I suppose this could be a nice feature. Do you think it would be
terribly complicated?

> > Actually, I couldn't figure out how to tell GDB where to look for shared
> > objects, that's why I ended up using the LD_LIBRARY_PATH.
> 
> set solib-search-path?  set solib-absolute-prefix?  What are you trying
> to do?

Well, I'm probably just messing things up. Here's what I have. The .so's
are in /home/foo/lib. libqt.so is definatly there.

(gdb) set solib-search-path /home/foo/lib
(gdb) b main
r
Breakpoint 1 at 0x80af805: file main.cpp, line 469.
(gdb) r
main-program: error while loading shared libraries: libqt.so: cannot open shared object file: No such file or directory

Program exited with code 0177.
(gdb) set solib-search-path /home/foo/lib
(gdb) r
main-program: error while loading shared libraries: libqt.so: cannot open shared object file: No such file or directory

Program exited with code 0177.
(gdb)

However, If I set the LD_LIBRARY_PATH it works. I'm using GDB 6.1 which
is rather old. I suppose I should upgrade.

Bob Rossi


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

* Re: environment variables in CLI
  2005-05-19 16:43   ` Bob Rossi
@ 2005-05-19 16:50     ` Bob Rossi
  2005-05-19 17:08     ` Daniel Jacobowitz
  1 sibling, 0 replies; 7+ messages in thread
From: Bob Rossi @ 2005-05-19 16:50 UTC (permalink / raw)
  To: GDB

On Thu, May 19, 2005 at 12:43:11PM -0400, Bob Rossi wrote:
> On Thu, May 19, 2005 at 12:25:43PM -0400, Daniel Jacobowitz wrote:
> > On Thu, May 19, 2005 at 12:23:10PM -0400, Bob Rossi wrote:
> > > Hi,
> > > 
> > > I'm trying to figure out how to set the LD_LIBRARY_PATH in GDB once I
> > > start it up. The command 'set environment 
> > > LD_LIBRARY_PATH=/home/foo/lib' works. However, I want to do something
> > > like 'set environment LD_LIBRARY_PATH=$SOME_PATH/lib:$LD_LIBRARY_PATH'.
> > > Is this possible from the CLI?
> > 
> > Nope.
> 
> OK, I suppose this could be a nice feature. Do you think it would be
> terribly complicated?
> 
> > > Actually, I couldn't figure out how to tell GDB where to look for shared
> > > objects, that's why I ended up using the LD_LIBRARY_PATH.
> > 
> > set solib-search-path?  set solib-absolute-prefix?  What are you trying
> > to do?
> 
> Well, I'm probably just messing things up. Here's what I have. The .so's
> are in /home/foo/lib. libqt.so is definatly there.
> 
> (gdb) set solib-search-path /home/foo/lib
> (gdb) b main
> r
> Breakpoint 1 at 0x80af805: file main.cpp, line 469.
> (gdb) r
> main-program: error while loading shared libraries: libqt.so: cannot open shared object file: No such file or directory
> 
> Program exited with code 0177.
> (gdb) set solib-search-path /home/foo/lib
> (gdb) r
> main-program: error while loading shared libraries: libqt.so: cannot open shared object file: No such file or directory
> 
> Program exited with code 0177.
> (gdb)
> 
> However, If I set the LD_LIBRARY_PATH it works. I'm using GDB 6.1 which
> is rather old. I suppose I should upgrade.

I just tried this with gdb 6.3 and get the same problems.

Bob Rossi


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

* Re: environment variables in CLI
  2005-05-19 16:43   ` Bob Rossi
  2005-05-19 16:50     ` Bob Rossi
@ 2005-05-19 17:08     ` Daniel Jacobowitz
  2005-05-19 17:33       ` Bob Rossi
  1 sibling, 1 reply; 7+ messages in thread
From: Daniel Jacobowitz @ 2005-05-19 17:08 UTC (permalink / raw)
  To: GDB

On Thu, May 19, 2005 at 12:43:11PM -0400, Bob Rossi wrote:
> Breakpoint 1 at 0x80af805: file main.cpp, line 469.
> (gdb) r
> main-program: error while loading shared libraries: libqt.so: cannot open shared object file: No such file or directory

That isn't "GDB's search path for shared libraries", it's the system
path; the error does not come from GDB.  You do need to set
LD_LIBRARY_PATH.

-- 
Daniel Jacobowitz
CodeSourcery, LLC


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

* Re: environment variables in CLI
  2005-05-19 17:08     ` Daniel Jacobowitz
@ 2005-05-19 17:33       ` Bob Rossi
  2005-05-19 18:10         ` Daniel Jacobowitz
  0 siblings, 1 reply; 7+ messages in thread
From: Bob Rossi @ 2005-05-19 17:33 UTC (permalink / raw)
  To: GDB

On Thu, May 19, 2005 at 01:08:41PM -0400, Daniel Jacobowitz wrote:
> On Thu, May 19, 2005 at 12:43:11PM -0400, Bob Rossi wrote:
> > Breakpoint 1 at 0x80af805: file main.cpp, line 469.
> > (gdb) r
> > main-program: error while loading shared libraries: libqt.so: cannot open shared object file: No such file or directory
> 
> That isn't "GDB's search path for shared libraries", it's the system
> path; the error does not come from GDB.  You do need to set
> LD_LIBRARY_PATH.

O, OK. I see the problem. The problem is, I have the C and C++ shared
libraries in /home/foo/lib. I don't want to set the LD_LIBRARY_PATH
before I start GDB, or it'll use those libraries.

If I do 'set environment LD_LIBRARY_PATH=...' does that only effect the
inferior, and not GDB? The help says,
   set environment -- Set environment variable value to give the program

Thanks,
Bob Rossi


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

* Re: environment variables in CLI
  2005-05-19 17:33       ` Bob Rossi
@ 2005-05-19 18:10         ` Daniel Jacobowitz
  0 siblings, 0 replies; 7+ messages in thread
From: Daniel Jacobowitz @ 2005-05-19 18:10 UTC (permalink / raw)
  To: GDB

On Thu, May 19, 2005 at 01:24:08PM -0400, Bob Rossi wrote:
> On Thu, May 19, 2005 at 01:08:41PM -0400, Daniel Jacobowitz wrote:
> > On Thu, May 19, 2005 at 12:43:11PM -0400, Bob Rossi wrote:
> > > Breakpoint 1 at 0x80af805: file main.cpp, line 469.
> > > (gdb) r
> > > main-program: error while loading shared libraries: libqt.so: cannot open shared object file: No such file or directory
> > 
> > That isn't "GDB's search path for shared libraries", it's the system
> > path; the error does not come from GDB.  You do need to set
> > LD_LIBRARY_PATH.
> 
> O, OK. I see the problem. The problem is, I have the C and C++ shared
> libraries in /home/foo/lib. I don't want to set the LD_LIBRARY_PATH
> before I start GDB, or it'll use those libraries.
> 
> If I do 'set environment LD_LIBRARY_PATH=...' does that only effect the
> inferior, and not GDB? The help says,

Correct.

-- 
Daniel Jacobowitz
CodeSourcery, LLC


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

end of thread, other threads:[~2005-05-19 18:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-19 16:23 environment variables in CLI Bob Rossi
2005-05-19 16:25 ` Daniel Jacobowitz
2005-05-19 16:43   ` Bob Rossi
2005-05-19 16:50     ` Bob Rossi
2005-05-19 17:08     ` Daniel Jacobowitz
2005-05-19 17:33       ` Bob Rossi
2005-05-19 18:10         ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox