#include "tdesc.h"
#include "x86-tdesc.h"
+using namespace windows_nat;
+
#ifndef CONTEXT_EXTENDED_REGISTERS
#define CONTEXT_EXTENDED_REGISTERS 0
#endif
/* The actual update is done later just before resuming the lwp,
we just mark that the registers need updating. */
- th->debug_registers_changed = 1;
+ th->debug_registers_changed = true;
}
/* Update the inferior's debug register REGNUM from STATE. */
FIXME: should we set dr6 also ?? */
th->context.Dr7 = dr->dr_control_mirror;
- th->debug_registers_changed = 0;
+ th->debug_registers_changed = false;
}
}
static void
i386_thread_added (windows_thread_info *th)
{
- th->debug_registers_changed = 1;
+ th->debug_registers_changed = true;
}
static void
win32_tdesc = tdesc;
}
+/* 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);
+ }
+}
+
struct win32_target_ops the_low_target = {
i386_arch_setup,
sizeof (mappings) / sizeof (mappings[0]),
i386_single_step,
&i386_win32_breakpoint,
i386_win32_breakpoint_len,
+ 1,
+ i386_win32_get_pc,
+ i386_win32_set_pc,
i386_supports_z_point_type,
i386_insert_point,
i386_remove_point,