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