aboutsummaryrefslogtreecommitdiff
path: root/gdb/regcache.h
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2020-07-17 15:29:49 -0400
committerSimon Marchi <simon.marchi@efficios.com>2020-08-05 15:40:20 -0400
commit5c879edf04694a41afc5413b158a7e3828d28733 (patch)
treef5c039cfff1408e141fb70c95eeec87f2df53d23 /gdb/regcache.h
parent57d02173a25465a5400fad3764568cefb8eae9ab (diff)
downloadgdb-5c879edf04694a41afc5413b158a7e3828d28733.zip
gdb-5c879edf04694a41afc5413b158a7e3828d28733.tar.gz
gdb-5c879edf04694a41afc5413b158a7e3828d28733.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.h2
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: