develop
Petr Mrázek 2009-11-01 10:09:19 +00:00
parent 9dfe3e2096
commit 8a45c15af9
1 changed files with 7 additions and 3 deletions

@ -107,7 +107,6 @@ bool isStopped(pid_t pid)
return true;
}
// shamelessly stolen from dwarf therapist code. credit should go to the author there :)
bool Process::attach()
{
int status;
@ -119,10 +118,15 @@ bool Process::attach()
}
if(!isStopped(my_handle))
{
kill(my_handle,SIGSTOP);
cout << "sent SIGSTOP" << endl;
for(int i = 0 ; i < 5 ; i++)
{
status = kill(my_handle,SIGSTOP);
cout << "sent SIGSTOP" << endl;
if(status != -1) break;
}
while (!isStopped(my_handle))
{
usleep(5000);
cout << "wait step" << endl;
}
}