Re: [PATCH] Fix "maint selftest" regression, add struct, scoped_mock_context

Pedro Alves
2020-06-23T17:58:45Z

On 6/23/20 5:34 PM, Andrew Burgess wrote:
> * Pedro Alves <palves@redhat.com> [2020-06-23 16:38:02 +0100]:
>
>> On 6/23/20 3:26 PM, Pedro Alves via Gdb-patches wrote:
>>> On 6/23/20 2:37 PM, Andrew Burgess wrote:
>>
>>>> I suspect that the problem might be this line in regcache.c:cooked_read_test:
>>>>
>>>> /* Switch to the mock thread. */
>>>> scoped_restore restore_inferior_ptid
>>>> = make_scoped_restore (&inferior_ptid, mock_ptid);
>>>>
>>>> My suspicion from a quick read of your patch above is that we need to
>>>> do more than just set inferior_ptid here now.
>>>
>>> Indeed. Thanks for reporting it.
>>>
>>> I fixed this in gdbarch-selftests.c, where this code is duplicated,
>>> but missed regcache.c. I'll fix it.
>>>
>>
>> Like so. WDYT?
>
> LGTM.
>

Thanks, I've pushed it.

Pedro Alves