diff options
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/source.c | 13 |
2 files changed, 9 insertions, 9 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 024e171fa3f..efe461884eb 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2019-06-06 Руслан Ижбулатов <lrn1986@gmail.com> + + * source.c (find_and_open_source): Also rewrite relative file + names. + 2019-04-26 Amos Bird <amosbird@gmail.com> * annotate.c (annotate_thread_exited): Add "thread-exited" diff --git a/gdb/source.c b/gdb/source.c index 9a30209880b..00052e67cb9 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -1025,16 +1025,11 @@ find_and_open_source (const char *filename, } } - gdb::unique_xmalloc_ptr<char> rewritten_filename; - if (IS_ABSOLUTE_PATH (filename)) - { - /* If filename is absolute path, try the source path - substitution on it. */ - rewritten_filename = rewrite_source_path (filename); + gdb::unique_xmalloc_ptr<char> rewritten_filename + = rewrite_source_path (filename); - if (rewritten_filename != NULL) - filename = rewritten_filename.get (); - } + if (rewritten_filename != NULL) + filename = rewritten_filename.get (); result = openp (path, OPF_SEARCH_IN_PATH | OPF_RETURN_REALPATH, filename, OPEN_MODE, fullname); |