About 38 lines into solib_open in solib.c  there are three lines
that look like:

   if (found_file < 0 && solib_search_path != NULL)

for searching various directories, I think they were copied one from
another and that the second and third should not refer to solib_search_path,
but should refer to 'get_in_environ (inferior_environ, "PATH")' and
'get_in_environ (inferior_environ, "LD_LIBRARY_PATH")' respectively.

Perhaps the following code would be suitable (if get_in_environ returns a
null if the env var is not defined):

/* 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);

/* If not found, next search the inferior's $PATH environment variable. */
p = get_in_environ (inferior_environ, "PATH");
if (found_file < 0 && p != NULL)
found_file = openp (p, 1, in_pathname, O_RDONLY, 0, &temp_pathname);

/* If not found, next search the inferior's $LD_LIBRARY_PATH
environment variable. */
p = get_in_environ (inferior_environ, "LD_LIBRARY_PATH");
if (found_file < 0 && p != NULL)
found_file = openp (p, 1, in_pathname, O_RDONLY, 0, &temp_pathname);


The bug that this fixes is that the following error message:

   Error while mapping shared library sections:

was incorrectly generated because solib_open failed to find libraries that
were listed in env var "PATH".  (The second call to openp was skipped
because solib_search_path was being tested when it should have looked
for PATH in inferior_environ.


Bob Flavin, [EMAIL PROTECTED]


_______________________________________________
Bug-gdb mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-gdb

Reply via email to