From patchwork Fri May 3 10:43:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 32493 Received: (qmail 74316 invoked by alias); 3 May 2019 10:44:00 -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 74306 invoked by uid 89); 3 May 2019 10:43:59 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.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=sk:cc_with, sk:CC_WITH 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, 03 May 2019 10:43:58 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 29BC0AD89 for ; Fri, 3 May 2019 10:43:56 +0000 (UTC) Date: Fri, 3 May 2019 12:43:54 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH][gdb/testsuite] Fix index-cache.exp with CC_WITH_TWEAKS_FLAGS=-i Message-ID: <20190503104352.GA7789@delia> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-IsSubscribed: yes Hi, When running gdb.base/index-cache.exp with target board cc-with-tweaks with CC_WITH_TWEAKS_FLAGS set to "-i", we run into: ... 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: expected file is there FAIL: gdb.base/index-cache.exp: test_cache_enabled_miss: check index-cache stats FAIL: gdb.base/index-cache.exp: test_cache_enabled_hit: check index-cache stats ... The problem is that the target board makes sure that the generated executable contains a .gdb_index section, while the test assumes that the executable doesn't contain this section. Fix this by removing the .gdb_index section from the generated executable. Tested on x86_64-linux with native and CC_WITH_TWEAKS_FLAGS=-i config. OK for trunk? Thanks, - Tom [gdb/testsuite] Fix index-cache.exp with CC_WITH_TWEAKS_FLAGS=-i gdb/testsuite/ChangeLog: 2019-05-03 Tom de Vries * gdb.base/index-cache.exp: Remove .gdb_index section from generated executable. --- gdb/testsuite/gdb.base/index-cache.exp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gdb/testsuite/gdb.base/index-cache.exp b/gdb/testsuite/gdb.base/index-cache.exp index 4e583abf01..a97252cee4 100644 --- a/gdb/testsuite/gdb.base/index-cache.exp +++ b/gdb/testsuite/gdb.base/index-cache.exp @@ -22,6 +22,12 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } { return } +# If a .gdb_index section was already added during compilation, remove it. +if {[run_on_host "objcopy" [gdb_find_objcopy] \ + "--remove-section .gdb_index $binfile"]} { + return +} + # List the files in DIR on the host (where GDB-under-test runs). # Return a list of two elements: # - 0 on success, -1 on failure