gdb: rename regcache::current_regcache to regcache::regcaches
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 6 Aug 2020 20:23:36 +0000 (16:23 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Thu, 6 Aug 2020 20:23:36 +0000 (16:23 -0400)
commit174981ae1f95f2de534d5da77d0057144ba65066
tree38c97d89ac65e8c3dcba8b335ddce68e56e7e8b7
parentd27aad4ec307d91a6b9056127c6c248044391d7f
gdb: rename regcache::current_regcache to regcache::regcaches

The name `current_regcache` for the list of currently-existing regcaches
sounds wrong.  The name is singular, but it holds multiple regcaches, so
it could at least be `current_regcaches`.

But in other places in GDB, "current" usually means "the object we are
working with right now".  For example, we swap the "current thread" when
we want to operate on a given thread.  This is not the case here, this
variable just holds all regcaches that exist at any given time, not "the
regcache we are working with right now".

So, I think calling it `regcaches` is better.  I also considered
`regcache_list`, but a subsequent patch will make it a map and not a
list, so it would sound wrong again.  `regcaches` sounds right for any
collection of regcache, whatever the type.

Rename a few other things that were related to this `current_regcache`
field.  Note that there is a `get_current_regcache` function, which
returns the regcache of the current thread.  That one is fine, because
it returns the regcache for the current thread.

gdb/ChangeLog:

* regcache.h (class regcache) <current_regcache>: Rename to...
<regcaches>: ... this.  Move doc here.
* regcache.c (regcache::current_regcache) Rename to...
(regcache::regcaches): ... this.  Move doc to header.
(get_thread_arch_aspace_regcache): Update.
(regcache::regcache_thread_ptid_changed): Update.
(registers_changed_ptid): Update.
(class regcache_access) <current_regcache_size>: Rename to...
<regcaches_size>: ... this.
(current_regcache_test): Rename to...
(regcaches_test): ... this.
(_initialize_regcache): Update.

Change-Id: I87de67154f5fe17a1f6aee7c4f2036647ee27b99
gdb/ChangeLog
gdb/regcache.c
gdb/regcache.h
This page took 0.028277 seconds and 4 git commands to generate.