#endif
BOOL ret;
DWORD flags;
- int argslen;
- int argc;
PROCESS_INFORMATION pi;
DWORD err;
std::string str_program_args = stringify_argv (program_args);
/* Wait till we are at 1st instruction in program, return new pid
(assuming success). */
- cs.last_ptid = win32_wait (pid_to_ptid (current_process_id), &cs.last_status, 0);
+ cs.last_ptid = win32_wait (ptid_t (current_process_id), &cs.last_status, 0);
return current_process_id;
}
clear_inferiors ();
}
-/* Kill all inferiors. */
+/* Implementation of target_ops::kill. */
+
static int
-win32_kill (int pid)
+win32_kill (process_info *process)
{
- struct process_info *process;
-
- if (current_process_handle == NULL)
- return -1;
-
TerminateProcess (current_process_handle, 0);
for (;;)
{
win32_clear_inferiors ();
- process = find_process_pid (pid);
remove_process (process);
return 0;
}
-/* Detach from inferior PID. */
+/* Implementation of target_ops::detach. */
+
static int
-win32_detach (int pid)
+win32_detach (process_info *process)
{
- struct process_info *process;
winapi_DebugActiveProcessStop DebugActiveProcessStop = NULL;
winapi_DebugSetProcessKillOnExit DebugSetProcessKillOnExit = NULL;
#ifdef _WIN32_WCE
return -1;
DebugSetProcessKillOnExit (FALSE);
- process = find_process_pid (pid);
remove_process (process);
win32_clear_inferiors ();
remove_process (process);
}
-/* Wait for inferiors to end. */
+/* Implementation of target_ops::join. */
+
static void
-win32_join (int pid)
+win32_join (process_info *proc)
{
- HANDLE h = OpenProcess (PROCESS_ALL_ACCESS, FALSE, pid);
+ HANDLE h = OpenProcess (PROCESS_ALL_ACCESS, FALSE, proc->pid);
if (h != NULL)
{
WaitForSingleObject (h, INFINITE);
/* This handles the very limited set of resume packets that GDB can
currently produce. */
- if (n == 1 && ptid_equal (resume_info[0].thread, minus_one_ptid))
+ if (n == 1 && resume_info[0].thread == minus_one_ptid)
tid = -1;
else if (n > 1)
tid = -1;
the Windows resume code do the right thing for thread switching. */
tid = current_event.dwThreadId;
- if (!ptid_equal (resume_info[0].thread, minus_one_ptid))
+ if (resume_info[0].thread != minus_one_ptid)
{
sig = gdb_signal_from_host (resume_info[0].sig);
step = resume_info[0].kind == resume_step;
OUTMSG2 (("Child exited with retcode = %x\n",
ourstatus->value.integer));
win32_clear_inferiors ();
- return pid_to_ptid (current_event.dwProcessId);
+ return ptid_t (current_event.dwProcessId);
case TARGET_WAITKIND_STOPPED:
case TARGET_WAITKIND_LOADED:
OUTMSG2 (("Child Stopped with signal = %d \n",