diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2020-08-06 16:23:36 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2020-08-06 16:23:36 -0400 |
commit | 174981ae1f95f2de534d5da77d0057144ba65066 (patch) | |
tree | 38c97d89ac65e8c3dcba8b335ddce68e56e7e8b7 /gdb/regcache.h | |
parent | d27aad4ec307d91a6b9056127c6c248044391d7f (diff) | |
download | binutils-174981ae1f95f2de534d5da77d0057144ba65066.zip binutils-174981ae1f95f2de534d5da77d0057144ba65066.tar.gz binutils-174981ae1f95f2de534d5da77d0057144ba65066.tar.bz2 |
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
Diffstat (limited to 'gdb/regcache.h')
-rw-r--r-- | gdb/regcache.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/regcache.h b/gdb/regcache.h index b8561d7..f262795 100644 --- a/gdb/regcache.h +++ b/gdb/regcache.h @@ -402,7 +402,7 @@ protected: regcache (process_stratum_target *target, gdbarch *gdbarch, const address_space *aspace); - static std::forward_list<regcache *> current_regcache; + static std::forward_list<regcache *> regcaches; private: |