Re: [PATCH 03/26] gdbserver: by-pass regcache to access tdesc only

Simon Marchi
2023-12-21T20:22:25Z

On 2/28/23 06:28, Tankut Baris Aktemur via Gdb-patches wrote:
> The `get_thread_regcache` function has a `fetch` option to skip
> fetching the registers from the target. It seems this option is set
> to false only at uses where we just need to access the tdesc through
> the regcache of the current thread, as in
>
> struct regcache *regcache = get_thread_regcache (current_thread, 0);
> ... regcache->tdesc ...
>
> Since the tdesc of a regcache is set from the process of the thread
> that owns the regcache, we can simplify the code to access the tdesc
> via the process, as in
>
> ... current_process ()->tdesc ...
>
> This is intended to be a refactoring with no behavioral change.
>
> Tested only for the linux-x86-low target.

Thanks, that LGTM. You can apply it immediately, I think, it's good on
its own.

Approved-By: Simon Marchi <simon.marchi@efficios.com>

Simon