Message ID | 20190621152742.GA20230@delia |
---|---|
State | New, archived |
Headers |
Received: (qmail 83941 invoked by alias); 21 Jun 2019 15:27:49 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <gdb-patches.sourceware.org> List-Unsubscribe: <mailto:gdb-patches-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 83928 invoked by uid 89); 21 Jun 2019 15:27:49 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.6 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 15:27:47 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id C33C6AD9C; Fri, 21 Jun 2019 15:27:45 +0000 (UTC) Date: Fri, 21 Jun 2019 17:27:43 +0200 From: Tom de Vries <tdevries@suse.de> To: gdb-patches@sourceware.org Cc: Simon Marchi <simon.marchi@polymtl.ca> Subject: [PATCH][gdb/testsuite] Compile index-cache.c with -Wl,--build-id Message-ID: <20190621152742.GA20230@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-IsSubscribed: yes |
Commit Message
Tom de Vries
June 21, 2019, 3:27 p.m. UTC
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. Fix this by compiling index-cache.c with -Wl,--build-id. Tested on x86_64-linux. OK for trunk? Thanks, - Tom [gdb/testsuite] Compile index-cache.c with -Wl,--build-id gdb/testsuite/ChangeLog: 2019-06-21 Tom de Vries <tdevries@suse.de> * 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(-)
Comments
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"? Was the testcase written on a system with a compiler that defaults to --build-id ? Thanks, Pedro Alves
On 2019-06-21 11:47 a.m., Pedro Alves wrote: > Was the testcase > written on a system with a compiler that defaults to --build-id ? Yes, gcc on Ubuntu (which I use) is compiled with --enable-linker-build-id. I think it's correct to change the test case to not assume the linker generates a build-id by default. Simon
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. Thanks, - Tom
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, Pedro Alves
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. Thanks, - Tom
On Friday, June 21 2019, Tom de Vries wrote: > Thanks for the review, I've updated the rationale. > > I'll commit in a bit unless there are further comments. Hi Tom, This has caused a testcase regression on x86_64. It was caught by the BuildBot: https://sourceware.org/ml/gdb-testers/2019-q2/msg06515.html The failures are: PASS -> FAIL: gdb.base/index-cache.exp: test_cache_enabled_hit: check index-cache stats PASS -> FAIL: gdb.base/index-cache.exp: test_cache_enabled_miss: at least one file was created PASS -> FAIL: gdb.base/index-cache.exp: test_cache_enabled_miss: check index-cache stats PASS -> FAIL: gdb.base/index-cache.exp: test_cache_enabled_miss: expected file is there Thanks,
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 }