+
+/* Key for the hash map keeping the regcaches. */
+
+struct ptid_arch
+{
+ ptid_arch (ptid_t ptid, gdbarch *arch)
+ : ptid (ptid), arch (arch)
+ {}
+
+ ptid_t ptid;
+ gdbarch *arch;
+
+ bool operator== (const ptid_arch &other) const
+ {
+ return this->ptid == other.ptid && this->arch == other.arch;
+ }
+};
+
+/* Hash function for ptid_arch. */
+
+struct hash_ptid_arch
+{
+ size_t operator() (const ptid_arch &val) const
+ {
+ hash_ptid h_ptid;
+ std::hash<long> h_long;
+ return h_ptid (val.ptid) + h_long ((long) val.arch);
+ }
+};
+
+using ptid_arch_regcache_map = std::unordered_map<ptid_arch, regcache *, hash_ptid_arch>;
+
+/* Hash map containing the regcaches. */
+
+static ptid_arch_regcache_map the_regcaches;