aboutsummaryrefslogtreecommitdiff
path: root/gdb/regcache.h
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2020-08-06 16:23:48 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2020-08-06 16:23:48 -0400
commit159ed7d93fff1ce245ab5f86597e91e81d8e2453 (patch)
treed0319f072572fd6702e5731c803b5dedc13abc2b /gdb/regcache.h
parent174981ae1f95f2de534d5da77d0057144ba65066 (diff)
downloadgdb-159ed7d93fff1ce245ab5f86597e91e81d8e2453.zip
gdb-159ed7d93fff1ce245ab5f86597e91e81d8e2453.tar.gz
gdb-159ed7d93fff1ce245ab5f86597e91e81d8e2453.tar.bz2
gdb: move regcache::regcaches to regcache.c
I don't really understand why `regcache_thread_ptid_changed` is a static method of `struct regcache` instead of being a static free function in regcache.c. And I don't understand why `current_regcache` is a static member of `struct regcache` instead of being a static global in regcache.c. It's not wrong per-se, but there's no other place where we do it like this in GDB (as far as I remember) and it just exposes things unnecessarily in the .h. Move them to be just static in regcache.c. As a result, registers_changed_ptid doesn't need to be friend of the regcache class anymore. Removing the include of forward_list in regcache.h showed that we were missing an include for it in dwarf2/index-write.c, record-btrace.c and sparc64-tdep.c. gdb/ChangeLog: * regcache.h (class regcache): Remove friend registers_changed_ptid. <regcache_thread_ptid_changed>: Remove. <regcaches>: Remove. * regcache.c (regcache::regcaches): Rename to... (regcaches): ... this. Make static. (get_thread_arch_aspace_regcache): Update. (regcache::regcache_thread_ptid_changed): Rename to... (regcache_thread_ptid_changed): ... this. Update. (class regcache_access): Remove. (regcaches_test): Update. (_initialize_regcache): Update. * sparc64-tdep.c, dwarf2/index-write.c, record-btrace.c: Include <forward_list>. Change-Id: Iabc25759848010cfbb7ee7e27f60eaca17d61c12
Diffstat (limited to 'gdb/regcache.h')
-rw-r--r--gdb/regcache.h7
1 files changed, 0 insertions, 7 deletions
diff --git a/gdb/regcache.h b/gdb/regcache.h
index f262795..dd0c2f2 100644
--- a/gdb/regcache.h
+++ b/gdb/regcache.h
@@ -22,7 +22,6 @@
#include "gdbsupport/common-regcache.h"
#include "gdbsupport/function-view.h"
-#include <forward_list>
struct regcache;
struct regset;
@@ -397,13 +396,10 @@ public:
debug. */
void debug_print_register (const char *func, int regno);
- static void regcache_thread_ptid_changed (ptid_t old_ptid, ptid_t new_ptid);
protected:
regcache (process_stratum_target *target, gdbarch *gdbarch,
const address_space *aspace);
- static std::forward_list<regcache *> regcaches;
-
private:
/* Helper function for transfer_regset. Copies across a single register. */
@@ -437,9 +433,6 @@ private:
get_thread_arch_aspace_regcache (process_stratum_target *target, ptid_t ptid,
struct gdbarch *gdbarch,
struct address_space *aspace);
-
- friend void
- registers_changed_ptid (process_stratum_target *target, ptid_t ptid);
};
class readonly_detached_regcache : public readable_regcache