aboutsummaryrefslogtreecommitdiff
path: root/gdb/source.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2020-02-05 10:53:44 +0100
committerTom Tromey <tromey@adacore.com>2020-02-07 14:05:56 -0700
commit5abbbe1d13e03496af5564b997f3c3a2e79b4d73 (patch)
treec2d3892b8faa64e2aa3d2947878c7109a61749d4 /gdb/source.c
parent6e5696561610bcde8f0fe63c967b8a96d70dbf2b (diff)
downloadgdb-5abbbe1d13e03496af5564b997f3c3a2e79b4d73.zip
gdb-5abbbe1d13e03496af5564b997f3c3a2e79b4d73.tar.gz
gdb-5abbbe1d13e03496af5564b997f3c3a2e79b4d73.tar.bz2
Revert basenames_may_differ patch
Commit a0c1ffedc regressed certain cases coming from Eclipse. See PR breakpoints/24915. gdb/ChangeLog 2020-02-07 Tom Tromey <tromey@adacore.com> PR breakpoints/24915: * source.c (find_and_open_source): Do not check basenames_may_differ. gdb/testsuite/ChangeLog 2020-02-07 Tom Tromey <tromey@adacore.com> PR breakpoints/24915: * gdb.base/annotate-symlink.exp: Use setup_xfail. Change-Id: Iadbf42f35eb40c95ad32b2108ae25d8f199998bd
Diffstat (limited to 'gdb/source.c')
-rw-r--r--gdb/source.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/gdb/source.c b/gdb/source.c
index 327e9c1..4f889e4 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -1051,10 +1051,7 @@ find_and_open_source (const char *filename,
result = gdb_open_cloexec (fullname->get (), OPEN_MODE, 0);
if (result >= 0)
{
- if (basenames_may_differ)
- *fullname = gdb_realpath (fullname->get ());
- else
- *fullname = gdb_abspath (fullname->get ());
+ *fullname = gdb_realpath (fullname->get ());
return scoped_fd (result);
}
@@ -1098,12 +1095,9 @@ find_and_open_source (const char *filename,
if (rewritten_filename != NULL)
filename = rewritten_filename.get ();
- openp_flags flags = OPF_SEARCH_IN_PATH;
- if (basenames_may_differ)
- flags |= OPF_RETURN_REALPATH;
-
/* Try to locate file using filename. */
- result = openp (path, flags, filename, OPEN_MODE, fullname);
+ result = openp (path, OPF_SEARCH_IN_PATH | OPF_RETURN_REALPATH, filename,
+ OPEN_MODE, fullname);
if (result < 0 && dirname != NULL)
{
/* Remove characters from the start of PATH that we don't need when
@@ -1124,15 +1118,16 @@ find_and_open_source (const char *filename,
cdir_filename.append (SLASH_STRING);
cdir_filename.append (filename_start);
- result = openp (path, flags, cdir_filename.c_str (), OPEN_MODE,
- fullname);
+ result = openp (path, OPF_SEARCH_IN_PATH | OPF_RETURN_REALPATH,
+ cdir_filename.c_str (), OPEN_MODE, fullname);
}
if (result < 0)
{
/* Didn't work. Try using just the basename. */
p = lbasename (filename);
if (p != filename)
- result = openp (path, flags, p, OPEN_MODE, fullname);
+ result = openp (path, OPF_SEARCH_IN_PATH | OPF_RETURN_REALPATH, p,
+ OPEN_MODE, fullname);
}
return scoped_fd (result);