This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Fwd: solib_open bug in gdb 5.1.1 solib.c]



<<< text/plain; charset=us-ascii; format=flowed: Unrecognized >>>
--- Begin Message ---
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, ribo@watson.ibm.com


_______________________________________________
Bug-gdb mailing list
Bug-gdb@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-gdb

--- End Message ---

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]