public void Attach(int pid)
{
if (has_target || initialized)
throw new TargetException (TargetError.AlreadyHaveTarget);
has_target = true;
check_error (mono_debugger_server_attach (server_handle, pid));
this.child_pid = pid;
string exe_file, cwd;
string[] cmdline_args;
exe_file = GetApplication (out cwd, out cmdline_args);
start.SetupApplication (exe_file, cwd, cmdline_args);
initialized = true;
SetupInferior ();
change_target_state (TargetState.Stopped, 0);
}