aboutsummaryrefslogtreecommitdiff
path: root/gdb/exec.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/exec.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/exec.c')
-rw-r--r--gdb/exec.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gdb/exec.c b/gdb/exec.c
index 7719ac8..e0652fb 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -194,7 +194,7 @@ exec_file_attach (char *filename, int from_tty)
char *scratch_pathname;
int scratch_chan;
- scratch_chan = openp (getenv ("PATH"), 1, filename,
+ scratch_chan = openp (getenv ("PATH"), OPF_TRY_CWD_FIRST, filename,
write_files ? O_RDWR | O_BINARY : O_RDONLY | O_BINARY, 0,
&scratch_pathname);
#if defined(__GO32__) || defined(_WIN32) || defined(__CYGWIN__)
@@ -202,8 +202,9 @@ exec_file_attach (char *filename, int from_tty)
{
char *exename = alloca (strlen (filename) + 5);
strcat (strcpy (exename, filename), ".exe");
- scratch_chan = openp (getenv ("PATH"), 1, exename, write_files ?
- O_RDWR | O_BINARY : O_RDONLY | O_BINARY, 0, &scratch_pathname);
+ scratch_chan = openp (getenv ("PATH"), OPF_TRY_CWD_FIRST, exename,
+ write_files ? O_RDWR | O_BINARY : O_RDONLY | O_BINARY, 0,
+ &scratch_pathname);
}
#endif
if (scratch_chan < 0)