[PATCH 03/11] gdb: make inferior_list use intrusive_list
Simon Marchi
simon.marchi@polymtl.ca
Wed Jul 14 16:11:07 GMT 2021
On 2021-07-14 2:34 a.m., Tom de Vries wrote:
> On 7/5/21 5:44 PM, Pedro Alves wrote:
>> On 2021-06-22 5:56 p.m., Simon Marchi wrote:
>>> From: Pedro Alves <pedro@palves.net>
>>>
>>> Change inferior_list, the global list of inferiors, to use
>>> intrusive_list. I think most other changes are somewhat obvious
>>> fallouts from this change.
>>>
>>> There is a small change in behavior in scoped_mock_context. Before this
>>> patch, constructing a scoped_mock_context would replace the whole
>>> inferior list with only the new mock inferior. Tests using two
>>> scoped_mock_contexts therefore needed to manually link the two inferiors
>>> together, as the second scoped_mock_context would bump the first mock
>>> inferior from the thread list. With this patch, a scoped_mock_context
>>> adds its mock inferior to the inferior list on construction, and removes
>>> it on destruction. This means that tests run with mock inferiors in the
>>> inferior list in addition to any pre-existing inferiors (there is always
>>> at least one). There is no possible pid clash problem, since each
>>> scoped mock inferior uses its own process target, and pids are per
>>> process target.
>>
>
> Starting this commit, I see this FAIL:
> ...
> (gdb) PASS: gdb.threads/fork-plus-threads.exp: detach-on-fork=off: no
> threads left
> info inferiors
> Num Description Connection Executable
> * 1 <null>
> /home/vries/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.threads/fork-plus-threads/fork-plus-threads
>
> 2 <null>
> /home/vries/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.threads/fork-plus-threads/fork-plus-threads
>
> 3 <null>
> /home/vries/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.threads/fork-plus-threads/fork-plus-threads
>
> 4 <null>
> /home/vries/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.threads/fork-plus-threads/fork-plus-threads
>
> 5 <null>
> /home/vries/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.threads/fork-plus-threads/fork-plus-threads
>
> 6 <null>
> /home/vries/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.threads/fork-plus-threads/fork-plus-threads
>
> 7 <null>
> /home/vries/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.threads/fork-plus-threads/fork-plus-threads
>
> 8 <null>
> /home/vries/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.threads/fork-plus-threads/fork-plus-threads
>
> 9 <null>
> /home/vries/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.threads/fork-plus-threads/fork-plus-threads
>
> 10 <null>
> /home/vries/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.threads/fork-plus-threads/fork-plus-threads
>
> 11 <null>
> /home/vries/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.threads/fork-plus-threads/fork-plus-threads
>
> (gdb) FAIL: gdb.threads/fork-plus-threads.exp: detach-on-fork=off: only
> inferior 1 left
> ...
>
> The test fails because it expects only inferior 1.
>
> Is this a regression?
I see this regression. I might have dismissed those failures thinking
that they were part of the tests that are always racy, not sure. But I
see it failing consistently starting with this patch.
Simon
More information about the Gdb-patches
mailing list