Revert basenames_may_differ patch
authorTom Tromey <tromey@adacore.com>
Wed, 5 Feb 2020 09:53:44 +0000 (10:53 +0100)
committerTom Tromey <tromey@adacore.com>
Fri, 7 Feb 2020 21:05:56 +0000 (14:05 -0700)
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

gdb/ChangeLog
gdb/source.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/annotate-symlink.exp

index 901841e816b3cf2191eb8977a48e67a84db9481c..26fffd769cce24acb1e4041b25c97b70f99eeda9 100644 (file)
@@ -1,3 +1,8 @@
+2020-02-07  Tom Tromey  <tromey@adacore.com>
+
+       PR breakpoints/24915:
+       * source.c (find_and_open_source): Do not check basenames_may_differ.
+
 2020-02-07  Tom Tromey  <tom@tromey.com>
 
        * README: Update gdbserver documentation.
index 327e9c1229ebda77849187d04818b50ee280f13f..4f889e4b95ad9b2105f66a538bf455ce0acd83ea 100644 (file)
@@ -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);
index 685994a19a7aea53261385f3cd2109850785660f..f6bd172ca992c8856f3d4c679f12b0028d6cb80f 100644 (file)
@@ -1,3 +1,8 @@
+2020-02-07  Tom Tromey  <tromey@adacore.com>
+
+       PR breakpoints/24915:
+       * gdb.base/annotate-symlink.exp: Use setup_xfail.
+
 2020-02-06  Shahab Vahedi  <shahab@synopsys.com>
 
        * gdb.tui/tui-missing-src.exp: Add the "missing source
index d22593ca364fefedd9b8f941d8560b48dca7a692..830949daa422e00c3234add1f7e7c59543c9061c 100644 (file)
@@ -47,5 +47,8 @@ gdb_breakpoint func message
 
 gdb_test_no_output "set annotate 1"
 
+# The patch to cause this output was reverted.
+# See PR breakpoints/24915.
+setup_xfail *-*-* 24915
 gdb_test "continue" \
     "Breakpoint .* func .*realname-expand-link.c:$decimal\r\n\032\032.*realname-expand-link.c:.*"