public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb/gdb-9-branch] Revert basenames_may_differ patch
@ 2020-02-07 19:46 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2020-02-07 19:46 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=76f5096cd444948843f5bf65eee33c32881d6332

commit 76f5096cd444948843f5bf65eee33c32881d6332
Author: Tom Tromey <tromey@adacore.com>
Date:   Wed Feb 5 10:53:44 2020 +0100

    Revert basenames_may_differ patch
    
    Commit a0c1ffedc regressed certain cases coming from Eclipse.
    See PR breakpoints/24915.
    
    This patch reverts the commit for the gdb 9 release.
    
    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

Diff:
---
 gdb/ChangeLog                               |  5 +++++
 gdb/source.c                                | 19 +++++++------------
 gdb/testsuite/ChangeLog                     |  5 +++++
 gdb/testsuite/gdb.base/annotate-symlink.exp |  3 +++
 4 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index dc326f7..2b0e922 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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-01-10  Christian Biesinger  <cbiesinger@google.com>
 
 	* gdbsupport/common-defs.h: Don't define _FORTIFY_SOURCE on MinGW.
diff --git a/gdb/source.c b/gdb/source.c
index 2497e7f..a737c95 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -1025,10 +1025,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);
 	}
 
@@ -1072,12 +1069,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
@@ -1098,15 +1092,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);
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 02a74b9..ec507fd 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2020-02-07  Tom Tromey  <tromey@adacore.com>
+
+	PR breakpoints/24915:
+	* gdb.base/annotate-symlink.exp: Use setup_xfail.
+
 2020-01-06  Andrew Burgess  <andrew.burgess@embecosm.com>
 
 	* gdb.base/backtrace.c: New file.
diff --git a/gdb/testsuite/gdb.base/annotate-symlink.exp b/gdb/testsuite/gdb.base/annotate-symlink.exp
index d22593c..830949d 100644
--- a/gdb/testsuite/gdb.base/annotate-symlink.exp
+++ b/gdb/testsuite/gdb.base/annotate-symlink.exp
@@ -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:.*"


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-02-07 19:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-07 19:46 [binutils-gdb/gdb-9-branch] Revert basenames_may_differ patch Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).