Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Tom de Vries <tdevries@suse.de>, gdb-patches@sourceware.org
Subject: Re: [gdb/testsuite] Fix index-cache.exp with cc-with-{gdb-index,debug-names}
Date: Sat, 04 May 2019 16:28:00 -0000	[thread overview]
Message-ID: <97114a35-ee8b-3d77-8473-57062364d760@simark.ca> (raw)
In-Reply-To: <a770cb7f-2be6-3e48-58ce-f90773f0adb2@suse.de>

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


  reply	other threads:[~2019-05-04 16:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-03 10:44 [PATCH][gdb/testsuite] Fix index-cache.exp with CC_WITH_TWEAKS_FLAGS=-i Tom de Vries
2019-05-03 21:17 ` Simon Marchi
2019-05-04  8:20   ` [committed][gdb/testsuite] Add cc-with-debug-names.exp Tom de Vries
2019-05-04  8:35   ` [gdb/testsuite] Fix index-cache.exp with cc-with-{gdb-index,debug-names} Tom de Vries
2019-05-04 16:28     ` Simon Marchi [this message]
2019-05-06  6:43       ` Tom de Vries

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=97114a35-ee8b-3d77-8473-57062364d760@simark.ca \
    --to=simark@simark.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=tdevries@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox