Re: [PATCH 00/26] gdbserver: refactor regcache and allow gradually populating

Tom Tromey
2023-03-07T20:40:12Z

>>>>> Tankut Baris Aktemur via Gdb-patches <gdb-patches@sourceware.org> writes:

> Gdbserver's regcache is defined and used in a way that it is either
> invalid or fetches all the registers from the target prior to being
> used. It also seems some regcache functions have two different contracts
> based on argument values (e.g. a buffer being nullptr).

> This is an attempt to refactor the regcache in gdbserver to

> - convert several free functions to methods.
> - use and update register statuses more consistently.
> - allow populating register values gradually, instead of having to
> fetch all register values from the target.

I haven't read these patches, but I wanted to mention that, over time,
we've been trying to bring gdb and gdbserver closer together where
possible. And, I'm wondering how this series fits into this. At the
end, are the two register caches more similar? More divergent?

I'm not necessarily saying this is the most important thing, but for
example what would be unfortunate is if the two ended up with similar
functionality but very different expressions, which would make the
sharing of other code even harder.

Tom