Re: [PATCH 08/15] class regcache_read and Pass regcache_read to gdbarch methods

Yao Qi
2018-01-23T22:28:26Z

On Tue, Jan 23, 2018 at 9:51 PM, Simon Marchi <simon.marchi@ericsson.com> wrote:
>
> Did you consider changing other gdbarch methods that only need to read the
> registers? read_pc comes to mind, but there are perhaps others.
>

I didn't think about this, but you are right, other gdbarch methods can be
changed too. read_pc and breakpoint_kind_from_current_state should
use the right type of regcache which only has read methods. I'll do the
change.

>> regcache_read is an abstract base class, and it has a pure virtual
>> function raw_update, because I don't want regcache_read know where these
>> raw registers are from. They can be from either the target (readwrite
>> regcache) or the regcache itself (readonly regcache).
>
> About the naming, I think that readcache_read sounds like a function (it
> sounds like an action). Instinctively, I would call it readable_regcache.
>

If we take regcache_readonly into account too, we need some naming
consistency here. We either use "readable_regcache/readonly_regcache"
or "regcache_readable/regcache_readonly". I can choose the former
scheme.

--
Yao (齐尧)