diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2013-09-04 20:09:39 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2013-09-04 20:09:39 +0000 |
commit | 492c0ab72a050a19d09d0df16eb3b0d8da22be1a (patch) | |
tree | fe7dc9a2a9b6ad41a2bd663c1c6b951d115cc001 /gdb/source.c | |
parent | 23a44de8103159b27793ce556932619ed6cc6b01 (diff) | |
download | gdb-492c0ab72a050a19d09d0df16eb3b0d8da22be1a.zip gdb-492c0ab72a050a19d09d0df16eb3b0d8da22be1a.tar.gz gdb-492c0ab72a050a19d09d0df16eb3b0d8da22be1a.tar.bz2 |
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.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/gdb/source.c b/gdb/source.c index de3fb7c..9fa99b4 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); |