#define DEBUG_EXCEPT(x) if (debug_exceptions) printf_unfiltered x
static void windows_stop (ptid_t);
-static int windows_thread_alive (ptid_t);
+static int windows_thread_alive (struct target_ops *, ptid_t);
static void windows_kill_inferior (void);
static enum target_signal last_sig = TARGET_SIGNAL_0;
}
static void
-windows_fetch_inferior_registers (struct regcache *regcache, int r)
+windows_fetch_inferior_registers (struct target_ops *ops,
+ struct regcache *regcache, int r)
{
current_thread = thread_rec (ptid_get_tid (inferior_ptid), TRUE);
/* Check if current_thread exists. Windows sometimes uses a non-existent
/* Store a new register value into the current thread context */
static void
-windows_store_inferior_registers (struct regcache *regcache, int r)
+windows_store_inferior_registers (struct target_ops *ops,
+ struct regcache *regcache, int r)
{
current_thread = thread_rec (ptid_get_tid (inferior_ptid), TRUE);
/* Check if current_thread exists. Windows sometimes uses a non-existent
}
static void
-windows_resume (ptid_t ptid, int step, enum target_signal sig)
+windows_resume (struct target_ops *ops,
+ ptid_t ptid, int step, enum target_signal sig)
{
thread_info *th;
DWORD continue_status = DBG_CONTINUE;
if (step)
{
/* Single step by setting t bit */
- windows_fetch_inferior_registers (get_current_regcache (),
- gdbarch_ps_regnum (current_gdbarch));
+ windows_fetch_inferior_registers (ops,
+ get_current_regcache (),
+ gdbarch_ps_regnum (current_gdbarch));
th->context.EFlags |= FLAG_TRACE_BIT;
}
handling by WFI (or whatever).
*/
static int
-get_windows_debug_event (int pid, struct target_waitstatus *ourstatus)
+get_windows_debug_event (struct target_ops *ops,
+ int pid, struct target_waitstatus *ourstatus)
{
BOOL debug_event;
DWORD continue_status, event_code;
if (!retval || saw_create != 1)
{
if (continue_status == -1)
- windows_resume (minus_one_ptid, 0, 1);
+ windows_resume (ops, minus_one_ptid, 0, 1);
else
CHECK (windows_continue (continue_status, -1));
}
/* Wait for interesting events to occur in the target process. */
static ptid_t
-windows_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
+windows_wait (struct target_ops *ops,
+ ptid_t ptid, struct target_waitstatus *ourstatus)
{
int pid = -1;
to find a better solution to that problem. But in the meantime,
the current approach already greatly mitigate this issue. */
SetConsoleCtrlHandler (NULL, TRUE);
- retval = get_windows_debug_event (pid, ourstatus);
+ retval = get_windows_debug_event (ops, pid, ourstatus);
SetConsoleCtrlHandler (NULL, FALSE);
if (retval)
if (has_detach_ability ())
{
ptid_t ptid = {-1};
- windows_resume (ptid, 0, TARGET_SIGNAL_0);
+ windows_resume (ops, ptid, 0, TARGET_SIGNAL_0);
if (!kernel32_DebugActiveProcessStop (current_event.dwProcessId))
{
/* Convert pid to printable format. */
static char *
-windows_pid_to_str (ptid_t ptid)
+windows_pid_to_str (struct target_ops *ops, ptid_t ptid)
{
static char buf[80];
windows_ops.to_has_registers = 1;
windows_ops.to_has_execution = 1;
windows_ops.to_pid_to_exec_file = windows_pid_to_exec_file;
+ i386_use_watchpoints (&windows_ops);
+
windows_ops.to_magic = OPS_MAGIC;
}
by "polling" it. If WaitForSingleObject returns WAIT_OBJECT_0
it means that the thread has died. Otherwise it is assumed to be alive. */
static int
-windows_thread_alive (ptid_t ptid)
+windows_thread_alive (struct target_ops *ops, ptid_t ptid)
{
int tid;