Re: [PATCH v3 4/8] gdbserver/linux-aarch64: When thread stops, update its target description

Thiago Jung Bauermann via Gdb-patches
2023-02-04T15:27:16Z

Luis Machado <luis.machado@arm.com> writes:

> On 2/3/23 03:47, Thiago Jung Bauermann wrote:
>> Simon Marchi <simark@simark.ca> writes:
>>> On 2/1/23 21:54, Thiago Jung Bauermann wrote:
>>>> Luis Machado <luis.machado@arm.com> writes:
>>>>> Moving towards thread-specific target descriptions/gdbarch would
>>>>> be a positive thing given the SVE precedent. The process-wide
>>>>> target description/gdbarch no longer reflects the correct settings
>>>>> for each thread on AArch64's with SVE support.
>>>>
>>>> In the first version of these patches I removed the process-wide target
>>>> description and moved it to thread_info, but it was a big patch that
>>>> touched many targets. I can bring it back if you think it's worth it.
>>>
>>> At least for the register description, if we decide it's now a
>>> per-thread thing, what does it mean to have a process-wide description
>>> anyway? I think it would make sense to get rid of it, that could help
>>> confirm our model works (and it would remove the chance of using the
>>> wrong tdesc by mistake for a thread that has its own tdesc). It's
>>> probably something that can be done incrementally though.
>>
>> Would it be done incrementally by keeping process_info->tdesc but
>> changing each target in turn to use thread_info->tdesc and ignore the
>> process_info one?
>
> Given only AArch64 has this requirement at the moment, it may be
> easier to leave the process-wide tdesc up until the point we can
> safely/easily switch to thread-specific ones.
>
> After that, AArch64 will have potentially distinct thread tdescs while
> other architectures will have threads sharing the same tdesc.

Ok, sounds good. Thanks for the clarification!

--
Thiago