diff options
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); |