76d8fe6
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
76d8fe6
From: Tom Tromey <tom@tromey.com>
76d8fe6
Date: Mon, 10 Feb 2020 16:04:30 -0500
76d8fe6
Subject: gdb-rhbz1785768-revert-basenames_may_differ.patch
76d8fe6
76d8fe6
;; "Fix" "Paths for breakpoints are not resolved" (Tom Tromey, RHBZ
76d8fe6
;; 1785768).
76d8fe6
76d8fe6
commit 76f5096cd444948843f5bf65eee33c32881d6332
76d8fe6
Author: Tom Tromey <tromey@adacore.com>
76d8fe6
Date:   Wed Feb 5 10:53:44 2020 +0100
76d8fe6
76d8fe6
    Revert basenames_may_differ patch
76d8fe6
76d8fe6
    Commit a0c1ffedc regressed certain cases coming from Eclipse.
76d8fe6
    See PR breakpoints/24915.
76d8fe6
76d8fe6
    This patch reverts the commit for the gdb 9 release.
76d8fe6
76d8fe6
    gdb/ChangeLog
76d8fe6
    2020-02-07  Tom Tromey  <tromey@adacore.com>
76d8fe6
76d8fe6
            PR breakpoints/24915:
76d8fe6
            * source.c (find_and_open_source): Do not check basenames_may_differ.
76d8fe6
76d8fe6
    gdb/testsuite/ChangeLog
76d8fe6
    2020-02-07  Tom Tromey  <tromey@adacore.com>
76d8fe6
76d8fe6
            PR breakpoints/24915:
76d8fe6
            * gdb.base/annotate-symlink.exp: Use setup_xfail.
76d8fe6
76d8fe6
    Change-Id: Iadbf42f35eb40c95ad32b2108ae25d8f199998bd
76d8fe6
76d8fe6
diff --git a/gdb/source.c b/gdb/source.c
76d8fe6
--- a/gdb/source.c
76d8fe6
+++ b/gdb/source.c
76d8fe6
@@ -982,10 +982,7 @@ find_and_open_source (const char *filename,
76d8fe6
       result = gdb_open_cloexec (fullname->get (), OPEN_MODE, 0);
76d8fe6
       if (result >= 0)
76d8fe6
 	{
76d8fe6
-	  if (basenames_may_differ)
76d8fe6
-	    *fullname = gdb_realpath (fullname->get ());
76d8fe6
-	  else
76d8fe6
-	    *fullname = gdb_abspath (fullname->get ());
76d8fe6
+	  *fullname = gdb_realpath (fullname->get ());
76d8fe6
 	  return scoped_fd (result);
76d8fe6
 	}
76d8fe6
 
76d8fe6
@@ -1029,16 +1026,15 @@ find_and_open_source (const char *filename,
76d8fe6
   if (rewritten_filename != NULL)
76d8fe6
     filename = rewritten_filename.get ();
76d8fe6
 
76d8fe6
-  openp_flags flags = OPF_SEARCH_IN_PATH;
76d8fe6
-  if (basenames_may_differ)
76d8fe6
-    flags |= OPF_RETURN_REALPATH;
76d8fe6
-  result = openp (path, flags, filename, OPEN_MODE, fullname);
76d8fe6
+  result = openp (path, OPF_SEARCH_IN_PATH | OPF_RETURN_REALPATH, filename,
76d8fe6
+		  OPEN_MODE, fullname);
76d8fe6
   if (result < 0)
76d8fe6
     {
76d8fe6
       /* Didn't work.  Try using just the basename.  */
76d8fe6
       p = lbasename (filename);
76d8fe6
       if (p != filename)
76d8fe6
-	result = openp (path, flags, p, OPEN_MODE, fullname);
76d8fe6
+	result = openp (path, OPF_SEARCH_IN_PATH | OPF_RETURN_REALPATH, p,
76d8fe6
+			OPEN_MODE, fullname);
76d8fe6
     }
76d8fe6
 
76d8fe6
   return scoped_fd (result);
76d8fe6
diff --git a/gdb/testsuite/gdb.base/annotate-symlink.exp b/gdb/testsuite/gdb.base/annotate-symlink.exp
76d8fe6
--- a/gdb/testsuite/gdb.base/annotate-symlink.exp
76d8fe6
+++ b/gdb/testsuite/gdb.base/annotate-symlink.exp
76d8fe6
@@ -47,5 +47,8 @@ gdb_breakpoint func message
76d8fe6
 
76d8fe6
 gdb_test_no_output "set annotate 1"
76d8fe6
 
76d8fe6
+# The patch to cause this output was reverted.
76d8fe6
+# See PR breakpoints/24915.
76d8fe6
+setup_xfail *-*-* 24915
76d8fe6
 gdb_test "continue" \
76d8fe6
     "Breakpoint .* func .*realname-expand-link.c:$decimal\r\n\032\032.*realname-expand-link.c:.*"