From 8a45c15af9fe59bb7efafe2ca4da6b61f1e0c9a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 1 Nov 2009 10:09:19 +0000 Subject: [PATCH] voodoo --- library/DFProcess.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/library/DFProcess.cpp b/library/DFProcess.cpp index eeaba0652..857972e60 100644 --- a/library/DFProcess.cpp +++ b/library/DFProcess.cpp @@ -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; } }