From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28389 invoked by alias); 21 Jun 2019 16:51:32 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 28380 invoked by uid 89); 21 Jun 2019 16:51:32 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.5 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 21 Jun 2019 16:51:31 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id EA85FAF8F; Fri, 21 Jun 2019 16:51:28 +0000 (UTC) Subject: Re: [PATCH][gdb/testsuite] Compile index-cache.c with -Wl,--build-id From: Tom de Vries To: Pedro Alves , gdb-patches@sourceware.org Cc: Simon Marchi References: <20190621152742.GA20230@delia> <62bf83ef-0c18-12a8-bfb0-8f3f28fa84ba@suse.de> <31086b56-cffc-140a-bb5c-fc22151ba379@redhat.com> Message-ID: <9b311104-070a-552d-c66c-dcc199909fa2@suse.de> Date: Fri, 21 Jun 2019 16:51:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------349A192020A9F1F969EA2ED5" X-IsSubscribed: yes X-SW-Source: 2019-06/txt/msg00436.txt.bz2 This is a multi-part message in MIME format. --------------349A192020A9F1F969EA2ED5 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-length: 1394 [ENOPATCH] On 21-06-19 18:50, Tom de Vries wrote: > On 21-06-19 18:32, Pedro Alves wrote: >> On 6/21/19 4:54 PM, Tom de Vries wrote: >>> On 21-06-19 17:47, Pedro Alves wrote: >>>> On 6/21/19 4:27 PM, Tom de Vries wrote: >>>>> Hi, >>>>> >>>>> When building gdb using a combined gcc/binutils-gdb build and running >>>>> gdb.base/index-cache.exp we get: >>>>> ... >>>>> FAIL: gdb.base/index-cache.exp: test_cache_enabled_miss: at least one file was created >>>>> FAIL: gdb.base/index-cache.exp: test_cache_enabled_miss: couldn't get executable build id >>>>> FAIL: gdb.base/index-cache.exp: test_cache_enabled_hit: check index-cache stats >>>>> ... >>>>> >>>>> With "set debug index-cache on" we get: >>>>> ... >>>>> (gdb) file index-cache >>>>> Reading symbols from index-cache... >>>>> index cache: objfile index-cache has no build id >>>>> ... >>>>> >>>>> The problem is that the vanilla toolchain does not add a build-id, which is >>>>> required for the index-cache functionality. >>>> >>>> What is "vanilla" here? A non-combined gcc/build-gdb build? >>>> Or is "combined gcc/build-gdb build" irrelevant here, and >>>> "vanilla" means "no-distro-patches build"? >>> >>> The latter. >> >> OK. Please tweak the commit log in that direction then. >> >> The fix LGTM too. > > Thanks for the review, I've updated the rationale. > > I'll commit in a bit unless there are further comments. > --------------349A192020A9F1F969EA2ED5 Content-Type: text/x-patch; name="0001-gdb-testsuite-Compile-index-cache.c-with-Wl-build-id.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename*0="0001-gdb-testsuite-Compile-index-cache.c-with-Wl-build-id.pa"; filename*1="tch" Content-length: 1451 [gdb/testsuite] Compile index-cache.c with -Wl,--build-id When testing gdb.base/index-cache.exp using a gcc build without --enable-linker-build-id we get: ... FAIL: gdb.base/index-cache.exp: \ test_cache_enabled_miss: at least one file was created FAIL: gdb.base/index-cache.exp: \ test_cache_enabled_miss: couldn't get executable build id FAIL: gdb.base/index-cache.exp: \ test_cache_enabled_hit: check index-cache stats ... With "set debug index-cache on" we find: ... (gdb) file index-cache Reading symbols from index-cache... index cache: objfile index-cache has no build id ... The problem is that a build-id is required for the index-cache functionality. Fix this by compiling index-cache.c with -Wl,--build-id. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2019-06-21 Tom de Vries * gdb.base/index-cache.exp: Add additional_flags=-Wl,--build-id. --- gdb/testsuite/gdb.base/index-cache.exp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.base/index-cache.exp b/gdb/testsuite/gdb.base/index-cache.exp index 075dffe3f5..6f1488e037 100644 --- a/gdb/testsuite/gdb.base/index-cache.exp +++ b/gdb/testsuite/gdb.base/index-cache.exp @@ -18,7 +18,8 @@ standard_testfile -if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } { +if { [prepare_for_testing "failed to prepare" $testfile $srcfile \ + {additional_flags=-Wl,--build-id}] } { return } --------------349A192020A9F1F969EA2ED5--