aboutsummaryrefslogtreecommitdiff
path: root/gdb/solib.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2004-07-30 19:17:20 +0000
committerEli Zaretskii <eliz@gnu.org>2004-07-30 19:17:20 +0000
commit014d698b35008f566973fc2fe0d4a0d3e3009a06 (patch)
tree22e582437f29fe08fbbc4ee270a97a028d19564d /gdb/solib.c
parentbe7d7357efe8cad63c8920b7fa69f6d2324d6fa5 (diff)
downloadgdb-014d698b35008f566973fc2fe0d4a0d3e3009a06.zip
gdb-014d698b35008f566973fc2fe0d4a0d3e3009a06.tar.gz
gdb-014d698b35008f566973fc2fe0d4a0d3e3009a06.tar.bz2
* defs.h (OPF_TRY_CWD_FIRST, OPF_SEARCH_IN_PATH): New macros.
* exec.c (exec_file_attach): * nto-tdep.c (nto_find_and_open_solib): * pa64solib.c (pa64_solib_sizeof_symbol_table): * solib.c (solib_open): * somsolib.c (som_solib_sizeof_symbol_table): * source.c (is_regular_file, openp, open_source_file): * symfile.c (symfile_bfd_open): * wince.c (upload_to_device): Differentiate between the search for binary and source files.
Diffstat (limited to 'gdb/solib.c')
-rw-r--r--gdb/solib.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/gdb/solib.c b/gdb/solib.c
index 76d782d..e722b98 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -156,15 +156,15 @@ solib_open (char *in_pathname, char **found_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);
+ found_file = openp (solib_search_path, OPF_TRY_CWD_FIRST,
+ in_pathname, O_RDONLY, 0, &temp_pathname);
/* If not found, next search the solib_search_path (if any) for the basename
only (ignoring the path). This is to allow reading solibs from a path
that differs from the opened path. */
if (found_file < 0 && solib_search_path != NULL)
- found_file = openp (solib_search_path,
- 1, lbasename (in_pathname), O_RDONLY, 0,
+ found_file = openp (solib_search_path, OPF_TRY_CWD_FIRST,
+ lbasename (in_pathname), O_RDONLY, 0,
&temp_pathname);
/* If not found, try to use target supplied solib search method */
@@ -175,13 +175,15 @@ solib_open (char *in_pathname, char **found_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);
+ OPF_TRY_CWD_FIRST, 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);
+ OPF_TRY_CWD_FIRST, in_pathname, O_RDONLY, 0,
+ &temp_pathname);
/* Done. If not found, tough luck. Return found_file and
(optionally) found_pathname. */