From: Tom de Vries <tdevries@suse.de>
To: Simon Marchi <simon.marchi@polymtl.ca>, gdb-patches@sourceware.org
Subject: Re: [PATCH][gdb/testsuite] Fix gdb.opt/solib-intra-step.exp with -m32 and gcc-10
Date: Fri, 29 Jan 2021 11:44:08 +0100 [thread overview]
Message-ID: <8686a79b-cee1-6fee-6271-9b01b124dfb0@suse.de> (raw)
In-Reply-To: <4c0d6cdf-d1aa-2c0e-e99c-092ea8ae0aac@polymtl.ca>
On 1/28/21 7:20 PM, Simon Marchi wrote:
> On 2021-01-28 1:15 p.m., Tom de Vries wrote:> On 1/28/21 7:04 PM, Simon Marchi wrote:
>>>>>> @@ -89,7 +89,7 @@ gdb_test_multiple "step" $test {
>>>>>> exp_continue
>>>>>> }
>>>>>> -re -wrap "get_pc_thunk.*" {
>>>>>> - if { $state != 1 } {
>>>>>> + if { $state != 0 && $state != 1 } {
>>>>>> set state -1
>>>>>> } else {
>>>>>> set state 2
>>>>>>
>>>>>
>>>>> I don't really understand what happens here, what state value means what.
>>>>>
>>>>> A bit of commenting would help.
>>>>
>>>> I tried to add comments but didn't manage to come up with something
>>>> sensible.
>>>>
>>>> Instead, I simplified gdb_test_multiple to just track the order of
>>>> events, and then added a few asserts about order of events.
>>>>
>>>> I hope this clarifies what the test is trying to do. WDYT?
>>>
>>> Hmm, it's still not clear to me what the intention of the test is. It's
>>> not clear what kind of good or bad behavior from GDB we are looking for.
>>> That intention needs to be recorded in a comment, otherwise, I can't
>>> tell if the code matches what we want (since I don't know what we want).
>>> I kind of understand now that we do a step, we want to get until the
>>> "first-hit" line (or "second-hit" in the second case), but it's possible
>>> that we land on intermediary states, which are acceptable. But there
>>> also seems to be an ordering component? Why is that important? Why
>>> don't we simply "exp_continue" when seeing "retry" or "get_pc_thunk",
>>> why bother recording anything?
>>
>> Ah, I see.
>>
>> Well, it's an attempt to be precise about what we accept in the test.
>> Much in the same way that two subsequent gdb_test do that.
>>
>> But yeah, I don't think it's really important, so I can drop that part.
>
> Thanks, and to be clear I don't have anything against what you suggest,
> the test was lacking proper documentation before you touched it.
Right, nevertheless I think it was good to go over this and try to make
thing more readable. So, thanks for the review :)
Committed with the state machine part removed.
Thanks,
- Tom
prev parent reply other threads:[~2021-01-29 10:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-26 18:03 Tom de Vries
2021-01-28 15:03 ` Simon Marchi via Gdb-patches
2021-01-28 17:50 ` Tom de Vries
2021-01-28 18:04 ` Simon Marchi via Gdb-patches
2021-01-28 18:15 ` Tom de Vries
2021-01-28 18:20 ` Simon Marchi via Gdb-patches
2021-01-29 10:44 ` Tom de Vries [this message]
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=8686a79b-cee1-6fee-6271-9b01b124dfb0@suse.de \
--to=tdevries@suse.de \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@polymtl.ca \
/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