From c8c18e652edd5c207340dea5bc8fd33d34af65df Mon Sep 17 00:00:00 2001 From: Kris Warkentin Date: Fri, 20 Jun 2003 12:23:18 +0000 Subject: [PATCH] 2003-06-19 Kris Warkentin * solib.c (solib_open): Change tests for whether to search LD_LIBRARY_PATH and PATH to better deal with remotes. Update comments. --- gdb/ChangeLog | 6 ++++++ gdb/solib.c | 22 ++++++++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index db617059c7..cd076e82cf 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2003-06-19 Kris Warkentin + + * solib.c (solib_open): Change tests for whether to search + LD_LIBRARY_PATH and PATH to better deal with remotes. Update + comments. + 2003-06-19 Theodore A. Roth * avr-tdep.c (avr_frame_address): Delete function. diff --git a/gdb/solib.c b/gdb/solib.c index 6428a7cfe8..82df65a6d0 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -87,13 +87,19 @@ static char *solib_search_path = NULL; (or set of directories, as in LD_LIBRARY_PATH) to search for all shared libraries if not found in SOLIB_ABSOLUTE_PREFIX. - Search order: - * If path is absolute, look in SOLIB_ABSOLUTE_PREFIX. - * If path is absolute or relative, look for it literally (unmodified). + 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. * If available, use target defined search function. - * Look in inferior's $PATH. - * Look in inferior's $LD_LIBRARY_PATH. + * If solib_absolute_prefix is NOT set, perform the following two searches: + * Look in inferior's $PATH. + * Look in inferior's $LD_LIBRARY_PATH. + * + * The last check avoids doing this search when targetting remote + * machines since solib_absolute_prefix will almost always be set. RETURNS @@ -148,7 +154,7 @@ solib_open (char *in_pathname, char **found_pathname) in_pathname++; } - /* If not found, next search the solib_search_path (if any). */ + /* If not found, search the solib_search_path (if any). */ if (found_file < 0 && solib_search_path != NULL) found_file = openp (solib_search_path, 1, in_pathname, O_RDONLY, 0, &temp_pathname); @@ -167,13 +173,13 @@ solib_open (char *in_pathname, char **found_pathname) (in_pathname, O_RDONLY, &temp_pathname); /* If not found, next search the inferior's $PATH environment variable. */ - if (found_file < 0 && solib_search_path != NULL) + if (found_file < 0 && solib_absolute_prefix == NULL) found_file = openp (get_in_environ (inferior_environ, "PATH"), 1, in_pathname, O_RDONLY, 0, &temp_pathname); /* If not found, next search the inferior's $LD_LIBRARY_PATH environment variable. */ - if (found_file < 0 && solib_search_path != NULL) + if (found_file < 0 && solib_absolute_prefix == NULL) found_file = openp (get_in_environ (inferior_environ, "LD_LIBRARY_PATH"), 1, in_pathname, O_RDONLY, 0, &temp_pathname); -- 2.34.1