Article View: gnu.gdb.bug
Article #1917solib_open bug in gdb 5.1.1 solib.c
From: Bob Flavin
Date: Sat, 08 Jun 2002 20:04
Date: Sat, 08 Jun 2002 20:04
41 lines
2608 bytes
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
Technical Details
Message-ID:
<5.1.0.14.0.20020608155016.02628bb0@ribox.watson.ibm.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!news.gtei.net!news-out.visi.com!hermes.visi.com!uunet!ash.uu.net!spool0901.news.uu.net!wendy-fate.uu.net!bug-gdbShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f5053,46126db774775d96,start X-Google-Attributes: gidf5053,public X-Google-ArrivalTime: 2002-06-08 13:07:09 PST x-uunet-gateway: mr1.ash.ops.us.uu.net from bug-gdb to gnu.gdb.bug; Sat, 8 Jun 2002 20:07:07 GMT Message-ID: <5.1.0.14.0.20020608155016.02628bb0@ribox.watson.ibm.com> X-Sender: ribo@ribox.watson.ibm.com X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Sat, 08 Jun 2002 16:04:01 -0400 From: ribo@watson.ibm.com (Bob Flavin) Subject: solib_open bug in gdb 5.1.1 solib.c Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Approved: bug-gdb-request@mail.gnu.org Newsgroups: gnu.gdb.bug Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!news.gtei.net!news-out.visi.com!hermes.visi.com!uunet!ash.uu.net!spool0901.news.uu.net!wendy-fate.uu.net!bug-gdb Sender: bug-gdb-request@mail.gnu.org Lines: 42