From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 449 invoked by alias); 4 May 2019 16:28:30 -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 436 invoked by uid 89); 4 May 2019 16:28:30 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-8.5 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_1,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy=H*r:10.0.0, our X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 04 May 2019 16:28:28 +0000 Received: from [10.0.0.11] (unknown [192.222.164.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id E24751E0A9; Sat, 4 May 2019 12:28:26 -0400 (EDT) Subject: Re: [gdb/testsuite] Fix index-cache.exp with cc-with-{gdb-index,debug-names} To: Tom de Vries , gdb-patches@sourceware.org References: <20190503104352.GA7789@delia> From: Simon Marchi Message-ID: <97114a35-ee8b-3d77-8473-57062364d760@simark.ca> Date: Sat, 04 May 2019 16:28: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: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-05/txt/msg00138.txt.bz2 On 2019-05-04 4:35 a.m., Tom de Vries wrote: > [ was: Re: [PATCH][gdb/testsuite] Fix index-cache.exp with > CC_WITH_TWEAKS_FLAGS=-i ] > > On 03-05-19 23:17, Simon Marchi wrote: >> On 2019-05-03 6:43 a.m., Tom de Vries wrote: >>> 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 >> >> Hi Tom, >> >> I would slightly prefer that instead of doing this, we would notice that that file >> already has an index (in the form of .gdb_index or .debug_names), and adjust our >> expectations in the test. >> >> In other words, we currently assert that loading the file in GDB will produce some >> files in the cache. However, if we know that the file already has an index, we >> should verify that no file was produced, as this is the behavior we expect when >> loading a file which already has an index. >> >> Stripping the index makes the test pass, but it just goes back to testing the same >> thing as with the default board file. Adjusting our expectation to the presence >> of an index makes the test cover a different use case. > > I've implemented this approach, attached below. > > OK for trunk? > > Thanks, > - Tom > Thanks Tom, this LGTM. Before pushing, could you just adjust the comments above each proc? They describe what the test expects (at a high level), so maybe just add a precision about what is expected when the binary already has an index. Simon