Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Graeme Peterson <gp@qnx.com>
To: gdb@sources.redhat.com
Subject: Re: set env affects host?
Date: Wed, 13 Nov 2002 14:44:00 -0000	[thread overview]
Message-ID: <Pine.NTO.4.21.0211131734410.985735193-100000@node128.ott.qnx.com> (raw)
In-Reply-To: <Pine.NTO.4.21.0211131541090.983400488-100000@node128.ott.qnx.com>


Well, I think I have answered my own question by checking in the
source.  I found a comment in solib.c for solib_open that says that solib
symbols are found in the inferior's LD_LIBRARY_PATH, and never in the
host's.  So I guess that is that.  :-)

   Search order:
   * If path is absolute, look in SOLIB_ABSOLUTE_PREFIX.
   * If path is absolute or relative, look for it literally (unmodified).
   * Look in SOLIB_SEARCH_PATH.
   * Look in inferior's $PATH.
   * Look in inferior's $LD_LIBRARY_PATH.

Anyone care to comment on the rationale behind the behavior?  Clearly it
seemed reasonable to me to find the solibs for symbols in the host's
LD_LIBRARY_PATH, but that is wrong.

Thanks.
GP

On Wed, 13 Nov 2002, Graeme Peterson wrote:

> 
> Hi, all.
> 
> In gdb, according to the help, typing "set env LD_LIBRARY_PATH=<some_path>"
> should set the env var LD_LIBRARY_PATH for the inferior.
> 
> In gdb-5.2.1 (on QNX6), it seems that it also affects the host, in that
> symbol information for shared objects is now searched for in that new
> LD_LIBRARY_PATH.
> 
> So, on my host I have the libs in "/<target_cpu>/lib/test/".  On my target
> they live in "/lib/test". 
> 
> In order for GDB to both load the symbols and allow the inferior to run, I
> have to have both "/lib/test" and "/<target_cpu>/lib/test" in the set env
> LD_LIBRARY_PATH command.
> 
> I do not have the ability to check this with "target remote" on a non-QNX
> setup.
> 
> Can anyone verify if this is expected behavior?  It seems to me that the
> new LD_LIBRARY_PATH should be passed to the inferior only, and that GDB's
> environment (if solib-search-path is not set) should be used for loading
> shared object symbols.
> 
> Thanks in advance.
> GP
> 
> 


  reply	other threads:[~2002-11-13 22:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-13 13:02 Graeme Peterson
2002-11-13 14:44 ` Graeme Peterson [this message]
2002-11-13 14:47   ` Paul Koning
2002-11-13 14:57     ` Daniel Jacobowitz
2002-11-13 18:56       ` gp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.NTO.4.21.0211131734410.985735193-100000@node128.ott.qnx.com \
    --to=gp@qnx.com \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox