+static int
+i386_win32_num_regs (void)
+{
+ int num_regs;
+#ifdef __x86_64__
+ if (!wow64_process)
+ num_regs = sizeof (amd64_mappings) / sizeof (amd64_mappings[0]);
+ else
+#endif
+ num_regs = sizeof (i386_mappings) / sizeof (i386_mappings[0]);
+ return num_regs;
+}
+
+/* Implement win32_target_ops "get_pc" method. */
+
+static CORE_ADDR
+i386_win32_get_pc (struct regcache *regcache)
+{
+ bool use_64bit = register_size (regcache->tdesc, 0) == 8;
+
+ if (use_64bit)
+ {
+ uint64_t pc;
+
+ collect_register_by_name (regcache, "rip", &pc);
+ return (CORE_ADDR) pc;
+ }
+ else
+ {
+ uint32_t pc;
+
+ collect_register_by_name (regcache, "eip", &pc);
+ return (CORE_ADDR) pc;
+ }
+}
+
+/* Implement win32_target_ops "set_pc" method. */
+
+static void
+i386_win32_set_pc (struct regcache *regcache, CORE_ADDR pc)
+{
+ bool use_64bit = register_size (regcache->tdesc, 0) == 8;
+
+ if (use_64bit)
+ {
+ uint64_t newpc = pc;
+
+ supply_register_by_name (regcache, "rip", &newpc);
+ }
+ else
+ {
+ uint32_t newpc = pc;
+
+ supply_register_by_name (regcache, "eip", &newpc);
+ }