From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22791 invoked by alias); 20 Jun 2003 12:26:48 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 8358 invoked from network); 20 Jun 2003 12:22:52 -0000 Received: from unknown (HELO hub.ott.qnx.com) (209.226.137.76) by sources.redhat.com with SMTP; 20 Jun 2003 12:22:52 -0000 Received: from smtp.ott.qnx.com (smtp.ott.qnx.com [10.0.2.158]) by hub.ott.qnx.com (8.9.3p2/8.9.3) with ESMTP id IAA08495 for ; Fri, 20 Jun 2003 08:15:56 -0400 Received: from localhost ([10.4.2.2]) by smtp.ott.qnx.com (8.8.8/8.6.12) with ESMTP id IAA10421 for ; Fri, 20 Jun 2003 08:22:51 -0400 Date: Fri, 20 Jun 2003 12:26:00 -0000 From: kewarken X-X-Sender: kewarken@catdog.ott.qnx.com To: gdb-patches@sources.redhat.com Subject: [Patch] modify search order in solib.c:solib_open Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2003-06/txt/msg00649.txt.bz2 Okay. Here's my patch, this time using pine so my indentation won't get buggered. Applied. cheers, Kris 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. Index: solib.c =================================================================== RCS file: /cvs/src/src/gdb/solib.c,v retrieving revision 1.57 diff -c -p -r1.57 solib.c *** solib.c 11 Jun 2003 13:16:29 -0000 1.57 --- solib.c 20 Jun 2003 12:16:50 -0000 *************** static char *solib_search_path = NULL; *** 87,99 **** (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). * Look in SOLIB_SEARCH_PATH. * If available, use target defined search function. ! * Look in inferior's $PATH. ! * Look in inferior's $LD_LIBRARY_PATH. RETURNS --- 87,105 ---- (or set of directories, as in LD_LIBRARY_PATH) to search for all shared libraries if not found in SOLIB_ABSOLUTE_PREFIX. ! 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. ! * 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 *************** solib_open (char *in_pathname, char **fo *** 148,154 **** in_pathname++; } ! /* If not found, next 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); --- 154,160 ---- in_pathname++; } ! /* 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); *************** solib_open (char *in_pathname, char **fo *** 167,179 **** (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) 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) found_file = openp (get_in_environ (inferior_environ, "LD_LIBRARY_PATH"), 1, in_pathname, O_RDONLY, 0, &temp_pathname); --- 173,185 ---- (in_pathname, O_RDONLY, &temp_pathname); /* If not found, next search the inferior's $PATH environment variable. */ ! 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_absolute_prefix == NULL) found_file = openp (get_in_environ (inferior_environ, "LD_LIBRARY_PATH"), 1, in_pathname, O_RDONLY, 0, &temp_pathname);