]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb: rename regcache::current_regcache to regcache::regcaches
authorSimon Marchi <simon.marchi@efficios.com>
Fri, 17 Jul 2020 19:29:49 +0000 (15:29 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 5 Aug 2020 19:40:20 +0000 (15:40 -0400)
commit5c879edf04694a41afc5413b158a7e3828d28733
treef5c039cfff1408e141fb70c95eeec87f2df53d23
parent57d02173a25465a5400fad3764568cefb8eae9ab
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/regcache.c
gdb/regcache.h