Lines Matching refs:pid
59 trace_fail_warning(pid_t pid) in trace_fail_warning() argument
93 wait_for_proc(pid_t pid) in wait_for_proc() argument
99 if (waitpid(pid, NULL, __WALL) != pid) { in wait_for_proc()
108 trace_pid(pid_t pid) in trace_pid() argument
110 debug(DEBUG_PROCESS, "trace_pid: pid=%d", pid); in trace_pid()
114 if (ptrace(PTRACE_ATTACH, pid, 0, 0) < 0) in trace_pid()
117 return wait_for_proc(pid); in trace_pid()
126 pid_t pid = proc->pid; in trace_set_options() local
127 debug(DEBUG_PROCESS, "trace_set_options: pid=%d", pid); in trace_set_options()
132 if (ptrace(PTRACE_SETOPTIONS, pid, 0, (void *)options) < 0 && in trace_set_options()
133 ptrace(PTRACE_OLDSETOPTIONS, pid, 0, (void *)options) < 0) { in trace_set_options()
141 untrace_pid(pid_t pid) { in untrace_pid() argument
142 debug(DEBUG_PROCESS, "untrace_pid: pid=%d", pid); in untrace_pid()
143 ptrace(PTRACE_DETACH, pid, 0, 0); in untrace_pid()
147 continue_after_signal(pid_t pid, int signum) in continue_after_signal() argument
150 pid, signum); in continue_after_signal()
151 ptrace(PTRACE_SYSCALL, pid, 0, (void *)(uintptr_t)signum); in continue_after_signal()
157 if (event->proc != NULL && event->proc->pid == (pid_t)(uintptr_t)data) in event_for_pid()
163 have_events_for(pid_t pid) in have_events_for() argument
165 return each_qd_event(event_for_pid, (void *)(uintptr_t)pid) != NULL; in have_events_for()
169 continue_process(pid_t pid) in continue_process() argument
171 debug(DEBUG_PROCESS, "continue_process: pid=%d", pid); in continue_process()
176 if (!have_events_for(pid)) in continue_process()
179 ptrace(PTRACE_SYSCALL, pid, 0, 0); in continue_process()
186 get_task_info(struct pid_set *pids, pid_t pid) in get_task_info() argument
188 assert(pid != 0); in get_task_info()
191 if (pids->tasks[i].pid == pid) in get_task_info()
198 add_task_info(struct pid_set *pids, pid_t pid) in add_task_info() argument
211 task_info->pid = pid; in add_task_info()
218 enum process_status st = process_status(task->pid); in task_stopped()
245 struct pid_task *task_info = get_task_info(pids, task->pid); in task_blocked()
277 struct pid_task *task_info = get_task_info(pids, task->pid); in send_sigstop()
279 task_info = add_task_info(pids, task->pid); in send_sigstop()
315 if (task_kill(task->pid, SIGSTOP) >= 0) { in send_sigstop()
316 debug(DEBUG_PROCESS, "send SIGSTOP to %d", task->pid); in send_sigstop()
320 "Warning: couldn't send SIGSTOP to %d\n", task->pid); in send_sigstop()
341 ptrace(PTRACE_CONT, proc->pid, 0, 0); in ugly_workaround()
349 self->task_enabling_breakpoint->pid); in process_stopping_done()
354 if (self->pids.tasks[i].pid != 0 in process_stopping_done()
357 continue_process(self->pids.tasks[i].pid); in process_stopping_done()
358 continue_process(self->task_enabling_breakpoint->pid); in process_stopping_done()
396 untrace_pid(task->pid); in untrace_task()
426 struct process *proc = pid2proc(it->pid); in detach_process()
453 debug(DEBUG_PROCESS, "SIGSTOP delivered to %d", task_info->pid); in handle_stopping_event()
461 task_info->pid, task_info->sigstopped, in handle_stopping_event()
478 if (pids->tasks[i].pid != 0 in continue_for_sigstop_delivery()
483 pids->tasks[i].pid); in continue_for_sigstop_delivery()
484 ptrace(PTRACE_SYSCALL, pids->tasks[i].pid, 0, 0); in continue_for_sigstop_delivery()
512 task_info->pid); in await_sigstop_delivery()
516 ptrace(PTRACE_SYSCALL, task_info->pid, 0, 0); in await_sigstop_delivery()
528 if (pids->tasks[i].pid != 0 in await_sigstop_delivery()
545 if (pids->tasks[i].pid != 0 in all_stops_accountable()
547 && !have_events_for(pids->tasks[i].pid)) in all_stops_accountable()
631 self->task_enabling_breakpoint->pid, 0, 0)) { in singlestep()
667 teb->pid, breakpoint_name(sbp), sbp->addr, in singlestep_error()
677 ptrace(PTRACE_CONT, teb->pid, 0, 0); in pt_continue()
692 debug(DEBUG_PROCESS, "all stopped, now singlestep/cont %d", teb->pid); in disable_and()
727 task->pid, event->type, self->state); in process_stopping_on_event()
729 struct pid_task *task_info = get_task_info(&self->pids, task->pid); in process_stopping_on_event()
731 fprintf(stderr, "new task??? %d\n", task->pid); in process_stopping_on_event()
739 task_info->pid = 0; in process_stopping_on_event()
747 debug(1, "%d LT_EV_SYSRET", event->proc->pid); in process_stopping_on_event()
871 "process_install_stopping_handler: pid=%d", proc->pid); in process_install_stopping_handler()
916 proc->pid, sbp->addr); in continue_after_breakpoint()
921 continue_process(proc->pid); in continue_after_breakpoint()
926 continue_process(proc->pid); in continue_after_breakpoint()
953 task->pid, event->type); in ltrace_exiting_on_event()
955 struct pid_task *task_info = get_task_info(&self->pids, task->pid); in ltrace_exiting_on_event()
1054 event->proc->pid, event->type); in process_vfork_on_event()
1083 continue_process(proc->parent->pid); in process_vfork_on_event()
1095 debug(DEBUG_PROCESS, "continue_after_vfork: pid=%d", proc->pid); in continue_after_vfork()
1101 continue_process(proc->parent->pid); in continue_after_vfork()
1136 proc->pid); in continue_after_syscall()
1139 continue_process(proc->pid); in continue_after_syscall()
1145 continue_process(proc->pid); in continue_after_exec()
1155 wait_for_proc(proc->pid); in continue_after_exec()
1156 continue_process(proc->pid); in continue_after_exec()
1175 struct process *proc = pid2proc(it->pid); in os_ltrace_exiting()
1181 proc->pid); in os_ltrace_exiting()
1208 a.a = ptrace(PTRACE_PEEKTEXT, proc->pid, addr + offset, 0); in umovebytes()