From patchwork Wed Feb 5 09:55:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 37688 Received: (qmail 84367 invoked by alias); 5 Feb 2020 09:55:31 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 84355 invoked by uid 89); 5 Feb 2020 09:55:31 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=HContent-Transfer-Encoding:8bit X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 05 Feb 2020 09:55:29 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id B020B117A2C; Wed, 5 Feb 2020 04:55:27 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id xkaRK0AdEYbR; Wed, 5 Feb 2020 04:55:27 -0500 (EST) Received: from localhost.localdomain (unknown [185.24.140.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPSA id 4F25E1178FA; Wed, 5 Feb 2020 04:55:27 -0500 (EST) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFC gdb 9] Revert basenames_may_differ patch Date: Wed, 5 Feb 2020 10:55:15 +0100 Message-Id: <20200205095515.335-1-tromey@adacore.com> MIME-Version: 1.0 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-05 Tom Tromey PR breakpoints/24915: * source.c (find_and_open_source): Do not check basenames_may_differ. gdb/testsuite/ChangeLog 2020-02-05 Tom Tromey PR breakpoints/24915: * gdb.base/annotate-symlink.exp: Use setup_xfail. Change-Id: Iadbf42f35eb40c95ad32b2108ae25d8f199998bd --- 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/source.c b/gdb/source.c index 2497e7f750e..a737c95e7a4 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/gdb.base/annotate-symlink.exp b/gdb/testsuite/gdb.base/annotate-symlink.exp index d22593ca364..830949daa42 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:.*"