This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: set env affects host?
>>>>> "Graeme" == Graeme Peterson <gp@qnx.com> writes:
Graeme> Well, I think I have answered my own question by checking in
Graeme> the source. I found a comment in solib.c for solib_open that
Graeme> says that solib symbols are found in the inferior's
Graeme> LD_LIBRARY_PATH, and never in the host's. So I guess that is
Graeme> that. :-)
Graeme> Search order: * If path is absolute, look in
Graeme> SOLIB_ABSOLUTE_PREFIX. * If path is absolute or relative,
Graeme> look for it literally (unmodified). * Look in
Graeme> SOLIB_SEARCH_PATH. * Look in inferior's $PATH. * Look in
Graeme> inferior's $LD_LIBRARY_PATH.
Graeme> Anyone care to comment on the rationale behind the behavior?
Graeme> Clearly it seemed reasonable to me to find the solibs for
Graeme> symbols in the host's LD_LIBRARY_PATH, but that is wrong.
Looking in the host LD_LIBRARY_PATH, or for that matter using absolute
names literally, is likely to be wrong for cross-debugging.
Fortunately the literal lookup is not the first thing tried, but as
far as I'm concerned it might as well go away entirely if host !=
target.
paul