This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 08/15] class regcache_read and Pass regcache_read to gdbarch methods
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: Simon Marchi <simon dot marchi at ericsson dot com>
- Cc: GDB Patches <gdb-patches at sourceware dot org>
- Date: Tue, 23 Jan 2018 22:28:22 +0000
- Subject: Re: [PATCH 08/15] class regcache_read and Pass regcache_read to gdbarch methods
- Authentication-results: sourceware.org; auth=none
- References: <1512125286-29788-1-git-send-email-yao.qi@linaro.org> <1512125286-29788-9-git-send-email-yao.qi@linaro.org> <94ef6e4d-50bd-9e17-e143-fe304ea829ee@ericsson.com>
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 (齐尧)