summaryrefslogtreecommitdiff
path: root/gdb/source.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2013-09-04 20:09:38 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2013-09-04 20:09:38 +0000
commit6bdaad1a541c341f922b6ce2772f88ffdf3e0158 (patch)
tree85912d54b92cffe33d2153933fae0b51a343da87 /gdb/source.c
parente6b7b3d4b2f95670d5c36dd9d4619666b0a29205 (diff)
downloadgdb-6bdaad1a541c341f922b6ce2772f88ffdf3e0158.tar.gz
Code cleanup: Change OPF_DISABLE_REALPATH to OPF_RETURN_REALPATH.
gdb/ 2013-09-04 Jan Kratochvil <jan.kratochvil@redhat.com> Code cleanup: Change OPF_DISABLE_REALPATH to OPF_RETURN_REALPATH. * cli/cli-cmds.c (find_and_open_script): Add OPF_RETURN_REALPATH to variable search_flags. * defs.h (OPF_DISABLE_REALPATH): Rename to ... (OPF_RETURN_REALPATH): ... here. * dwarf2read.c (try_open_dwop_file): Set OPF_RETURN_REALPATH for flags. * exec.c (exec_file_attach): Remove OPF_DISABLE_REALPATH from openp call. Twice. * nto-tdep.c (nto_find_and_open_solib): Add OPF_RETURN_REALPATH for openp call. * solib.c (solib_find): Likewise. Four times. * source.c (openp): Change OPF_DISABLE_REALPATH to OPF_RETURN_REALPATH in the function comment and for the realpath_fptr variable. (source_full_path_of): Add OPF_RETURN_REALPATH for openp call. (find_and_open_source): Likewise. Twice. * symfile.c (symfile_bfd_open): Likewise, also twice.
Diffstat (limited to 'gdb/source.c')
-rw-r--r--gdb/source.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/gdb/source.c b/gdb/source.c
index de3fb7c5a34..9fa99b4d3de 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -689,10 +689,10 @@ is_regular_file (const char *name)
and the file, sigh! Emacs gets confuzzed by this when we print the
source file name!!!
- If OPTS does not have OPF_DISABLE_REALPATH set return FILENAME_OPENED
- resolved by gdb_realpath. Even with OPF_DISABLE_REALPATH this function
- still returns filename starting with "/". If FILENAME_OPENED is NULL
- this option has no effect.
+ If OPTS has OPF_RETURN_REALPATH set return FILENAME_OPENED resolved by
+ gdb_realpath. Even without OPF_RETURN_REALPATH this function still returns
+ filename starting with "/". If FILENAME_OPENED is NULL this option has no
+ effect.
If a file is found, return the descriptor.
Otherwise, return -1, with errno set for the last name we tried to open. */
@@ -857,8 +857,8 @@ done:
{
char *(*realpath_fptr) (const char *);
- realpath_fptr = ((opts & OPF_DISABLE_REALPATH) != 0
- ? xstrdup : gdb_realpath);
+ realpath_fptr = ((opts & OPF_RETURN_REALPATH) != 0
+ ? gdb_realpath : xstrdup);
if (IS_ABSOLUTE_PATH (filename))
*filename_opened = realpath_fptr (filename);
@@ -897,8 +897,9 @@ source_full_path_of (const char *filename, char **full_pathname)
{
int fd;
- fd = openp (source_path, OPF_TRY_CWD_FIRST | OPF_SEARCH_IN_PATH, filename,
- O_RDONLY, full_pathname);
+ fd = openp (source_path,
+ OPF_TRY_CWD_FIRST | OPF_SEARCH_IN_PATH | OPF_RETURN_REALPATH,
+ filename, O_RDONLY, full_pathname);
if (fd < 0)
{
*full_pathname = NULL;
@@ -1077,13 +1078,15 @@ find_and_open_source (const char *filename,
}
}
- result = openp (path, OPF_SEARCH_IN_PATH, filename, OPEN_MODE, fullname);
+ result = openp (path, OPF_SEARCH_IN_PATH | OPF_RETURN_REALPATH, filename,
+ OPEN_MODE, fullname);
if (result < 0)
{
/* Didn't work. Try using just the basename. */
p = lbasename (filename);
if (p != filename)
- result = openp (path, OPF_SEARCH_IN_PATH, p, OPEN_MODE, fullname);
+ result = openp (path, OPF_SEARCH_IN_PATH | OPF_RETURN_REALPATH, p,
+ OPEN_MODE, fullname);
}
do_cleanups (cleanup);