diff options
Diffstat (limited to 'debugger.c')
-rw-r--r-- | debugger.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -20,7 +20,7 @@ static const int PTRACE_OPTIONS = static const int PTRACE_CHILD_OPTIONS = PTRACE_OPTIONS | PTRACE_O_EXITKILL; //static const int STOP_ALL_ON_EVENT = 1; -static const useconds_t SCHEDULER_DELAY = 100000; +static const useconds_t SCHEDULER_DELAY = 10000; static const unsigned int BREAKPOINT_INSN = 0xcc; static struct process *new_process(pid_t id, int child) { @@ -224,6 +224,7 @@ static void continue_all_threads(struct process *proc) { static void resume_threads(struct process *proc) { struct list *threads = &proc->threads; + int once = 0; for (struct thread *th = threads->head; th != threads->end; th = th->next) { if (th->doing == PTRACE_SINGLESTEP) { @@ -236,6 +237,10 @@ static void resume_threads(struct process *proc) { for (struct thread *th = threads->head; th != threads->end; th = th->next) { if (th->doing && th->doing != PTRACE_SINGLESTEP) { + if (!once) { + usleep(SCHEDULER_DELAY); + once = 1; + } install_breakpoints(th); ptrace(th->doing, th->id, NULL, th->signal); th->stopped = 0; |