Re: Why does solib_open do what it does?

Kris Warkentin
2003-06-18T19:09:09Z

> Kris Warkentin wrote:
> > I believe the comment does not accurately reflect the code. Here is my
> > proposal for the new comment using the search algorithm rather than
search
> > order:
> >
> > Search algorithm:
> > * If there is a solib_absolute_prefix and path is absolute:
> > * Search for solib_absolute_prefix/path.
> > * else
> > * Look for it literally (unmodified).
> > * Look in SOLIB_SEARCH_PATH.
>
> I'm not sure -- but do you think it should be
> /SOLIB_ABSOLUTE_PREFIX/SOLIB_SEARCH_PATH?
> Or maybe both?

The problem is that you don't have the freedom to define an arbitrary path
if you always prepend solib-abs-pref to it. You can always put the full path
in your solib-search-path if you need to.

> > * If available, use target defined search function.
> > * Look in inferior's $PATH.
> > * Look in inferior's $LD_LIBRARY_PATH.
>
> I rather think that $PATH and $LD_LIBRARY_PATH should be native-only.
> But come to think of it, do remote targets even have environment
variables?
> And if so -- do they inherit them from gdb / the host? If there's a
> gdbserver-type situation, and if the server is able to provide the true
> environment variables from the target, then yes, we should use these.
> But I don't recall any gdbserver ever offering that functionality.

Our pdebug remote protocol allows us to 'set qnxinheritenv true/false'.
This determines whether gdb will send it's environment to the target or
whether the target will inherit from the pdebug server.

> > The code seems to make the meaning of solib_ABSOLUTE_prefix somewhat
more
> > literal.
>
> I think it's supposed to be literal.

True. Just never thought of it that way.

cheers,

Kris