🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Bob Flavin Sat, 08 Jun 2002 20:04
solib_open bug in gdb 5.1.1 solib.c
#1917
Author: Bob Flavin
Date: Sat, 08 Jun 2002 20:04
41 lines
2608 bytes
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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads